This commit is contained in:
Solomon Laing 2025-12-12 18:05:35 +10:30
parent 68ba833271
commit 5316de1d15
6 changed files with 19 additions and 20 deletions

View File

@ -57,7 +57,7 @@ bind-key -r l select-pane -R
# -----------------------------------------------------------------------------
# Plugin Manager - https://github.com/tmux-plugins/tpm
# Step 1) git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Step 1) git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
# Step 2) Reload tmux if it's already started with `r
# Step 3) Launch tmux and hit `I (capital i) to fetch any plugins
# -----------------------------------------------------------------------------

View File

@ -20,6 +20,10 @@ case $session in
exec "$HOME/.dwm/start-dwm.sh" ;;
xmonad)
exec "$HOME/.xmonad/start-xmonad.sh" ;;
mint)
exec cinnamon-session ;;
gnome)
exec gnome ;;
*)
exec twm ;;
esac

View File

@ -3,7 +3,7 @@
homeval=$(df -h -B 1048576 | grep "/home")
case $BUTTON in
1) notify-send "Disk space" "$(df -h --output=target,used,size)" ;;
1) notify-send "Disk space" "$(df -h --output=target,used,size --type=ext4 --type=nfs4)" ;;
3) notify-send "Disk module" "Shows disk usage information
- Click to show all disk info." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;

View File

@ -1,18 +1,13 @@
#!/bin/bash
# Show wifi  and percent strength or 󰖪 if none.
# Show  if connected to ethernet or ❎ if none.
# Show 🔒 if a vpn connection is active
case $BUTTON in
1) "$TERMINAL" -e nmtui; pkill -RTMIN+15 dwmblocks ;;
3) notify-send "Internet module" "- Click to connect
󰯡 : wifi disabled
󰖪 : no wifi connection
 : wifi connection with quality
󰅛 : no ethernet
󰱓 : ethernet working
 : vpn is active
3) notify-send "Internet module" "Click to connect
󰖪 : no wifi
 : wifi connection
󰈂 : no ethernet
󰈁 : ethernet connection
 : vpn active
" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
@ -20,13 +15,14 @@ esac
# Wifi
if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then
wifiicon="$(awk '/^\s*w/ { print " ", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
# this is broken, god knows why, who needs signal strength anyway...
# wifiicon="$(awk '/^\s*w/ { print " ", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
# elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
[ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="󰖩 " || wifiicon="󰖪 "
fi
# Ethernet
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐" || ethericon="󰪎"
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="󰈁 " || ethericon="󰈂 "
# TUN
[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" "

View File

@ -23,11 +23,10 @@ lock(){
kill -44 $(pidof dwmblocks)
}
case "$(printf "lock\nleave $WM\nrenew $WM\nhibernate\nreboot\nshutdown\nsleep\ndisplay off" | dmenu -i -p 'Action: ')" in
case "$(printf "lock\nleave $WM\nrenew $WM\nreboot\nshutdown\nsleep\ndisplay off" | dmenu -i -p 'Action: ')" in
'lock') lock ;;
"leave $WM") kill -TERM "$(wmpid)" ;;
"renew $WM") kill -HUP "$(wmpid)" ;;
'hibernate') slock $ctl hibernate -i ;;
'sleep') slock $ctl suspend -i ;;
'reboot') $ctl reboot -i ;;
'shutdown') $ctl poweroff -i ;;