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

@ -83,7 +83,7 @@ alias \
alias \ alias \
calcurse="calcurse-select" \ calcurse="calcurse-select" \
alias \ alias \
usta="systemctl --user start" \ usta="systemctl --user start" \
usto="systemctl --user stop" \ usto="systemctl --user stop" \
ures="systemctl --user restart" \ ures="systemctl --user restart" \

View File

@ -57,7 +57,7 @@ bind-key -r l select-pane -R
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Plugin Manager - https://github.com/tmux-plugins/tpm # 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 2) Reload tmux if it's already started with `r
# Step 3) Launch tmux and hit `I (capital i) to fetch any plugins # 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" ;; exec "$HOME/.dwm/start-dwm.sh" ;;
xmonad) xmonad)
exec "$HOME/.xmonad/start-xmonad.sh" ;; exec "$HOME/.xmonad/start-xmonad.sh" ;;
mint)
exec cinnamon-session ;;
gnome)
exec gnome ;;
*) *)
exec twm ;; exec twm ;;
esac esac

View File

@ -3,7 +3,7 @@
homeval=$(df -h -B 1048576 | grep "/home") homeval=$(df -h -B 1048576 | grep "/home")
case $BUTTON in 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 3) notify-send "Disk module" "Shows disk usage information
- Click to show all disk info." ;; - Click to show all disk info." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;;

View File

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

View File

@ -23,11 +23,10 @@ lock(){
kill -44 $(pidof dwmblocks) 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 ;; 'lock') lock ;;
"leave $WM") kill -TERM "$(wmpid)" ;; "leave $WM") kill -TERM "$(wmpid)" ;;
"renew $WM") kill -HUP "$(wmpid)" ;; "renew $WM") kill -HUP "$(wmpid)" ;;
'hibernate') slock $ctl hibernate -i ;;
'sleep') slock $ctl suspend -i ;; 'sleep') slock $ctl suspend -i ;;
'reboot') $ctl reboot -i ;; 'reboot') $ctl reboot -i ;;
'shutdown') $ctl poweroff -i ;; 'shutdown') $ctl poweroff -i ;;