From ffd34bb6b14921710848180254db9ac9c6c9814e Mon Sep 17 00:00:00 2001 From: tavo Date: Mon, 16 Jun 2025 13:45:19 -0600 Subject: [PATCH] update --- scripts/menu/menu | 15 +++++++++++---- scripts/menu/menu-power | 25 ++++++++++++++++++++++--- scripts/status/cpustat | 2 +- scripts/status/memorystat | 2 +- scripts/sway/swaystatus | 25 ++++++++++++------------- shell/gui.sh | 4 ++-- shell/profile.d/config.sh | 4 ++-- sway/config | 8 ++++---- tmux/tmux.conf | 3 ++- 9 files changed, 57 insertions(+), 31 deletions(-) diff --git a/scripts/menu/menu b/scripts/menu/menu index 607860c..2baab03 100755 --- a/scripts/menu/menu +++ b/scripts/menu/menu @@ -1,12 +1,12 @@ #!/bin/sh PROMPT="$1" MODE="$2" if [ "$PROMPT" = "" -o "$PROMPT" = "-h" ] ; then printf "Usage: menu [prompt] [run/pass]\n" ; return 0 ; fi -[ "$MODE" = "pass" ] && BPASS="-x" DPASS="-P" -BRUN="-run" DRUN="_run" TRUN="-run" FRUN="" -[ "$MODE" != "run" ] && BRUN="" DRUN="" TRUN="" FRUN="" +[ "$MODE" = "pass" ] && BPASS="-x" DPASS="-P" WPASS="-P" +BRUN="-run" DRUN="_run" TRUN="-run" FRUN="" WRUN="--show drun -I" +[ "$MODE" != "run" ] && BRUN="" DRUN="" TRUN="" FRUN="" WRUN="--show dmenu" # Configuration -menu="menu_dmenu" +menu="menu_wofi" font="JetbrainsMono" font_size="10" col_white="#ebdbb2" # White @@ -66,4 +66,11 @@ fzf \ --reverse } +menu_wofi() { +wofi $WRUN \ + -i \ + --prompt "$PROMPT" \ + $WPASS +} + $menu diff --git a/scripts/menu/menu-power b/scripts/menu/menu-power index 30b6a05..d6a6563 100755 --- a/scripts/menu/menu-power +++ b/scripts/menu/menu-power @@ -8,14 +8,34 @@ _logout() { pkill xinit return 0 fi + if ps -a | grep -q 'tty1.*sway' ; then + pkill sway + return 0 + fi } _shutdown() { - shutdown now + if [ -e "/bin/shutdown" ]; then + sd="/bin/shutdown" + elif [ -e "/sbin/shutdown" ]; then + sd="/sbin/shutdown" + else + sd="$(command -v shutdown)" + fi + + "$sd" now } _reboot() { - shutdown -r 0 + if [ -e "/bin/shutdown" ]; then + sd="/bin/shutdown" + elif [ -e "/sbin/shutdown" ]; then + sd="/sbin/shutdown" + else + sd="$(command -v shutdown)" + fi + + "$sd" -r 0 } case "$option" in @@ -24,4 +44,3 @@ case "$option" in "Log out") _logout ;; *) exit 1 ;; esac - diff --git a/scripts/status/cpustat b/scripts/status/cpustat index c3075f1..faa13a4 100755 --- a/scripts/status/cpustat +++ b/scripts/status/cpustat @@ -18,4 +18,4 @@ fi load=$({ head -n1 /proc/stat;sleep 0.3;head -n1 /proc/stat; } | awk '/^cpu /{u=$2-u;s=$4-s;i=$5-i;w=$6-w}END{print int(0.5+100*(u+s+w)/(u+s+i+w))}') -echo "$load%" > "$cache_file" +printf '%02d%%\n' "$load" > "$cache_file" diff --git a/scripts/status/memorystat b/scripts/status/memorystat index 68881f5..5fd2656 100755 --- a/scripts/status/memorystat +++ b/scripts/status/memorystat @@ -1,4 +1,4 @@ #!/bin/sh # Get current RAM memory usage -free --mebi | sed -n '2{p;q}' | awk '{printf ("%2.1fG", ( $3 / 1024), ($2 / 1024))}' +free --mebi | sed -n '2{p;q}' | awk '{printf ("%04.1fG", ( $3 / 1024), ($2 / 1024))}' diff --git a/scripts/sway/swaystatus b/scripts/sway/swaystatus index 85af02b..ec879a1 100755 --- a/scripts/sway/swaystatus +++ b/scripts/sway/swaystatus @@ -1,18 +1,7 @@ #!/bin/sh +once="$1" separator=" " -get_todo() { - todo="$(calcurse -t | wc -l)" - [ "$todo" = "0" ] && return 0 - echo " $todo" -} - -get_apts() { - apts="$(calcurse -a | grep -c '\*')" - [ "$apts" = "0" ] && return 0 - echo "󰃭 $apts" -} - get_layout() { layout="$(swaymsg -t get_inputs | grep -m 1 'xkb_active_layout_name' | cut -d '"' -f 4)" [ "$layout" = "English (US)" ] && layout="us" @@ -35,6 +24,12 @@ while true ; do microphone="$(micstat)" ! [ -z "$microphone" ] && status="$status$separator$microphone" + cpu="$(cpustat)" + ! [ -z "$cpu" ] && status="$status$separator $cpu" + + ram="$(memorystat)" + ! [ -z "$ram" ] && status="$status$separator $ram" + network="$(netstat)" ! [ -z "$network" ] && status="$status$separator$network" @@ -48,6 +43,10 @@ while true ; do ! [ -z "$date_time" ] && status="$status$separator󰥔 $date_time" printf "%s\n" "$status" - # exit 0 # Testing + + if [ -n "$once" ]; then + exit 0 + fi + sleep 0.4 done diff --git a/shell/gui.sh b/shell/gui.sh index e2158de..fbe403f 100644 --- a/shell/gui.sh +++ b/shell/gui.sh @@ -2,7 +2,7 @@ if [ "$(tty)" = "/dev/tty1" ] ; then ## KDE WAYLAND - exec /usr/lib/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland + #exec /usr/lib/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland ## DWM #sleep 0.5 @@ -10,5 +10,5 @@ if [ "$(tty)" = "/dev/tty1" ] ; then #XDG_SESSION_TYPE=x11 GDK_BACKEND=x11 exec startx ## SWAY - #exec sway + exec sway fi diff --git a/shell/profile.d/config.sh b/shell/profile.d/config.sh index c1d31b1..c20190e 100644 --- a/shell/profile.d/config.sh +++ b/shell/profile.d/config.sh @@ -1,5 +1,5 @@ +export GTK_THEME="Adwaita-dark" +export XCURSOR_THEME="Adwaita" #export QT_QPA_PLATFORMTHEME="qt5ct" -#export GTK_THEME="Materia:dark" -#export XCURSOR_THEME="Adwaita" export CM_SELECTIONS="clipboard" export CM_MAX_CLIPS=10 diff --git a/sway/config b/sway/config index 7720854..1047d7c 100644 --- a/sway/config +++ b/sway/config @@ -117,23 +117,23 @@ gaps inner 5 font pango:JetBrainsMono Medium 8 bar { - position top + position bottom font pango:JetBrainsMono Bold 9 status_command ~/.config/scripts/sway/swaystatus tray_padding 4 colors { background #00000000 - statusline #7a847880 + statusline #7a847890 focused_workspace $col_fg $col_fg $col_bg inactive_workspace #00000000 #00000000 #ebdbb270 } } -for_window [class="Display-im6.q16"] floating enable +for_window [class="Display-im6.q16"] floating enable # Autostart exec wl-paste -t text --watch clipman store exec wl-paste -p -t text --watch clipman store --histpath="~/.local/share/clipman.json" exec_always dbus-update-activation-environment WAYLAND_DISPLAY -exec_always --no-startup-id /usr/libexec/xdg-desktop-portal -r \ No newline at end of file +exec_always --no-startup-id /usr/libexec/xdg-desktop-portal -r diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 5bff64d..632abc4 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -3,7 +3,8 @@ setw -g pane-base-index 1 set-option -g renumber-windows on set -g status-style bg=default -set -g status-right "" +set -g status-right "#(statusbar 1)" +set -g status-interval 2 set -g status-left "" set -g window-status-format "#[fg=black]#I:#W" set -g window-status-current-format "#[fg=cyan bold]#I:#W"