diff --git a/fzf/.local/bin/fzf/fzf_powermenu b/fzf/.local/bin/fzf/fzf_powermenu index 194f0c440..fac0073fd 100755 --- a/fzf/.local/bin/fzf/fzf_powermenu +++ b/fzf/.local/bin/fzf/fzf_powermenu @@ -12,7 +12,7 @@ #Created: # Wed 10 March 2021, 12:34:47 PM [GMT+1] #Modified: -# Thu 20 October 2022, 05:33:49 AM [GMT+1] +# Fri 28 October 2022, 05:00:50 PM [GMT+1] # #Description: # @@ -23,73 +23,77 @@ # shellcheck disable=all getuptime() { - uptime -p >/dev/null 2>&1 + uptime -p >/dev/null 2>&1 - if [ "$?" -eq 0 ]; then - # Supports most Linux distro - # when the machine is up for less than '0' minutes then - # 'uptime -p' returns ONLY 'up', so we need to set a default value - UP_SET_OR_EMPTY=$(uptime -p | awk -F 'up ' '{print $2}') - UP=${UP_SET_OR_EMPTY:-'less than a minute'} - else - # Supports Mac OS X, Debian 7, etc - UP=$(uptime | sed -E 's/^[^,]*up *//; s/mins/minutes/; s/hrs?/hours/; + if [ "$?" -eq 0 ]; then + # Supports most Linux distro + # when the machine is up for less than '0' minutes then + # 'uptime -p' returns ONLY 'up', so we need to set a default value + UP_SET_OR_EMPTY=$(uptime -p | awk -F 'up ' '{print $2}') + UP=${UP_SET_OR_EMPTY:-'less than a minute'} + else + # Supports Mac OS X, Debian 7, etc + UP=$(uptime | sed -E 's/^[^,]*up *//; s/mins/minutes/; s/hrs?/hours/; s/([[:digit:]]+):0?([[:digit:]]+)/\1 hours, \2 minutes/; s/^1 hours/1 hour/; s/ 1 hours/ 1 hour/; s/min,/minutes,/; s/ 0 minutes,/ less than a minute,/; s/ 1 minutes/ 1 minute/; s/ / /; s/, *[[:digit:]]* users?.*//') - fi + fi - echo "$UP" + echo "$UP" } asksetting() { - options=" Lock + options=" Lock 望 Sleep  Logout  Restart 襤 Shutdown" - echo -e "Uptime: $(getuptime) + echo -e "Uptime: $(getuptime) $options" | fzf --prompt="Power Settings: " --border=rounded --margin=1% --color=dark --height 100% --reverse --header=" POWER MENU " --info=hidden --header-first } triggerFunction() { - init_system="$(cat /proc/1/comm)" - if [[ $init_system = "systemd" ]]; then - systemctl "$1" - elif [[ $init_system = "init" ]]; then - loginctl "$1" - elif [[ $init_system = "runit" ]]; then - loginctl "$1" - else - systemctl "$1" - fi + init_system="$(cat /proc/1/comm)" + if [[ $init_system = "systemd" ]]; then + systemctl "$1" + elif [[ $init_system = "init" ]]; then + loginctl "$1" + elif [[ $init_system = "runit" ]]; then + loginctl "$1" + else + systemctl "$1" + fi } LOOPSETTING="true" while [ -n "$LOOPSETTING" ]; do - CHOICE="$(asksetting "$@")" - [ -n "$CHOICE" ] || exit - unset LOOPSETTING - case "$CHOICE" in - *Logout) - pkill -KILL -u "$USER" - ;; - *Lock) - multimonitorlock -l -- --time-str="%I:%M:%S %p" - ;; - *Shutdown) - triggerFunction poweroff - ;; - *Restart) - triggerFunction reboot - ;; - *Sleep) - triggerFunction suspend - ;; - *) - echo "Program terminated." && exit 1 - ;; - esac + CHOICE="$(asksetting "$@")" + [ -n "$CHOICE" ] || exit + unset LOOPSETTING + case "$CHOICE" in + *Logout) + if [[ "$DESKTOP_SESSION" == "i3" ]]; then + i3-msg exit + else + pkill -KILL -u "$USER" + fi + ;; + *Lock) + multimonitorlock -l -- --time-str="%I:%M:%S %p" + ;; + *Shutdown) + triggerFunction poweroff + ;; + *Restart) + triggerFunction reboot + ;; + *Sleep) + triggerFunction suspend + ;; + *) + echo "Program terminated." && exit 1 + ;; + esac done diff --git a/package-list/.config/package-list b/package-list/.config/package-list index 61ec6cbb4..9ec45d706 100644 --- a/package-list/.config/package-list +++ b/package-list/.config/package-list @@ -38,6 +38,7 @@ i3-session i3-swallow i3lock-color imagewriter +jetbrains-toolbox lib32-libxft-bgra libart-lgpl libxft-bgra diff --git a/polybar/.config/polybar/modules.ini b/polybar/.config/polybar/modules.ini index 1b0789adb..513c42862 100644 --- a/polybar/.config/polybar/modules.ini +++ b/polybar/.config/polybar/modules.ini @@ -139,23 +139,23 @@ format-discharging-padding = 1 label-charging = %percentage%% label-discharging = %percentage%% -label-full =  +label-full =  label-full-background = ${color.orange} label-full-foreground = ${color.fg} label-full-padding = 1 -ramp-capacity-0 =  -ramp-capacity-1 =  -ramp-capacity-2 =  -ramp-capacity-3 =  -ramp-capacity-4 =  +ramp-capacity-0 =  +ramp-capacity-1 =  +ramp-capacity-2 =  +ramp-capacity-3 =  +ramp-capacity-4 =  -animation-charging-0 =  -animation-charging-1 =  -animation-charging-2 =  -animation-charging-3 =  -animation-charging-4 =  -animation-charging-5 =  +animation-charging-0 =  +animation-charging-1 =  +animation-charging-2 =  +animation-charging-3 =  +animation-charging-4 =  +animation-charging-5 =  animation-charging-framerate = 750 @@ -178,7 +178,7 @@ type = internal/cpu interval = 0.5 -format =  +format = ﬙ format-background = ${color.red} format-foreground = ${color.fg} format-padding = 1 @@ -208,8 +208,8 @@ type = internal/date interval = 1.0 -time =  -time-alt =  +time =  +time-alt =  format =