Finish polybar

This commit is contained in:
Thomas Avé 2023-05-21 18:57:39 +02:00
parent dd204af083
commit d09d43071f
3 changed files with 92 additions and 24 deletions

View File

@ -0,0 +1,6 @@
governor=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
if [[ $governor == "powersave" ]]; then
sudo /opt/power/performance.sh
else
sudo /opt/power/powersave.sh
fi

View File

@ -6,10 +6,14 @@ exec --no-startup-id "feh --no-fehbg --bg-fill /home/user/.config/awesome/wallpa
exec --no-startup-id "picom -b" exec --no-startup-id "picom -b"
exec --no-startup-id "polybar &" exec --no-startup-id "polybar &"
bindsym --whole-window --border button7 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +2%
bindsym --whole-window --border button6 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -2%
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl s 10%+
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl s 10%-
# Use Mouse+$mod to drag floating windows to their wanted position # Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod floating_modifier $mod
@ -19,10 +23,12 @@ floating_modifier $mod
tiling_drag modifier titlebar tiling_drag modifier titlebar
# start a terminal # start a terminal
bindsym $mod+Return exec alacritty bindsym $mod+Return exec /home/user/.config/awesome/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2)
bindsym $mod+minus split v; exec /home/user/.config/awesome/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2)
bindsym $mod+bar split h; exec /home/user/.config/awesome/scripts/launch_alacritty.sh $(xprop -id $(xdotool getwindowfocus) | ag ^_NET_WM_PID | cut -d '=' -f 2)
bindsym $mod+minus split v; exec alacritty
bindsym $mod+bar split h; exec alacritty
# kill focused window # kill focused window
bindsym $mod+q kill bindsym $mod+q kill

View File

@ -19,40 +19,57 @@ height = 26
dpi-x = 96 dpi-x = 96
dpi-y = 96 dpi-y = 96
tray-position = right
tray-background = ${colors.blue}
tray-offset-x = -7
tray-padding = 5
; Set bar's default background/foreground color ; Set bar's default background/foreground color
background = #12151cbb background = #12151cbb
foreground = ${colors.white} foreground = ${colors.white}
; Set bar's fonts list ; Set bar's fonts list
font-0 = "Noto Sans:size=11:antialias=true;3" font-0 = "Noto Sans:size=10.5:antialias=true;3"
font-1 = "Source Code Pro:pixelsize=20:antialias=true;6" font-1 = "Source Code Pro:pixelsize=20:antialias=true;6"
font-2 = "Source Code Pro:size=12:weight=bold:antialias=true;3" font-2 = "Source Code Pro:size=11:weight=bold:antialias=true;3"
font-3 = "Font Awesome 6 Free Solid:size=11:antialias=true;3"
font-4 = "Font Awesome 6 Free:size=11:antialias=true;3"
font-5 = "Font Awesome 6 Brands:size=11:antialias=true;3"
font-6 = "Font Awesome v4 Compatibility:size=11:antialias=true;3"
; Set modules list ; Set modules list
modules-left = xwindow modules-left = xwindow
modules-center = i3 modules-center = i3
modules-right = pulseaudio temperature memory cpu date modules-right = date governor temperature memory clockspeed cpu pulseaudio battery startarrow
fixed-center = true fixed-center = true
;======================================= ;=======================================
; Modules ; Modules
;======================================= ;=======================================
[module/startarrow]
inherit = powerline-modules/right-to-left-starting-arrow
background = ${colors.blue}
background-next = ${colors.background}
[module/pulseaudio] [module/pulseaudio]
type = internal/pulseaudio type = internal/pulseaudio
inherit = powerline-templates/right-to-left-item inherit = powerline-templates/right-to-left-item
background = ${colors.blue} background = ${colors.blue}
background-next = ${root.background} background-next = ${colors.background}
label-muted-foreground = ${colors.gray} label-muted-foreground = ${colors.gray}
format-foreground = ${colors.white} format-foreground = ${colors.white}
format-volume-background = ${colors.blue} format-volume-background = ${colors.blue}
format-muted-background = ${colors.blue} format-muted-background = ${colors.blue}
format-volume = " <ramp-volume> <label-volume> "
label-muted = 🔇 muted
ramp-volume-0 = 🔈
ramp-volume-1 = 🔊
[module/date] [module/date]
; Powerline settings ; Powerline settings
inherit = powerline-templates/right-to-left-item inherit = powerline-templates/right-to-left-item
background = ${colors.blue} background = ${colors.blue}
background-next = ${colors.background} background-next = ${root.background}
; Other settings ; Other settings
type = internal/date type = internal/date
format-background = ${self.background} format-background = ${self.background}
@ -68,30 +85,58 @@ background-next = ${colors.blue}
type = internal/cpu type = internal/cpu
format-background = ${self.background} format-background = ${self.background}
format-foreground = ${colors.white} format-foreground = ${colors.white}
label = " CPU: %percentage%% " label = " CPU %percentage%% "
[module/memory] [module/memory]
; Powerline settings ; Powerline settings
inherit = powerline-templates/right-to-left-item inherit = powerline-templates/right-to-left-item
background = ${colors.blue} background = ${colors.background}
background-next = ${colors.background} background-next = ${colors.blue}
; Other settings ; Other settings
type = internal/memory type = internal/memory
format-background = ${self.background} format-background = ${self.background}
format-foreground = ${colors.white} format-foreground = ${colors.white}
label = " %gb_used% " label = " %gb_used% "
[module/clockspeed]
; Powerline settings
inherit = powerline-templates/right-to-left-item
background = ${colors.blue}
background-next = ${colors.background}
; Other settings
type = custom/script
format-background = ${self.background}
format-foreground = ${colors.white}
format-warn-background = ${self.background}
exec = cat /proc/cpuinfo | grep MHz | cut -b 12- | sort -r | head -n 1 | xargs printf '%f / 1000\\n' | bc -l | awk '{printf "%.2f\\n", $0}'
format = " <label> GHz "
[module/temperature] [module/temperature]
; Powerline settings ; Powerline settings
inherit = powerline-templates/right-to-left-item inherit = powerline-templates/right-to-left-item
background = ${colors.blue}
background-next = ${colors.background}
; Other settings
type = custom/script
format-background = ${colors.blue}
format-foreground = ${colors.white}
format-warn-background = ${self.background}
exec = sensors | grep Package | cut -d ' ' -f 5 | cut -d '+' -f 2
format = " <label> "
[module/governor]
; Powerline settings
inherit = powerline-templates/right-to-left-item
background = ${colors.background} background = ${colors.background}
background-next = ${colors.blue} background-next = ${colors.blue}
; Other settings ; Other settings
type = internal/temperature type = custom/script
format-background = ${self.background} format-background = ${self.background}
format-foreground = ${colors.white} format-foreground = ${colors.white}
thermal-zone = 6 format-warn-background = ${self.background}
label = " %temperature-c% " exec = cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
format = " <label> "
click-left = /home/user/.config/awesome/scripts/toggle_performance.sh
[module/xwindow] [module/xwindow]
; Other settings ; Other settings
@ -102,6 +147,7 @@ background-next = ${root.background}
format-background = ${self.background} format-background = ${self.background}
format-foreground = ${colors.white} format-foreground = ${colors.white}
label = " %title% " label = " %title% "
label-maxlen = 100
[module/i3] [module/i3]
@ -118,3 +164,13 @@ label-unfocused-font=3
label-separator-padding = 2 label-separator-padding = 2
label-focused = %index% label-focused = %index%
label-unfocused = %index% label-unfocused = %index%
[module/battery]
type = custom/script
inherit = powerline-templates/right-to-left-item
background = ${colors.background}
background-next = ${colors.blue}
format-background = ${self.background}
format-foreground = ${colors.white}
exec = upower -i /org/freedesktop/UPower/devices/battery_BAT1 | ag percentage | awk '{print $2}'
format = " <label>  "