diff options
Diffstat (limited to '')
-rw-r--r-- | .config/conky/conkyrc | 2 | ||||
-rwxr-xr-x | .local/bin/conky/getif.sh | 10 | ||||
-rwxr-xr-x | .local/bin/conky/net.sh | 10 | ||||
-rwxr-xr-x | .local/bin/conky/weather.sh | 2 | ||||
-rwxr-xr-x | .local/bin/powercmd | 48 |
5 files changed, 26 insertions, 46 deletions
diff --git a/.config/conky/conkyrc b/.config/conky/conkyrc index deb40e9..fcb5053 100644 --- a/.config/conky/conkyrc +++ b/.config/conky/conkyrc @@ -61,7 +61,7 @@ ${goto 130}${scroll wait 30 3 1 ${mpd_title}} ${goto 130}${mpd_elapsed}/${mpd_length} ${mpd_bar} ${execi 5 ~/.local/bin/conky/cover.sh >/dev/null 2>&1}${image /tmp/conkyCover.png -p 0,150 -n}${font} -${endif}${execpi 1800 ~/.local/bin/conky/weather.sh} +${endif}${execpi 300 ~/.local/bin/conky/weather.sh} ${font1}CPU ${hr} ${color #928374}CPU: ${font2}${color #ebdbb2} ${freq_g} GHz ${color #ebdbb2}${cpu}% ${cpugraph 50,380 ebdbb2 928374 -t} diff --git a/.local/bin/conky/getif.sh b/.local/bin/conky/getif.sh index 78a02ef..cf7d921 100755 --- a/.local/bin/conky/getif.sh +++ b/.local/bin/conky/getif.sh @@ -1,19 +1,17 @@ #!/bin/sh -os=$(cat "/tmp/os") - # ifconfig | command grep '^[a-z]' | awk '{print $1}' | sed '{/lo/d;s/://;}' -case $os in - 1) +case "$(hostname -s)" in + mother) if_main="eth1" if_alt="eth0" ;; - 2) + po-rbo) if_main="enx4ce1734c425a" if_alt="wlp1s0" ;; - 3) + fbsd-tp) if_main="em0" if_alt="wlan0" exit diff --git a/.local/bin/conky/net.sh b/.local/bin/conky/net.sh index 1cdc930..efbb16f 100755 --- a/.local/bin/conky/net.sh +++ b/.local/bin/conky/net.sh @@ -1,17 +1,15 @@ #!/bin/sh -os=$(cat "/tmp/os") - -case $os in - 1) +case "$(hostname -s)" in + mother) if_main="eth1" if_alt="eth0" ;; - 2) + po-rbo) if_main="enx4ce1734c425a" if_alt="wlp1s0" ;; - 3) + fbsd-tp) if_main="em0" if_alt="wlan0" exit diff --git a/.local/bin/conky/weather.sh b/.local/bin/conky/weather.sh index b724fb6..83df4f8 100755 --- a/.local/bin/conky/weather.sh +++ b/.local/bin/conky/weather.sh @@ -1,7 +1,5 @@ #!/bin/sh -os=$(cat /tmp/os) - case "$(hostname -s)" in mother | po-rbo) ping -c1 -w1 1.1.1.1 >/dev/null 2>&1 || exit diff --git a/.local/bin/powercmd b/.local/bin/powercmd index 9b83e4b..371f911 100755 --- a/.local/bin/powercmd +++ b/.local/bin/powercmd @@ -2,25 +2,11 @@ [ -z "$1" ] && echo "no arg" && exit 1 -os="$(uname)" - -if [ "$os" = "Linux" ]; then - grep "Artix" /etc/issue >/dev/null 2>&1 && os=1 || os=2 -elif [ "$os" = "FreeBSD" ]; then - os=3 -else - echo "unknown OS" - exit 1 -fi - -# 1: Artix -# 2: Pop OS -# 3: FreeBSD - -case $os in - 1) icon=" " ;; - 2) icon=" " ;; - 3) icon=" " ;; +host="$(hostname -s)" +case $host in + mother) icon=" " ;; + po-rbo) icon=" " ;; + fbsd-tp) icon=" " ;; esac case $1 in @@ -30,30 +16,30 @@ case $1 in sleep 1 xscreensaver-command -lock sleep 5 - case $os in - 1) loginctl suspend ;; - 2) systemctl suspend ;; - 3) acpiconf -s 3 ;; + case $host in + mother) loginctl suspend ;; + po-rbo) systemctl suspend ;; + fbsd-tp) acpiconf -s 3 ;; esac ;; "reboot") emacsclient -e '"(save-buffers-kill-emacs)"' >/dev/null 2>&1 notify-send -u normal reboot "$icon Rebootin' now!" sleep 2 - case $os in - 1) loginctl reboot ;; - 2) systemctl reboot ;; - 3) shutdown -r now ;; + case $host in + mother) loginctl reboot ;; + po-rbo) systemctl reboot ;; + fbsd-tp) shutdown -r now ;; esac ;; "poweroff") emacsclient -e '"(save-buffers-kill-emacs)"' >/dev/null 2>&1 notify-send -u normal poweroff "$icon Farewell, partner!" sleep 2 - case $os in - 1) loginctl poweroff ;; - 2) systemctl poweroff ;; - 3) shutdown -p now ;; + case $host in + mother) loginctl poweroff ;; + po-rbo) systemctl poweroff ;; + fbsd-tp) shutdown -p now ;; esac ;; *) |