From 3488e1e36e98565f2fbb1785b9cde8b4c2525f3f Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 4 Apr 2023 14:20:57 +0100 Subject: [PATCH] Add polybar config and modules --- polybar/colors.ini | 29 ++ polybar/config | 373 +++++++++++++++++++++++++ polybar/macchiato.ini | 39 +++ polybar/modules/heatSensors | 56 ++++ polybar/modules/mediaModules | 155 ++++++++++ polybar/modules/modules | 313 +++++++++++++++++++++ polybar/modules/monitoringModules | 124 ++++++++ polybar/modules/separatorsModules | 64 +++++ polybar/scripts/cava | 40 +++ polybar/scripts/pipewire-microphone.sh | 52 ++++ polybar/system | 5 + 11 files changed, 1250 insertions(+) create mode 100644 polybar/colors.ini create mode 100755 polybar/config create mode 100644 polybar/macchiato.ini create mode 100755 polybar/modules/heatSensors create mode 100755 polybar/modules/mediaModules create mode 100755 polybar/modules/modules create mode 100755 polybar/modules/monitoringModules create mode 100755 polybar/modules/separatorsModules create mode 100755 polybar/scripts/cava create mode 100755 polybar/scripts/pipewire-microphone.sh create mode 100755 polybar/system diff --git a/polybar/colors.ini b/polybar/colors.ini new file mode 100644 index 00000000..66206a01 --- /dev/null +++ b/polybar/colors.ini @@ -0,0 +1,29 @@ +[color] + +;; Dark Add FC at the beginning #FC1E1F29 for 99 transparency +bg = #2f354b +bg-alt = #BF1D1F28 +fg = #FDFDFD + +trans = #00000000 +white = #FFFFFF +black = #000000 + +;; Colors + +red = #F37F97 +pink = #EC407A +purple = #C574DD +blue = #8897F4 +cyan = #79E6F3 +teal = #00B19F +green = #5ADECD +lime = #B9C244 +yellow = #F2A272 +amber = #FBC02D +orange = #E57C46 +brown = #AC8476 +grey = #8C8C8C +indigo = #6C77BB +blue-gray = #6D8895 + diff --git a/polybar/config b/polybar/config new file mode 100755 index 00000000..78213c5c --- /dev/null +++ b/polybar/config @@ -0,0 +1,373 @@ +[global/wm] + +margin-bottom = 0 +margin-top = 0 + +include-file = ~/.dotfiles/polybar/system +include-file = ~/.dotfiles/polybar/macchiato.ini + +# contains brightness, workspaces, Date, etc.... # +include-file = ~/.dotfiles/polybar/modules/modules + +# contains Music, microphone, etc.... # +include-file = ~/.dotfiles/polybar/modules/mediaModules + +# contains CPU, Temperature, etc.... # +include-file = ~/.dotfiles/polybar/modules/monitoringModules + +# contains the separators (e.g  , | , <| ,  ,etc..) # +include-file = ~/.dotfiles/polybar/modules/separatorsModules + +## ---------------------------------- [bar/pam1] ---------------------------------- ## + +[bar/pam1] + +monitor = +monitor-fallback = +monitor-strict = false + +override-redirect = false + +bottom = false +fixed-center = true + +width = 2.5% +height = 40 + +offset-x = 2% +offset-y = 10 + +background = ${color.bg-alt} +foreground = ${color.fg} + +radius = 6 + +line-size = 2 +line-color = ${color.blue} + +border-size = 2 +border-color = ${color.bg} + +padding = 0 + +module-margin-left = 0 +module-margin-right = 0 + +font-0 = "Iosevka Nerd Font:size=10;3" +font-1 = "Iosevka Nerd Font:size=12;3" +font-2 = "google\-mdi:size=12;3" +font-3 = "Iosevka:style=bold:size=12;3" +font-4 = "Iosevka Nerd Font:size=18;4" +font-5 = "Iosevka:style=bold:size=18;4" + +modules-left = +modules-center = xdomenu +modules-right = + +separator = +dim-value = 1.0 + +wm-restack = bspwm +enable-ipc = true + +cursor-click = pointer +cursor-scroll = ns-resize + +## ---------------------------------- [bar/pam2] ---------------------------------- ## + +[bar/pam2] + +monitor = +monitor-fallback = +monitor-strict = false + +override-redirect = false + +bottom = false +fixed-center = false + +width = 17% +height = 40 + +offset-x = 5% +offset-y = 10 + +background = ${color.bg-alt} +foreground = ${color.fg} + +radius = 6 + +line-size = 2 +line-color = ${color.blue} + +border-size = 2 +border-color = ${color.bg} + +padding = 1 + +module-margin-left = 0 +module-margin-right = 0 + +font-0 = "Iosevka Nerd Font:size=10;3" +font-1 = "Iosevka Nerd Font:size=12;3" +font-2 = "google\-mdi:size=12;3" +font-3 = "Iosevka:style=bold:size=12;3" +font-4 = "Iosevka Nerd Font:size=18;4" +font-5 = "Iosevka:style=bold:size=18;4" + +modules-left = title space bspwm +modules-center = +modules-right = + +separator = +dim-value = 1.0 + +wm-restack = bspwm +enable-ipc = true + +cursor-click = pointer +cursor-scroll = ns-resize + +## ---------------------------------- [bar/pam3] ---------------------------------- ## + +[bar/pam3] + +monitor = +monitor-fallback = +monitor-strict = false + +override-redirect = false + +bottom = false +fixed-center = true + +width = 21.5% +height = 40 + +offset-x = 43.5% +offset-y = 10 + +background = ${color.bg-alt} +foreground = ${color.fg} + +radius = 6 + +line-size = 2 +line-color = ${color.blue} + +border-size = 2 +border-color = ${color.bg} + +padding = 1 + +module-margin-left = 0 +module-margin-right = 0 + +font-0 = "Iosevka Nerd Font:size=10;3" +font-1 = "Iosevka Nerd Font:size=12;3" +font-2 = "google\-mdi:size=12;3" +font-3 = "Iosevka:style=bold:size=12;3" +font-4 = "Iosevka Nerd Font:size=18;4" +font-5 = "Iosevka:style=bold:size=18;4" +font-6 = "Material Design Icons:style=Bold:size18;4" + + +modules-left = volume space cpu space cpuTemp space updates-pacman space notification-github space battery +modules-center = +modules-right = + +separator = +dim-value = 1.0 + +wm-restack = bspwm +enable-ipc = true + +cursor-click = pointer +cursor-scroll = ns-resize + +## ---------------------------------- [bar/pam4] ---------------------------------- ## + +[bar/pam4] + +monitor = +monitor-fallback = +monitor-strict = false + +override-redirect = false + +bottom = false +fixed-center = true + +width = 20% +height = 40 + +offset-x = 65.5% +offset-y = 10 + +background = ${color.bg-alt} +foreground = ${color.fg} + +radius = 6 + +line-size = 2 +line-color = ${color.blue} + +border-size = 2 +border-color = ${color.bg} + +padding = 1 + +module-margin-left = 0 +module-margin-right = 0 + +font-0 = "Iosevka Nerd Font:size=10;3" +font-1 = "Iosevka Nerd Font:size=12;3" +font-2 = "google\-mdi:size=12;3" +font-3 = "Iosevka:style=bold:size=12;3" +font-4 = "Iosevka Nerd Font:size=18;4" +font-5 = "Iosevka:style=bold:size=18;4" + +modules-left = themes space brightness space network space mod +modules-center = +modules-right = + +separator = +dim-value = 1.0 + +wm-restack = bspwm +enable-ipc = true + +cursor-click = pointer +cursor-scroll = ns-resize + +## ---------------------------------- [bar/pam5] ---------------------------------- ## + +[bar/pam5] + +monitor = +monitor-fallback = +monitor-strict = false + +override-redirect = false + +bottom = false +fixed-center = false + +width = 11.5% +height = 40 + +offset-x = 86% +offset-y = 10 + +background = ${color.bg-alt} +foreground = ${color.fg} + +radius = 6 + +line-size = 2 +line-color = ${color.blue} + +border-size = 2 +border-color = ${color.bg} + +padding = 1 + +module-margin-left = 0 +module-margin-right = 0 + +font-0 = "Iosevka Nerd Font:size=10;3" +font-1 = "Iosevka Nerd Font:size=12;3" +font-2 = "google\-mdi:size=12;3" +font-3 = "Iosevka:style=bold:size=12;3" +font-4 = "Iosevka Nerd Font:size=18;4" +font-5 = "Iosevka:style=bold:size=18;4" + +modules-left = sysmenu space date +modules-center = +modules-right = + +separator = +dim-value = 1.0 + +tray-position = right +tray-detached = true +tray-maxsize = 16 +tray-background = ${color.bg-alt} +tray-offset-x = 0 +tray-offset-y = 0 +tray-padding = 0 +tray-scale = 1.0 + +wm-restack = bspwm +enable-ipc = true + +cursor-click = pointer +cursor-scroll = ns-resize + +## ---------------------------------- [bar/pam6] ---------------------------------- ## + +[bar/pam6] + +monitor = +monitor-fallback = +monitor-strict = false + +override-redirect = false + +bottom = false +fixed-center = true + +width = 20.5% +height = 40 + +offset-x = 22.5% +offset-y = 10 + +background = ${color.bg-alt} +foreground = ${color.fg} + +radius = 6 + +line-size = 2 +line-color = ${color.blue} + +border-size = 2 +border-color = ${color.bg} + +padding = 2 + +module-margin-left = 0 +module-margin-right = 0 + +font-0 = "Iosevka Nerd Font:size=10;3" +font-1 = "Iosevka Nerd Font:size=12;3" +font-2 = "google\-mdi:size=12;3" +font-3 = "Iosevka:style=bold:size=12;3" +font-4 = "Iosevka Nerd Font:size=18;4" +font-5 = "Iosevka:style=bold:size=18;4" + + +modules-left = song +modules-center = info-cava +modules-right = mpd + +separator = +dim-value = 1.0 + +wm-restack = bspwm +enable-ipc = true + +cursor-click = pointer +cursor-scroll = ns-resize + +[settings] + +screenchange-reload = false + +compositing-background = source +compositing-foreground = over +compositing-overline = over +compositing-underline = over +compositing-border = over + +pseudo-transparency = false diff --git a/polybar/macchiato.ini b/polybar/macchiato.ini new file mode 100644 index 00000000..d950747e --- /dev/null +++ b/polybar/macchiato.ini @@ -0,0 +1,39 @@ +;------------------------- +; Catppuccin Macchiato Palette +; Maintainer: justTOBBI +;-------------------------- + +[colors] + base = #24273a + mantle = #1e2030 + crust = #181926 + + text = #cad3f5 + subtext0 = #a5adcb + subtext1 = #b8c0e0 + + surface0 = #363a4f + surface1 = #494d64 + surface2 = #5b6078 + + overlay0 = #6e738d + overlay1 = #8087a2 + overlay2 = #939ab7 + + + blue = #8aadf4 + lavender = #b7bdf8 + sapphire = #7dc4e4 + sky = #91d7e3 + teal = #8bd5ca + green = #a6da95 + yellow = #eed49f + peach = #f5a97f + maroon = #ee99a0 + red = #ed8796 + mauve = #c6a0f6 + pink = #f5bde6 + flamingo = #f0c6c6 + rosewater = #f4dbd6 + + transparent = #FF00000 \ No newline at end of file diff --git a/polybar/modules/heatSensors b/polybar/modules/heatSensors new file mode 100755 index 00000000..98b87be7 --- /dev/null +++ b/polybar/modules/heatSensors @@ -0,0 +1,56 @@ +# Select the right temperature file. # +for temp_dir in /sys/class/hwmon/*; do + [[ "$(< "${temp_dir}/name")" =~ (coretemp|fam15h_power|k10temp) ]] && { + + temp_dirs=("$temp_dir"/temp*_input) + temp_dir=${temp_dirs[0]} + break + + } + +done + + +# Get CPU temp. # +[[ -f "$temp_dir" ]] && deg="$(($(< "$temp_dir") * 100 / 10000))" + +# Add CPU temp to the output. # +if [[ "$cpu_temp" != "off" && "$deg" ]]; then + deg="${deg//.}" + + # Convert to Fahrenheit if enabled + [[ "$cpu_temp" == "F" ]] && deg="$((deg * 90 / 50 + 320))" + + deg_no_format="${deg/${deg: -1}}" + + # Format the output + deg="${deg/${deg: -1}}°${cpu_temp:-C}" + + +fi + +# from 0°C to 40°C print ->  +if [[ "$deg_no_format" -le 40 ]] + then + # the ' %{T3} ' -> pass font type to polybar config file + # the selected font type is number 3, which is (font-3 = "Iosevka:style=bold:"size=12;3" ) + echo "%{T3} %{F#79E6F3}$deg" + +# from 40°C to 60°C print ->  +elif [[ "$deg_no_format" -le 60 ]] + then + echo "%{T3} %{F#79E6F3}$deg" + + +# from 60°C to 85°C print ->  +elif [[ "$deg_no_format" -le 85 ]] + then + echo "%{T3} %{F#79E6F3}$deg" + +# from 85°C to +... print ->  +elif [[ "$deg_no_format" -gt 85 ]] + then + # the ' -n "%{F#FF0008}" ' -> red font as 85°C to +... is the default warn temperature + echo -n "%{T3}%{F#FF0008} %{F#FF0008}$deg" +fi + diff --git a/polybar/modules/mediaModules b/polybar/modules/mediaModules new file mode 100755 index 00000000..de6775fa --- /dev/null +++ b/polybar/modules/mediaModules @@ -0,0 +1,155 @@ +[module/volume] + +type = internal/pulseaudio + +; 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 = false + +; Interval for volume increase/decrease (in percent points) +; Default: 5 +interval = 5 + + +; format-volume = +format-volume =  + +format-volume-foreground = ${color.green} + +format-muted = +format-muted-prefix = 婢 +format-muted-prefix-font = 3 +format-muted-prefix-foreground = ${color.red} + +label-volume = %percentage%% +label-volume-font = 4 +label-volume-foreground = ${color.green} +label-muted = " Mute" +muted-label-font = 5 +label-muted-foreground = ${color.red} + +ramp-volume-0 = 奄 +ramp-volume-1 = 奄 +ramp-volume-2 = 奄 +ramp-volume-3 = 奔 +ramp-volume-4 = 奔 +ramp-volume-5 = 奔 +ramp-volume-6 = 墳 +ramp-volume-7 = 墳 +ramp-volume-8 = 墳 +ramp-volume-9 = 墳 +ramp-volume-font = 3 +ramp-volume-foreground = ${color.green} + +ramp-headphones-0 =  +ramp-headphones-1 =  + + +; Only applies if is used +bar-volume-width = 10 +bar-volume-gradient = false + +bar-volume-indicator = 󰮯 +bar-volume-indicator-font = 7 +bar-volume-indicator-foreground = ${color.green} + +bar-volume-fill = ━ +bar-volume-fill-font = 7 +bar-volume-foreground-0 = ${color.green} +bar-volume-foreground-1 = ${color.green} +bar-volume-foreground-2 = ${color.green} +bar-volume-foreground-3 = ${color.green} +bar-volume-foreground-4 = ${color.green} + +bar-volume-empty = ━ +bar-volume-empty-font = 7 +bar-volume-empty-foreground = ${color.green} + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/mpd] +type = internal/mpd + +interval = 2 + +format-online = + +; format-online-background = ${color.mb} +format-offline-foreground = ${color.grey} + +format-playing = ${self.format-online} +format-paused = ${self.format-online} +format-stopped = ${self.format-online} + +format-offline = +format-offline-prefix = " " +; format-offline-background = ${color.mb} + +label-song = "%artist% - %title%" +label-song-maxlen = 25 +label-song-ellipsis = true + +label-offline = "Offline" + +icon-play =  +icon-play-font = 2 +icon-play-foreground = ${color.lime} +icon-pause =  +icon-pause-font = 2 +icon-pause-foreground = ${color.lime} +icon-stop =  +icon-stop-foreground = ${color.lime} +icon-prev = 玲 +icon-prev-font = 1 +icon-prev-foreground = ${color.blue} +icon-next = 怜 +icon-next-font = 1 +icon-next-foreground = ${color.blue} + +;;----------- + +[module/song] +type = internal/mpd + +interval = 2 + +format-online = "[ ]" +format-online-foreground = ${color.pink} + +format-playing = ${self.format-online} +format-paused = ${self.format-online} +format-stopped = ${self.format-online} + +label-song = "%title% - %artist%" +label-song-foreground = ${color.cyan} +label-song-maxlen = 25 +label-song-ellipsis = true + +icon-repeat = "" +icon-repeat-foreground = #FF0677 + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/info-cava] +type = custom/script +exec = ~/.dotfiles/polybar/scripts/cava + +format =