refactor: moved useful scripts from the bspwm folder to more appropriate locations;
fix: checkupdates script for fastfetch causing delays; chore: removed bspwm and picom since I haven't been using or maintaining them
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
},
|
||||
{
|
||||
"type": "command",
|
||||
"text": "~/.config/bspwm/checkupdates.sh",
|
||||
"text": "~/.config/fastfetch/scripts/updates.sh",
|
||||
"keyIcon": "",
|
||||
"key": ""
|
||||
},
|
||||
|
||||
2
fastfetch/scripts/fetch_update_count.sh
Executable file
2
fastfetch/scripts/fetch_update_count.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
exec checkupdates | wc -l > /tmp/checkupdates & disown
|
||||
24
fastfetch/scripts/updates.sh
Executable file
24
fastfetch/scripts/updates.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Always read from cache and return immediately
|
||||
count=$(cat /tmp/checkupdates 2>/dev/null)
|
||||
# nohup checkupdates > /tmp/checkupdates & disown
|
||||
# $(checkupdates | wc -l > /tmp/checkupdates) & disown
|
||||
|
||||
if [[ $? -ne 0 ]] || [[ -z "$count" ]]; then
|
||||
status="Unknown"
|
||||
else
|
||||
if [[ $count == "Unknown" ]]; then
|
||||
status="Unknown"
|
||||
elif [[ $count -eq 0 ]]; then
|
||||
status="Up to date"
|
||||
elif [[ $count -eq 1 ]]; then
|
||||
status="$count update"
|
||||
else
|
||||
status="$count updates"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$status"
|
||||
|
||||
exec "$HOME/.config/fastfetch/scripts/fetch_update_count.sh" & disown
|
||||
Reference in New Issue
Block a user