diff options
Diffstat (limited to 'polybar')
| -rw-r--r-- | polybar/.config/polybar/config.ini | 209 | ||||
| -rw-r--r-- | polybar/.config/polybar/modules.ini | 186 | ||||
| -rwxr-xr-x | polybar/.config/polybar/scripts/battery-time.sh | 11 | ||||
| -rwxr-xr-x | polybar/.config/polybar/scripts/battery-wattage.sh | 19 |
4 files changed, 231 insertions, 194 deletions
diff --git a/polybar/.config/polybar/config.ini b/polybar/.config/polybar/config.ini index 09656ec..686c5a9 100644 --- a/polybar/.config/polybar/config.ini +++ b/polybar/.config/polybar/config.ini @@ -8,30 +8,26 @@ ; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ ; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ; -; by husseinhareb :) -; ;========================================================== -include-file = $HOME/.config/polybar/colors.ini +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +;; File Inclusion +; include an external file, like module file, etc. +include-file = ~/.config/polybar/colors.ini +include-file = ~/.config/polybar/modules.ini -;[colors] -;background = #1E1E2E -;background-alt = #1E1E2E -;foreground = #C5C8C6 -;primary = #F0C674 -;secondary = #8ABEB7 -;alert = #A54242 -;disabled = #707880 -;white = #EAEAEA -;grey = #61616C -;green = #25D865 -;blue = #168ECA -;mauve = #490761 +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ [settings] -screenchange-reload = true -pseudo-transparency = true +throttle-output = 5 +throttle-output-for = 10 + +screenchange-reload = false +pseudo-transparency = false + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ [bar/main] #dpi = ${xrdb:Xft.dpi:96} @@ -59,7 +55,7 @@ module-margin = 0 ;border-bottom-size = 1 -;border-bottom-color = ${colors.background2} +;border-bottom-color = ${colors.magenta} ;padding-left = 1 ;padding-right = 1 @@ -68,178 +64,3 @@ module-margin = 0 modules-left = void space space date space space xwindow modules-center = xworkspaces modules-right = cpu space space memory space separator space mic space pulseaudio space separator space wlan space separator space battery space - -;modules-right = pulseaudio cpu memory wlan battery date - -[module/xworkspaces] -type = internal/xworkspaces - -label-active = -label-active-padding = 1 -label-active-foreground = ${colors.disabled} -label-active-font = 1 - -label-occupied = -label-occupied-padding = 1 -label-occupied-font = 1 - -label-empty = -label-empty-background = ${colors.background} -label-empty-padding = 1 -label-empty-font = 1 - -[module/xwindow] -type = internal/xwindow -label = %title:0:60:...% -label-foreground = ${colors.white} - -[network-base] -type = internal/network -interval = 5 -format-connected = <label-connected> -format-disconnected = <label-disconnected> -label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected - -[module/cpu] -type = internal/cpu -interval = 2 -format-prefix = "CPU " -format-prefix-foreground = ${colors.primary} -label = %percentage:2%% - -[module/wlan] -inherit = network-base -interface-type = wireless -label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip% - -[module/memory] -type = internal/memory -interval = 2 -;format-prefix = " " -format-prefix-foreground = ${colors.magenta} -label = %gb_used% %percentage_used%% -label-foreground = ${colors.foreground} - -[module/gpu-status] -type = custom/script - -; Path to the helper script we just created -exec = ~/.config/polybar/scripts/dgpu-status.sh - -; Update interval in seconds -interval = 5 - -; Professional styling -format-prefix = "dGPU Status: " -format-padding = 1 -format-background = ${colors.background-alt} -format-foreground = ${colors.primary} - -; Optional: Left-click to open a terminal and toggle -; click-left = st -e sudo gpu-switch on -; click-right = st -e sudo gpu-switch off - -;[module/wlan] -;inherit = network-base -;interface-type = wireless - -;interval = 1 -;format-connected-prefix-foreground = ${colors.white} -;format-connected-foreground = ${colors.white} -;format-connected = <label-connected> -;label-connected = -;label-connected-padding = 0 - -;format-disconnected = <label-disconnected> -;format-disconnected-padding = 0 -;label-disconnected = -;label-disconnected-foreground = ${colors.white} -;label-disconnected-padding = 0 - -[module/mic] -type = custom/script -exec = ~/.config/polybar/scripts/mic-status.sh -tail = true -; Click to toggle mute -click-left = pactl set-source-mute @DEFAULT_SOURCE@ toggle -; Scroll up to increase volume -scroll-up = pactl set-source-volume @DEFAULT_SOURCE@ +5% -; Scroll down to decrease volume -scroll-down = pactl set-source-volume @DEFAULT_SOURCE@ -5% - -[module/pulseaudio] -type = internal/pulseaudio - -format-volume-prefix = " " -format-volume-foreground = ${colors.foreground} -format-volume-prefix-foreground = ${colors.foreground} -format-volume = <label-volume> -label-volume = %percentage%% - -label-muted = %percentage%% -label-muted-foreground = ${colors.disabled} - -[module/battery] -type = internal/battery -full-at = 99 -low-at = 20 -battery = BAT0 -adapter = ADP1 -poll-interval = 5 -format-charging-foreground = ${colors.foreground} -format-discharging-foreground = ${colors.foreground} -format-charging = <animation-charging><label-charging> -format-discharging = <ramp-capacity><label-discharging> -label-charging = %percentage%% -label-discharging =%percentage%% -label-full = Full -label-low = LOW - -ramp-capacity-0 = " " -ramp-capacity-1 = " " -ramp-capacity-2 = " " -ramp-capacity-3 = " " -ramp-capacity-4 = " " - -bar-capacity-width = 10 - -animation-charging-0 = " " -animation-charging-1 = " " -animation-charging-2 = " " -animation-charging-3 = " " -animation-charging-4 = " " -animation-charging-framerate = 750 - -animation-discharging-0 = " " -animation-discharging-1 = " " -animation-discharging-2 = " " -animation-discharging-3 = " " -animation-discharging-4 = " " - -animation-discharging-framerate = 500 - -animation-low-0 = ! -animation-low-1 = -animation-low-framerate = 200 - -[module/date] -type = internal/date -interval = 1 -date = %I:%M %p|%d-%m -label = %date% -label-foreground = ${colors.primary} - -[module/void] -type = custom/text -content = -content-foreground = ${colors.green} -content-margin = 0 - -[module/space] -type = custom/text -content = " " - -[module/separator] -type = custom/text -content = "|" -content-foreground = ${colors.disabled} diff --git a/polybar/.config/polybar/modules.ini b/polybar/.config/polybar/modules.ini new file mode 100644 index 0000000..d82a909 --- /dev/null +++ b/polybar/.config/polybar/modules.ini @@ -0,0 +1,186 @@ +[module/xworkspaces] +type = internal/xworkspaces + +label-active = +label-active-padding = 1 +label-active-foreground = ${colors.disabled} +label-active-font = 1 + +label-occupied = +label-occupied-padding = 1 +label-occupied-font = 1 + +label-empty = +label-empty-background = ${colors.background} +label-empty-padding = 1 +label-empty-font = 1 + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/xwindow] +type = internal/xwindow +label = %title:0:60:...% +label-foreground = ${colors.white} + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/cpu] +type = internal/cpu +interval = 2 +format = <label> +format-prefix = "" +format-prefix-foreground = ${colors.primary} +label = " %percentage:2%%" + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/memory] +type = internal/memory +interval = 2 +format-prefix = "" +format-prefix-foreground = ${colors.primary} +label = " %gb_used% (%percentage_used%%)" +label-foreground = ${colors.foreground} + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[network-base] +type = internal/network +interval = 5 +format-connected = <label-connected> +format-disconnected = <label-disconnected> +label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected + +[module/wlan] +inherit = network-base +interface-type = wireless +label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip% + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/mic] +type = custom/script +exec = ~/.config/polybar/scripts/mic-status.sh +tail = true + +click-left = pactl set-source-mute @DEFAULT_SOURCE@ toggle +scroll-up = pactl set-source-volume @DEFAULT_SOURCE@ +5% +scroll-down = pactl set-source-volume @DEFAULT_SOURCE@ -5% + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/pulseaudio] +type = internal/pulseaudio + +format-volume-prefix = " " +format-volume-foreground = ${colors.foreground} +format-volume-prefix-foreground = ${colors.foreground} +format-volume = <label-volume> +label-volume = %percentage%% + +label-muted = %percentage%% +label-muted-foreground = ${colors.disabled} + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/gpu-status] +type = custom/script +exec = ~/.config/polybar/scripts/dgpu-status.sh +interval = 5 + +format-prefix = "dGPU Status: " +format-padding = 1 +format-background = ${colors.background-alt} +format-foreground = ${colors.primary} + +; Optional: Left-click to open a terminal and toggle +; click-left = st -e sudo gpu-switch on +; click-right = st -e sudo gpu-switch off + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/battery] +type = internal/battery +full-at = 99 +low-at = 20 +battery = BAT0 +adapter = ADP1 +poll-interval = 5 +format-charging-foreground = ${colors.foreground} +format-discharging-foreground = ${colors.foreground} +format-charging = <animation-charging><label-charging> +format-discharging = <ramp-capacity><label-discharging> +label-charging = %percentage%% +label-discharging =%percentage%% +label-full = Full +label-low = LOW + +ramp-capacity-0 = " " +ramp-capacity-1 = " " +ramp-capacity-2 = " " +ramp-capacity-3 = " " +ramp-capacity-4 = " " + +bar-capacity-width = 10 + +animation-charging-0 = " " +animation-charging-1 = " " +animation-charging-2 = " " +animation-charging-3 = " " +animation-charging-4 = " " +animation-charging-framerate = 750 + +animation-discharging-0 = " " +animation-discharging-1 = " " +animation-discharging-2 = " " +animation-discharging-3 = " " +animation-discharging-4 = " " + +animation-discharging-framerate = 500 + +animation-low-0 = ! +animation-low-1 = +animation-low-framerate = 200 + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/battery-wattage] +type = custom/script +exec = ~/.config/polybar/scripts/battery-wattage.sh +interval = 5 +label = ⚡ %output% +format-foreground = ${colors.primary} + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/battery-time] +type = custom/script +exec = ~/.config/polybar/scripts/battery-time.sh +interval = 30 +label = ⏳ %output% + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/date] +type = internal/date +interval = 1 +date = %I:%M %p|%d-%m +label = %date% +label-foreground = ${colors.primary} + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/void] +type = custom/text +label = +label-foreground = ${colors.green} +label-margin = 0 + +[module/space] +type = custom/text +label = " " + +[module/separator] +type = custom/text +label = "|" +label-foreground = ${colors.disabled} diff --git a/polybar/.config/polybar/scripts/battery-time.sh b/polybar/.config/polybar/scripts/battery-time.sh new file mode 100755 index 0000000..b0fae0c --- /dev/null +++ b/polybar/.config/polybar/scripts/battery-time.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# Get the time to empty for the first battery found +TIME=$(upower -i $(upower -e | grep 'BAT') | grep "time to empty" | awk '{print $4 " " $5}') + +if [ -z "$TIME" ]; then + # If plugged in or fully charged, upower might return nothing for 'time to empty' + echo "Charging" +else + echo "$TIME" +fi
\ No newline at end of file diff --git a/polybar/.config/polybar/scripts/battery-wattage.sh b/polybar/.config/polybar/scripts/battery-wattage.sh new file mode 100755 index 0000000..11c54bf --- /dev/null +++ b/polybar/.config/polybar/scripts/battery-wattage.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Path may vary depending on your battery name (usually BAT0 or BAT1) +PATH_BAT="/sys/class/power_supply/BAT0" + +if [ -d "$PATH_BAT" ]; then + # Current in microamperes + I=$(cat "$PATH_BAT/current_now") + # Voltage in microvolts + V=$(cat "$PATH_BAT/voltage_now") + + # Calculate Microwatts, then convert to Watts + # Using bc for floating point math + WATT=$(echo "scale=2; ($I * $V) / 10^12" | bc) + + echo "${WATT}W" +else + echo "N/A" +fi
\ No newline at end of file |
