summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x.local/bin/conky/getif.sh10
-rwxr-xr-x.local/bin/conky/net.sh10
-rwxr-xr-x.local/bin/conky/weather.sh2
-rwxr-xr-x.local/bin/powercmd48
4 files changed, 25 insertions, 45 deletions
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
;;
*)