diff --git a/polybar/config.ini b/polybar/config.ini index f34b9a2..00b3ccc 100644 --- a/polybar/config.ini +++ b/polybar/config.ini @@ -1,15 +1,17 @@ [colors] - ; This is colors for ayu theme (https://github.com/ayu-theme/ayu-colors) primary = #ffa759 background = #202734 -background-alt = # +background-alt = #191e2a foreground = #cbccc6 [bar/main] width = 100% -height = 40 +height = 35 fixed-center = true +offset-y = 13 +offset-x = 14 +padding-right = 2 background = ${colors.background} foreground = ${colors.foreground} @@ -17,7 +19,6 @@ foreground = ${colors.foreground} font-0 = FiraCode:size=11 font-1 = FontAwesome5Brands:size=11 font-2 = FontAwesome5FreeSolid:size=11 -font-3 = FiraCode:size=12 modules-left = workspaces modules-center = date @@ -25,9 +26,6 @@ modules-right = keyboard-layout volume-control network power-menu module-margin = 1 -padding = 1 - -separator = | ; ; LEFT MODULES @@ -37,10 +35,10 @@ separator = | type = internal/i3 ; Current active workspace -; %{T4} forces this label to use font-3 -label-focused = "%{T4}%index%" +label-focused = "%index%" label-focused-foreground = ${colors.primary} -label-focused-padding = 1 +label-focused-background = ${colors.background-alt} +label-focused-padding = 2 ; All the other workspaces but the active label-unfocused = ${self.label-focused} @@ -62,6 +60,7 @@ label-maxlen = 40 ; CENTER MODULES ; + [module/date] type = internal/date @@ -80,6 +79,10 @@ type = internal/xkeyboard format = label-layout = %layout% +layout-icon-default = some icon +layout-icon-0 = us;πŸ‡ΊπŸ‡Έ +layout-icon-1 = ru;πŸ‡·πŸ‡Ί + [module/volume-control] type = internal/pulseaudio @@ -102,23 +105,9 @@ label-connected = ο›Ώ label-disconnected = No Network [module/power-menu] -type = custom/menu +type = custom/text -expand-right = false - -label-open =  -label-close =  - -label-separator = " " - -menu-0-0 = Log Out -menu-0-0-exec = i3-msg exit -menu-0-0-foreground = ${colors.primary} -menu-0-1 = Reboot -menu-0-1-exec = systemctl reboot -menu-0-2 = Power Off -menu-0-2-exec = systemctl poweroff -menu-0-2-foreground = ${colors.primary} +content = %{A:~/dotfiles/polybar/logout-window.sh:}%{A} [settings] screenchange-reload = true diff --git a/polybar/logout-window.sh b/polybar/logout-window.sh new file mode 100755 index 0000000..0d4da39 --- /dev/null +++ b/polybar/logout-window.sh @@ -0,0 +1,22 @@ +#! /bin/bash + +action=$(yad --width 300 --entry --title "System Logout" \ + --button="Ok" --button="Cancel" \ + --text "What to do?" \ + --entry-text \ + "Power Off" "Reboot" "Logout" \ +) + +return=$? + +if [[ $return -eq 1 ]] ; then + exit 0 +fi + +case $action in + Power*) cmd="systemctl poweroff" ;; + Reboot*) cmd="systemctl reboot" ;; + Logout*) cmd="i3-msg exit" +esac + +eval exec $cmd