This commit is contained in:
tavo 2025-06-16 13:45:19 -06:00
parent 00c4fd9730
commit ffd34bb6b1
9 changed files with 57 additions and 31 deletions

View file

@ -1,12 +1,12 @@
#!/bin/sh #!/bin/sh
PROMPT="$1" MODE="$2" PROMPT="$1" MODE="$2"
if [ "$PROMPT" = "" -o "$PROMPT" = "-h" ] ; then printf "Usage: menu [prompt] [run/pass]\n" ; return 0 ; fi if [ "$PROMPT" = "" -o "$PROMPT" = "-h" ] ; then printf "Usage: menu [prompt] [run/pass]\n" ; return 0 ; fi
[ "$MODE" = "pass" ] && BPASS="-x" DPASS="-P" [ "$MODE" = "pass" ] && BPASS="-x" DPASS="-P" WPASS="-P"
BRUN="-run" DRUN="_run" TRUN="-run" FRUN="" BRUN="-run" DRUN="_run" TRUN="-run" FRUN="" WRUN="--show drun -I"
[ "$MODE" != "run" ] && BRUN="" DRUN="" TRUN="" FRUN="" [ "$MODE" != "run" ] && BRUN="" DRUN="" TRUN="" FRUN="" WRUN="--show dmenu"
# Configuration # Configuration
menu="menu_dmenu" menu="menu_wofi"
font="JetbrainsMono" font="JetbrainsMono"
font_size="10" font_size="10"
col_white="#ebdbb2" # White col_white="#ebdbb2" # White
@ -66,4 +66,11 @@ fzf \
--reverse --reverse
} }
menu_wofi() {
wofi $WRUN \
-i \
--prompt "$PROMPT" \
$WPASS
}
$menu $menu

View file

@ -8,14 +8,34 @@ _logout() {
pkill xinit pkill xinit
return 0 return 0
fi fi
if ps -a | grep -q 'tty1.*sway' ; then
pkill sway
return 0
fi
} }
_shutdown() { _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() { _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 case "$option" in
@ -24,4 +44,3 @@ case "$option" in
"Log out") _logout ;; "Log out") _logout ;;
*) exit 1 ;; *) exit 1 ;;
esac esac

View file

@ -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))}') 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"

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
# Get current RAM memory usage # 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))}'

View file

@ -1,18 +1,7 @@
#!/bin/sh #!/bin/sh
once="$1"
separator=" " 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() { get_layout() {
layout="$(swaymsg -t get_inputs | grep -m 1 'xkb_active_layout_name' | cut -d '"' -f 4)" layout="$(swaymsg -t get_inputs | grep -m 1 'xkb_active_layout_name' | cut -d '"' -f 4)"
[ "$layout" = "English (US)" ] && layout="us" [ "$layout" = "English (US)" ] && layout="us"
@ -35,6 +24,12 @@ while true ; do
microphone="$(micstat)" microphone="$(micstat)"
! [ -z "$microphone" ] && status="$status$separator$microphone" ! [ -z "$microphone" ] && status="$status$separator$microphone"
cpu="$(cpustat)"
! [ -z "$cpu" ] && status="$status$separator $cpu"
ram="$(memorystat)"
! [ -z "$ram" ] && status="$status$separator $ram"
network="$(netstat)" network="$(netstat)"
! [ -z "$network" ] && status="$status$separator$network" ! [ -z "$network" ] && status="$status$separator$network"
@ -48,6 +43,10 @@ while true ; do
! [ -z "$date_time" ] && status="$status$separator󰥔 $date_time" ! [ -z "$date_time" ] && status="$status$separator󰥔 $date_time"
printf "%s\n" "$status" printf "%s\n" "$status"
# exit 0 # Testing
if [ -n "$once" ]; then
exit 0
fi
sleep 0.4 sleep 0.4
done done

View file

@ -2,7 +2,7 @@
if [ "$(tty)" = "/dev/tty1" ] ; then if [ "$(tty)" = "/dev/tty1" ] ; then
## KDE WAYLAND ## 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 ## DWM
#sleep 0.5 #sleep 0.5
@ -10,5 +10,5 @@ if [ "$(tty)" = "/dev/tty1" ] ; then
#XDG_SESSION_TYPE=x11 GDK_BACKEND=x11 exec startx #XDG_SESSION_TYPE=x11 GDK_BACKEND=x11 exec startx
## SWAY ## SWAY
#exec sway exec sway
fi fi

View file

@ -1,5 +1,5 @@
export GTK_THEME="Adwaita-dark"
export XCURSOR_THEME="Adwaita"
#export QT_QPA_PLATFORMTHEME="qt5ct" #export QT_QPA_PLATFORMTHEME="qt5ct"
#export GTK_THEME="Materia:dark"
#export XCURSOR_THEME="Adwaita"
export CM_SELECTIONS="clipboard" export CM_SELECTIONS="clipboard"
export CM_MAX_CLIPS=10 export CM_MAX_CLIPS=10

View file

@ -117,14 +117,14 @@ gaps inner 5
font pango:JetBrainsMono Medium 8 font pango:JetBrainsMono Medium 8
bar { bar {
position top position bottom
font pango:JetBrainsMono Bold 9 font pango:JetBrainsMono Bold 9
status_command ~/.config/scripts/sway/swaystatus status_command ~/.config/scripts/sway/swaystatus
tray_padding 4 tray_padding 4
colors { colors {
background #00000000 background #00000000
statusline #7a847880 statusline #7a847890
focused_workspace $col_fg $col_fg $col_bg focused_workspace $col_fg $col_fg $col_bg
inactive_workspace #00000000 #00000000 #ebdbb270 inactive_workspace #00000000 #00000000 #ebdbb270
} }

View file

@ -3,7 +3,8 @@ setw -g pane-base-index 1
set-option -g renumber-windows on set-option -g renumber-windows on
set -g status-style bg=default 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 status-left ""
set -g window-status-format "#[fg=black]#I:#W" set -g window-status-format "#[fg=black]#I:#W"
set -g window-status-current-format "#[fg=cyan bold]#I:#W" set -g window-status-current-format "#[fg=cyan bold]#I:#W"