summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2021-10-02 11:53:40 -0400
committerLuke Smith <luke@lukesmith.xyz>2021-10-02 11:53:40 -0400
commit163738e6ad1954c8a8a16dae98829c51cf9da4be (patch)
tree8742b1c2f7751abf47886aeea6622eabe81c464a
parenta3a630a3e839a730d26a137f35cce2065bbbb16f (diff)
parent162ed8889b9893b790ca529e564d976f8190e3f3 (diff)
downloadeibhear-163738e6ad1954c8a8a16dae98829c51cf9da4be.tar.gz
eibhear-163738e6ad1954c8a8a16dae98829c51cf9da4be.tar.zst
eibhear-163738e6ad1954c8a8a16dae98829c51cf9da4be.zip
Merge branch 'master' of github.com:LukeSmithxyz/voidrice
-rwxr-xr-x.config/pinentry/preexec (renamed from pinentry/preexec)0
-rw-r--r--.config/shell/aliasrc2
-rwxr-xr-x.local/bin/dmenuumount2
-rwxr-xr-x.local/bin/statusbar/sb-internet9
-rwxr-xr-x.local/bin/sysact30
5 files changed, 20 insertions, 23 deletions
diff --git a/pinentry/preexec b/.config/pinentry/preexec
index 93603c7..93603c7 100755
--- a/pinentry/preexec
+++ b/.config/pinentry/preexec
diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc
index 0890ccd..ad71695 100644
--- a/.config/shell/aliasrc
+++ b/.config/shell/aliasrc
@@ -35,7 +35,7 @@ alias \
g="git" \
trem="transmission-remote" \
YT="youtube-viewer" \
- sdn="sudo shutdown -h now" \
+ sdn="shutdown -h now" \
e="$EDITOR" \
v="$EDITOR" \
p="pacman" \
diff --git a/.local/bin/dmenuumount b/.local/bin/dmenuumount
index f7d0747..946d12c 100755
--- a/.local/bin/dmenuumount
+++ b/.local/bin/dmenuumount
@@ -26,7 +26,7 @@ asktype() { \
esac
}
-drives=$(lsblk -nrpo "name,type,size,mountpoint,label" | sed 's/ /:/g' | awk -F':' '$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}')
+drives=$(lsblk -nrpo "name,type,size,mountpoint,label" | awk -F':' '{gsub(/ /,":")}$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}')
if ! grep simple-mtpfs /etc/mtab; then
[ -z "$drives" ] && echo "No drives to unmount." && exit
diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet
index d3948d7..94b7da2 100755
--- a/.local/bin/statusbar/sb-internet
+++ b/.local/bin/statusbar/sb-internet
@@ -17,9 +17,10 @@ case $BLOCK_BUTTON in
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
-case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
- down) [ "$(cat /sys/class/net/w*/flags)" = "0x1002" ] && wifiicon="❌ " || wifiicon="📡 " ;;
- up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;;
-esac
+if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
+ wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
+elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then
+ grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="📡 " || wifiicon="❌ "
+fi
printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)"
diff --git a/.local/bin/sysact b/.local/bin/sysact
index a820158..451815d 100755
--- a/.local/bin/sysact
+++ b/.local/bin/sysact
@@ -1,22 +1,18 @@
#!/bin/sh
-
# A dmenu wrapper script for system functions.
-
-# For non-systemd init systems.
case "$(readlink -f /sbin/init)" in
- *runit*) hib="sudo -A zzz" ;;
- *openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p 0" ;;
+ *systemd*) ctl='systemctl' ;;
+ *) ctl='loginctl' ;;
esac
-cmds="\
-🔒 lock slock
-🚪 leave dwm kill -TERM $(pgrep -u $USER "\bdwm$")
-♻ renew dwm kill -HUP $(pgrep -u $USER "\bdwm$")
-🐻 hibernate slock ${hib:-systemctl suspend-then-hibernate -i}
-🔃 reboot ${reb:-sudo -A reboot}
-🖥 shutdown ${shut:-sudo -A shutdown -h now}
-📺 display off xset dpms force off"
-
-choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1
-
-eval "$(echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-)"
+case "$(printf "🔒 lock\n🚪 leave dwm\n♻️ renew dwm\n🐻 hibernate\n💤 sleep\n🔃 reboot\n🖥️shutdown\n📺 display off" | dmenu -i -p 'Action: ')" in
+ '🔒 lock') slock ;;
+ '🚪 leave dwm') kill -TERM "$(pgrep -u "$USER" "\bdwm$")" ;;
+ '♻️ renew dwm') kill -HUP "$(pgrep -u "$USER" "\bdwm$")" ;;
+ '🐻 hibernate') slock $ctl hibernate ;;
+ '💤 sleep') slock $ctl suspend ;;
+ '🔃 reboot') $ctl reboot ;;
+ '🖥️shutdown') $ctl poweroff ;;
+ '📺 display off') xset dpms force off ;;
+ *) exit 1 ;;
+esac