Replace Polybar Modules w/ System Tray Applications

- Replace battery module with xfce-power-manager tray app
- Replace pulseaudio module with volctl tray app
- Remove extra powermenu, battery, and pulseaudio colors & intervals
- Change dunst module color to red
- Re-order modules in README
- Change user/kernel module to initialize with kernel
This commit is contained in:
Sravan Balaji
2021-05-23 15:50:19 -04:00
parent cbed4fea8f
commit f1a1d837c3
2 changed files with 586 additions and 1020 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -21,14 +21,6 @@ alert = ${self.red}
; left
powermenu = ${self.blue}
powermenu-close = ${self.blue}
powermenu-logout = ${self.orange}
powermenu-lock = ${self.purple}
powermenu-sleep = ${self.yellow}
powermenu-reboot = ${self.green}
powermenu-power-off = ${self.red}
powermenu-hibernate = ${self.pink}
powermenu-cancel = ${self.white}
xmonad-focused-foreground = ${self.background}
xmonad-focused-background = ${self.primary}
@@ -51,15 +43,7 @@ updates = ${self.green}
cpu = ${self.yellow}
memory = ${self.pink}
filesystem = ${self.blue}
; right (laptop only)
backlight = ${self.yellow}
battery = ${self.green}
; right (continued)
pulseaudio-volume = ${self.red}
pulseaudio-muted = ${self.lighter-gray}
dunst-notification-status = ${self.purple}
dunst-notification-status = ${self.red}
[sizes]
bar-height = ${xrdb:polybar.bar-height:25}
@@ -70,13 +54,11 @@ tray-scale = ${xrdb:polybar.tray-scale:1}
maxlen = ${xrdb:polybar.maxlen:50}
[intervals]
battery = 30
cpu = 1
date = 1
time = 1
filesystem = 900
memory = 1
pulseaudio = 5
updates = 900
media-playing = 1
dunst-notification-status = 1
@@ -211,7 +193,7 @@ font-3 = "IPAPGothic:size=11;3"
; modules-right = ipc clock
modules-left = powermenu ewmh media-playing
modules-center = date time
modules-right = user-kernel updates cpu memory filesystem backlight battery pulseaudio dunst-notification-status
modules-right = user-kernel updates cpu memory filesystem dunst-notification-status
; The separator will be inserted between the output of each module
separator = " "
@@ -312,6 +294,26 @@ enable-ipc = true
cursor-click = pointer
cursor-scroll = ns-resize
[module/powermenu]
type = custom/text
content = " "
; "content" has the same properties as "format-NAME"
; content-background = #000
content-foreground = ${colors.powermenu}
content-padding = ${bar/mybar.module-margin}
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
; click-left = notify-send left
; click-middle = notify-send middle
; click-right = notify-send right
click-left = "rofi -show combi"
click-right = "/home/sravan/.scripts/control-center.sh --rofi"
; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND"
; scroll-up = notify-send scroll up
; scroll-down = notify-send scroll down
[module/ewmh]
type = internal/xworkspaces
@@ -407,183 +409,61 @@ label-empty-background = ${colors.xmonad-empty-background}
label-empty-underline = ${colors.xmonad-empty-background}
label-empty-padding = ${sizes.module-padding}
[module/backlight]
type = internal/backlight
[module/media-playing]
type = custom/script
; Use the following command to list available cards:
; $ ls -1 /sys/class/backlight/
card = intel_backlight
; Available tokens:
; %counter%
; Command to be executed (using "/bin/sh -c [command]")
exec = ~/.xmonad/polybar/scripts/get-media-playing.sh
; Enable changing the backlight with the scroll wheel (unreleased)
; NOTE: This may require additional configuration on some systems. Polybar will
; write to `/sys/class/backlight/${self.card}/brightness` which requires polybar
; to have write access to that file.
; DO NOT RUN POLYBAR AS ROOT.
; The recommended way is to add the user to the
; `video` group and give that group write-privileges for the `brightness` file.
; See the ArchWiki for more information:
; https://wiki.archlinux.org/index.php/Backlight#ACPI
; Conditional command that, if defined, needs to exit successfully
; before the main exec command is invoked.
; Default: ""
; exec-if = pgrep -x myservice
; Will the script output continous content?
; Default: false
enable-scroll = true
; Available tags:
; <label> (default)
; <ramp>
; <bar>
format = %{A3:xfce4-power-manager-settings &:} <ramp> <label> %{A}
; Available tokens:
; %percentage% (default)
label = %percentage%%
label-foreground = ${colors.backlight}
; Only applies if <ramp> is used
ramp-0 = 🌕
ramp-1 = 🌔
ramp-2 = 🌓
ramp-3 = 🌒
ramp-4 = 🌑
ramp-foreground = ${colors.backlight}
; Only applies if <bar> is used
bar-width = 10
bar-indicator = |
bar-fill =
bar-empty =
[module/battery]
type = internal/battery
; This is useful in case the battery never reports 100% charge
full-at = 100
; Use the following command to list batteries and adapters:
; $ ls -1 /sys/class/power_supply/
battery = BAT0
adapter = AC
; If an inotify event haven't been reported in this many
; seconds, manually poll for new values.
;
; Needed as a fallback for systems that don't report events
; on sysfs/procfs.
;
; Disable polling by setting the interval to 0.
;
; Default: 5
poll-interval = ${intervals.battery}
; see "man date" for details on how to format the time string
; NOTE: if you want to use syntax tags here you need to use %%{...}
; Default: %H:%M:%S
time-format = %H:%M
; Available tags:
; <label-charging> (default)
; <bar-capacity>
; <ramp-capacity>
; <animation-charging>
format-charging = %{A3:xfce4-power-manager-settings &:} <animation-charging> <label-charging> %{A}
; Available tags:
; <label-discharging> (default)
; <bar-capacity>
; <ramp-capacity>
; <animation-discharging>
format-discharging = %{A3:xfce4-power-manager-settings &:} <ramp-capacity> <label-discharging> %{A}
; Available tags:
; <label-full> (default)
; <bar-capacity>
; <ramp-capacity>
format-full = %{A3:xfce4-power-manager-settings &:} <ramp-capacity> <label-full> %{A}
; Available tokens:
; %percentage% (default) - is set to 100 if full-at is reached
; %percentage_raw%
; %time%
; %consumption% (shows current charge rate in watts)
label-charging = %percentage%% (%time%)
label-charging-foreground = ${colors.battery}
; Available tokens:
; %percentage% (default) - is set to 100 if full-at is reached
; %percentage_raw%
; %time%
; %consumption% (shows current discharge rate in watts)
label-discharging = %percentage%% (%time%)
label-discharging-foreground = ${colors.battery}
; Available tokens:
; %percentage% (default) - is set to 100 if full-at is reached
; %percentage_raw%
label-full = %percentage%
label-full-foreground = ${colors.battery}
; Only applies if <ramp-capacity> is used
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-3 =
ramp-capacity-4 =
ramp-capacity-foreground = ${colors.battery}
; Only applies if <bar-capacity> is used
bar-capacity-width = 10
; Only applies if <animation-charging> is used
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-3 =
animation-charging-4 =
animation-charging-foreground = ${colors.battery}
; Framerate in milliseconds
animation-charging-framerate = 750
; Only applies if <animation-discharging> is used
animation-discharging-0 =
animation-discharging-1 =
animation-discharging-2 =
animation-discharging-3 =
animation-discharging-4 =
animation-discharging-foreground = ${colors.battery}
; Framerate in milliseconds
animation-discharging-framerate = 500
[module/cpu]
type = internal/cpu
tail = false
; Seconds to sleep between updates
; Default: 1
interval = ${intervals.cpu}
; Default: 5 (0 if `tail = true`)
interval = ${intervals.media-playing}
; Available tags:
; <output> - deprecated
; <label> (default)
; <bar-load>
; <ramp-load>
; <ramp-coreload>
format = %{A3:alacritty -e bpytop &:} <label> %{A}
format = <label>
; format-background = ${colors.background}
; format-foreground =
; format-padding = 4
; Available tokens:
; %percentage% (default) - total cpu load averaged over all cores
; %percentage-sum% - Cumulative load on all cores
; %percentage-cores% - load percentage for each core
; %percentage-core[1-9]% - load percentage for specific core
label =  %percentage%%
label-foreground = ${colors.cpu}
; %output%
; Default: %output%
label = %output%
label-foreground = ${colors.media-playing}
label-maxlen = ${sizes.maxlen}
; Spacing between individual per-core ramps
ramp-coreload-spacing = 1
ramp-coreload-0 =
ramp-coreload-1 =
ramp-coreload-2 =
ramp-coreload-3 =
ramp-coreload-4 =
ramp-coreload-5 =
ramp-coreload-6 =
ramp-coreload-7 =
ramp-coreload-foreground = ${colors.cpu}
; Available tokens:
; %counter%
; %pid%
;
; "click-(left|middle|right)" will be executed using "/bin/sh -c [command]"
click-left = "/home/sravan/.scripts/playerctl.sh --play-pause"
; click-middle = echo middle %counter%
click-right = "/home/sravan/.scripts/playerctl.sh --change"
; double-click-left = echo double left %counter%
; double-click-middle = echo double middle %counter%
; double-click-right = echo double right %counter%
; Available tokens:
; %counter%
; %pid%
;
; "scroll-(up|down)" will be executed using "/bin/sh -c [command]"
scroll-up = "/home/sravan/.scripts/playerctl.sh --next"
scroll-down = "/home/sravan/.scripts/playerctl.sh --prev"
[module/date]
type = internal/date
@@ -647,53 +527,126 @@ label = " %time%"
; label-font = 3
label-foreground = ${colors.time}
[module/filesystem]
type = internal/fs
[module/user-kernel]
type = custom/ipc
; Mountpoints to display
mount-0 = /home
; Define the command to be executed when the hook is triggered
; Available tokens:
; %pid% (id of the parent polybar process)
hook-0 = echo " $(whoami)"
hook-1 = echo " $(uname -r)"
; Hook to execute on launch. The index is 1-based and using
; the example below (2) `whoami` would be executed on launch.
; If 0 is specified, no hook is run on launch
; Default: 0
initial = 2
; Available tags:
; <output> (default)
format = <output>
format-foreground = ${colors.user-kernel}
format-background = ${colors.background}
; Mouse actions
; Available tokens:
; %pid% (id of the parent polybar process)
click-left = polybar-msg -p %pid% hook user-kernel 1 &
; click-middle =
click-right = polybar-msg -p %pid% hook user-kernel 2 &
; scroll-up =
; scroll-down =
; double-click-left =
; double-click-right =
[module/updates]
type = custom/script
; Available tokens:
; %counter%
; Command to be executed (using "/bin/sh -c [command]")
exec = ~/.xmonad/polybar/scripts/updates-pacman-aurhelper.sh
; Conditional command that, if defined, needs to exit successfully
; before the main exec command is invoked.
; Default: ""
; exec-if = pgrep -x myservice
; Will the script output continous content?
; Default: false
tail = false
; Seconds to sleep between updates
; Default: 30
interval = ${intervals.filesystem}
; Display fixed precision values
; Default: false
fixed-values = true
; Spacing between entries
; Default: 2
spacing = ${bar/mybar.module-margin}
; Default: 5 (0 if `tail = true`)
interval = ${intervals.updates}
; Available tags:
; <label-mounted> (default)
; <bar-free>
; <bar-used>
; <ramp-capacity>
format-mounted = %{A3:filelight &:} <label-mounted> %{A}
; <output> - deprecated
; <label> (default)
format = <label>
; format-background = ${colors.background}
; format-foreground =
; format-padding = 4
; Available tokens:
; %output%
; Default: %output%
label =  %output%
label-foreground = ${colors.updates}
; Available tokens:
; %counter%
; %pid%
;
; "click-(left|middle|right)" will be executed using "/bin/sh -c [command]"
; click-left = echo left %counter%
; click-middle = echo middle %counter%
click-right = alacritty --hold -e paru -Syu &
; double-click-left = echo double left %counter%
; double-click-middle = echo double middle %counter%
; double-click-right = echo double right %counter%
; Available tokens:
; %counter%
; %pid%
;
; "scroll-(up|down)" will be executed using "/bin/sh -c [command]"
; scroll-up = echo scroll up %counter%
; scroll-down = echo scroll down %counter%
[module/cpu]
type = internal/cpu
; Seconds to sleep between updates
; Default: 1
interval = ${intervals.cpu}
; Available tags:
; <label-unmounted> (default)
format-unmounted = %{A3:gnome-disks &:} <label-unmounted> %{A}
; <label> (default)
; <bar-load>
; <ramp-load>
; <ramp-coreload>
format = %{A3:alacritty -e bpytop &:} <label> %{A}
; Available tokens:
; %mountpoint%
; %type%
; %fsname%
; %percentage_free%
; %percentage_used%
; %total%
; %free%
; %used%
; Default: %mountpoint% %percentage_free%%
label-mounted =  %percentage_used%%
label-mounted-foreground = ${colors.filesystem}
; %percentage% (default) - total cpu load averaged over all cores
; %percentage-sum% - Cumulative load on all cores
; %percentage-cores% - load percentage for each core
; %percentage-core[1-9]% - load percentage for specific core
label = %percentage%%
label-foreground = ${colors.cpu}
; Available tokens:
; %mountpoint%
; Default: %mountpoint% is not mounted
label-unmounted = %mountpoint% is not mounted
label-unmounted-foreground = ${colors.filesystem}
; Spacing between individual per-core ramps
ramp-coreload-spacing = 1
ramp-coreload-0 =
ramp-coreload-1 =
ramp-coreload-2 =
ramp-coreload-3 =
ramp-coreload-4 =
ramp-coreload-5 =
ramp-coreload-6 =
ramp-coreload-7 =
ramp-coreload-foreground = ${colors.cpu}
[module/memory]
type = internal/memory
@@ -768,165 +721,53 @@ ramp-free-6 = ▇
ramp-free-7 =
ramp-free-foreground = ${colors.memory}
[module/pulseaudio]
type = internal/pulseaudio
[module/filesystem]
type = internal/fs
; Sink to be used, if it exists (find using `pacmd list-sinks`, name field)
; If not, uses default sink
; sink = alsa_output.pci-0000_12_00.3.analog-stereo
; Use PA_VOLUME_UI_MAX (~153%) if true, or PA_VOLUME_NORM (100%) if false
; Default: true
use-ui-max = true
; Interval for volume increase/decrease (in percent points)
; Default: 5
interval = ${intervals.pulseaudio}
; Available tags:
; <label-volume> (default)
; <ramp-volume>
; <bar-volume>
format-volume = <ramp-volume> <label-volume>
; Available tags:
; <label-muted> (default)
; <ramp-volume>
; <bar-volume>
;format-muted = <label-muted>
; Available tokens:
; %percentage% (default)
; %decibels% (unreleased)
label-volume = %percentage%%
label-volume-foreground = ${colors.pulseaudio-volume}
; Available tokens:
; %percentage% (default)
; %decibels% (unreleased)
label-muted = 婢 muted
label-muted-foreground = ${colors.pulseaudio-muted}
; Only applies if <ramp-volume> is used
ramp-volume-0 =
ramp-volume-1 =
ramp-volume-2 =
ramp-volume-foreground = ${colors.pulseaudio-volume}
; Right and Middle click (unreleased)
click-right = pavucontrol &
; click-middle =
[module/updates]
type = custom/script
; Available tokens:
; %counter%
; Command to be executed (using "/bin/sh -c [command]")
exec = ~/.xmonad/polybar/scripts/updates-pacman-aurhelper.sh
; Conditional command that, if defined, needs to exit successfully
; before the main exec command is invoked.
; Default: ""
; exec-if = pgrep -x myservice
; Will the script output continous content?
; Default: false
tail = false
; Mountpoints to display
mount-0 = /home
; Seconds to sleep between updates
; Default: 5 (0 if `tail = true`)
interval = ${intervals.updates}
; Default: 30
interval = ${intervals.filesystem}
; Available tags:
; <output> - deprecated
; <label> (default)
format = <label>
; format-background = ${colors.background}
; format-foreground =
; format-padding = 4
; Available tokens:
; %output%
; Default: %output%
label =  %output%
label-foreground = ${colors.updates}
; Available tokens:
; %counter%
; %pid%
;
; "click-(left|middle|right)" will be executed using "/bin/sh -c [command]"
; click-left = echo left %counter%
; click-middle = echo middle %counter%
click-right = alacritty --hold -e paru -Syu &
; double-click-left = echo double left %counter%
; double-click-middle = echo double middle %counter%
; double-click-right = echo double right %counter%
; Available tokens:
; %counter%
; %pid%
;
; "scroll-(up|down)" will be executed using "/bin/sh -c [command]"
; scroll-up = echo scroll up %counter%
; scroll-down = echo scroll down %counter%
[module/media-playing]
type = custom/script
; Available tokens:
; %counter%
; Command to be executed (using "/bin/sh -c [command]")
exec = ~/.xmonad/polybar/scripts/get-media-playing.sh
; Conditional command that, if defined, needs to exit successfully
; before the main exec command is invoked.
; Default: ""
; exec-if = pgrep -x myservice
; Will the script output continous content?
; Display fixed precision values
; Default: false
tail = false
fixed-values = true
; Seconds to sleep between updates
; Default: 5 (0 if `tail = true`)
interval = ${intervals.media-playing}
; Spacing between entries
; Default: 2
spacing = ${bar/mybar.module-margin}
; Available tags:
; <output> - deprecated
; <label> (default)
format = <label>
; format-background = ${colors.background}
; format-foreground =
; format-padding = 4
; <label-mounted> (default)
; <bar-free>
; <bar-used>
; <ramp-capacity>
format-mounted = %{A3:filelight &:} <label-mounted> %{A}
; Available tags:
; <label-unmounted> (default)
format-unmounted = %{A3:gnome-disks &:} <label-unmounted> %{A}
; Available tokens:
; %output%
; Default: %output%
label = %output%
label-foreground = ${colors.media-playing}
label-maxlen = ${sizes.maxlen}
; %mountpoint%
; %type%
; %fsname%
; %percentage_free%
; %percentage_used%
; %total%
; %free%
; %used%
; Default: %mountpoint% %percentage_free%%
label-mounted =  %percentage_used%%
label-mounted-foreground = ${colors.filesystem}
; Available tokens:
; %counter%
; %pid%
;
; "click-(left|middle|right)" will be executed using "/bin/sh -c [command]"
click-left = "/home/sravan/.scripts/playerctl.sh --play-pause"
; click-middle = echo middle %counter%
click-right = "/home/sravan/.scripts/playerctl.sh --change"
; double-click-left = echo double left %counter%
; double-click-middle = echo double middle %counter%
; double-click-right = echo double right %counter%
; Available tokens:
; %counter%
; %pid%
;
; "scroll-(up|down)" will be executed using "/bin/sh -c [command]"
scroll-up = "/home/sravan/.scripts/playerctl.sh --next"
scroll-down = "/home/sravan/.scripts/playerctl.sh --prev"
; %mountpoint%
; Default: %mountpoint% is not mounted
label-unmounted = %mountpoint% is not mounted
label-unmounted-foreground = ${colors.filesystem}
[module/dunst-notification-status]
type = custom/script
@@ -983,55 +824,3 @@ click-right = "/home/sravan/.scripts/dunst.sh --history"
; "scroll-(up|down)" will be executed using "/bin/sh -c [command]"
; scroll-up =
; scroll-down =
[module/powermenu]
type = custom/text
content = " "
; "content" has the same properties as "format-NAME"
; content-background = #000
content-foreground = ${colors.powermenu}
content-padding = ${bar/mybar.module-margin}
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
; click-left = notify-send left
; click-middle = notify-send middle
; click-right = notify-send right
click-left = "rofi -show combi"
click-right = "/home/sravan/.scripts/control-center.sh --rofi"
; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND"
; scroll-up = notify-send scroll up
; scroll-down = notify-send scroll down
[module/user-kernel]
type = custom/ipc
; Define the command to be executed when the hook is triggered
; Available tokens:
; %pid% (id of the parent polybar process)
hook-0 = echo " $(whoami)"
hook-1 = echo " $(uname -r)"
; Hook to execute on launch. The index is 1-based and using
; the example below (2) `whoami` would be executed on launch.
; If 0 is specified, no hook is run on launch
; Default: 0
initial = 1
; Available tags:
; <output> (default)
format = <output>
format-foreground = ${colors.user-kernel}
format-background = ${colors.background}
; Mouse actions
; Available tokens:
; %pid% (id of the parent polybar process)
click-left = polybar-msg -p %pid% hook user-kernel 1 &
; click-middle =
click-right = polybar-msg -p %pid% hook user-kernel 2 &
; scroll-up =
; scroll-down =
; double-click-left =
; double-click-right =