From b62b55e417c899265b931c4080653e08f926c881 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Fri, 20 Nov 2020 15:23:42 +0100 Subject: [PATCH] [polybar] Added some PolyBar Config --- .install.conf.yaml | 1 + mpd/mpDris2.service | 2 +- polybar/colors.ini | 265 +++++++++++ polybar/config | 105 +++++ polybar/launch.sh | 12 + polybar/modules.ini | 425 ++++++++++++++++++ polybar/scripts/info-autofs.sh | 4 + polybar/scripts/info-redshift-temp.sh | 15 + polybar/scripts/powermenu | 20 + .../scripts/pulseaudio-default-microphone.sh | 59 +++ profile.sh | 1 + 11 files changed, 908 insertions(+), 1 deletion(-) create mode 100644 polybar/colors.ini create mode 100644 polybar/config create mode 100755 polybar/launch.sh create mode 100644 polybar/modules.ini create mode 100644 polybar/scripts/info-autofs.sh create mode 100755 polybar/scripts/info-redshift-temp.sh create mode 100644 polybar/scripts/powermenu create mode 100755 polybar/scripts/pulseaudio-default-microphone.sh diff --git a/.install.conf.yaml b/.install.conf.yaml index 64460cf..e7bfa34 100644 --- a/.install.conf.yaml +++ b/.install.conf.yaml @@ -14,6 +14,7 @@ ~/.config/geany/filedefs: geany/filedefs ~/.config/ncmpcpp/config: ncmpcpp/config ~/.config/ncmpcpp/bindings: ncmpcpp/bindings + ~/.config/polybar: polybar ~/.local/share/applications: ncmpcpp/ncmpcpp.desktop ~/.mpd/mpd.conf: mpd/mpd.conf ~/.config/mpDris2/mpDris2.conf: mpd/mpDris2.conf diff --git a/mpd/mpDris2.service b/mpd/mpDris2.service index 69e6c8b..40a0688 100644 --- a/mpd/mpDris2.service +++ b/mpd/mpDris2.service @@ -2,7 +2,7 @@ Description=mpDris2 - Music Player Daemon D-Bus bridge Wants=mpd.service After=mpd.service -Requires=dbus.service +Requires=dbus.service mpd.service [Service] Restart=on-failure diff --git a/polybar/colors.ini b/polybar/colors.ini new file mode 100644 index 0000000..951dbcf --- /dev/null +++ b/polybar/colors.ini @@ -0,0 +1,265 @@ +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +;; +;; ______ __ +;; / ____/___ / /___ __________ +;; / / / __ \/ / __ \/ ___/ ___/ +;; / /___/ /_/ / / /_/ / / (__ ) +;; \____/\____/_/\____/_/ /____/ +;; +;; Created By Aditya Shakya @adi1090x +;; +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[color] + +;; Active Colors +bg = #263238 +fg = #DFDFDF +ac = #00BCD4 + +;; Bars +bi = #00BCD4 +be = #00BCD4 +bf = #43a047 +bn = #43a047 +bm = #fdd835 +bd = #e53935 + +;bg = #112526 +;fg = #AE9793 +;ac = #EE7313 + +;; Bars +;bi = #EE7313 +;be = #EE7313 +;bf = #43a047 +;bn = #43a047 +;bm = #fdd835 +;bd = #e53935 + +trans = #00000000 +white = #FFFFFF +black = #000000 + +;; Material Colors + +red = #e53935 +pink = #d81b60 +purple = #8e24aa +deep-purple = #5e35b1 +indigo = #3949ab +blue = #1e88e5 +light-blue = #039be5 +cyan = #00acc1 +teal = #00897b +green = #43a047 +light-green = #7cb342 +lime = #c0ca33 +yellow = #fdd835 +amber = #ffb300 +orange = #fb8c00 +deep-orange = #f4511e +brown = #6d4c41 +grey = #757575 +blue-gray = #546e7a + +;; Material Colors Shades + +; Amber +amshade1 = #FF6F00 +amshade2 = #FF8F00 +amshade3 = #FFA000 +amshade4 = #FFB300 +amshade5 = #FFC107 +amshade6 = #FFCA28 +amshade7 = #FFD54F +amshade8 = #FFE082 + +; Blue +blshade1 = #0D47A1 +blshade2 = #1565C0 +blshade3 = #1976D2 +blshade4 = #1E88E5 +blshade5 = #2196F3 +blshade6 = #42A5F5 +blshade7 = #64B5F6 +blshade8 = #90CAF9 + +; Blue-Grey +bgshade1 = #263238 +bgshade2 = #37474F +bgshade3 = #455A64 +bgshade4 = #546E7A +bgshade5 = #607D8B +bgshade6 = #78909C +bgshade7 = #90A4AE +bgshade8 = #B0BEC5 + +; Brown +brshade1 = #3E2723 +brshade2 = #4E342E +brshade3 = #5D4037 +brshade4 = #6D4C41 +brshade5 = #795548 +brshade6 = #8D6E63 +brshade7 = #A1887F +brshade8 = #BCAAA4 + +; Cyan +cyshade1 = #006064 +cyshade2 = #00838F +cyshade3 = #0097A7 +cyshade4 = #00ACC1 +cyshade5 = #00BCD4 +cyshade6 = #26C6DA +cyshade7 = #4DD0E1 +cyshade8 = #80DEEA + +; Deep-Orange +doshade1 = #BF360C +doshade2 = #D84315 +doshade3 = #E64A19 +doshade4 = #F4511E +doshade5 = #FF5722 +doshade6 = #FF7043 +doshade7 = #FF8A65 +doshade8 = #FFAB91 + +; Deep-Purple +dpshade1 = #311B92 +dpshade2 = #4527A0 +dpshade3 = #512DA8 +dpshade4 = #5E35B1 +dpshade5 = #673AB7 +dpshade6 = #7E57C2 +dpshade7 = #9575CD +dpshade8 = #B39DDB + +; Green +grshade1 = #1B5E20 +grshade2 = #2E7D32 +grshade3 = #388E3C +grshade4 = #43A047 +grshade5 = #4CAF50 +grshade6 = #66BB6A +grshade7 = #81C784 +grshade8 = #A5D6A7 + +; Grey +greshade1 = #212121 +greshade2 = #424242 +greshade3 = #616161 +greshade4 = #757575 +greshade5 = #9E9E9E +greshade6 = #BDBDBD +greshade7 = #D4D4D4 +greshade8 = #EEEEEE + +; Indigo +inshade1 = #1A237E +inshade2 = #283593 +inshade3 = #303F9F +inshade4 = #3949AB +inshade5 = #3F51B5 +inshade6 = #5C6BC0 +inshade7 = #7986CB +inshade8 = #9FA8DA + +; Light-Blue +lbshade1 = #01579B +lbshade2 = #0277BD +lbshade3 = #0288D1 +lbshade4 = #039BE5 +lbshade5 = #03A9F4 +lbshade6 = #29B6F6 +lbshade7 = #4FC3F7 +lbshade8 = #81D4FA + +; Light-Green +lgshade1 = #33691E +lgshade2 = #558B2F +lgshade3 = #689F38 +lgshade4 = #7CB342 +lgshade5 = #8BC34A +lgshade6 = #9CCC65 +lgshade7 = #AED581 +lgshade8 = #C5E1A5 + +; Lime +lishade1 = #827717 +lishade2 = #9E9D24 +lishade3 = #AFB42B +lishade4 = #C0CA33 +lishade5 = #CDDC39 +lishade6 = #D4E157 +lishade7 = #DCE775 +lishade8 = #E6EE9C + +; Orange +orshade1 = #E65100 +orshade2 = #EF6C00 +orshade3 = #F57C00 +orshade4 = #FB8C00 +orshade5 = #FF9800 +orshade6 = #FFA726 +orshade7 = #FFB74D +orshade8 = #FFCC80 + +; Pink +pishade1 = #880E4F +pishade2 = #AD1457 +pishade3 = #C2185B +pishade4 = #D81B60 +pishade5 = #E91E63 +pishade6 = #EC407A +pishade7 = #F06292 +pishade8 = #F48FB1 + +; Purple +prshade1 = #4A148C +prshade2 = #6A1B9A +prshade3 = #7B1FA2 +prshade4 = #8E24AA +prshade5 = #9C27B0 +prshade6 = #AB47BC +prshade7 = #BA68C8 +prshade8 = #CE93D8 + +; Red +reshade1 = #B71C1C +reshade2 = #C62828 +reshade3 = #D32F2F +reshade4 = #E53935 +reshade5 = #EE413D +reshade6 = #EF5350 +reshade7 = #E57373 +reshade8 = #EF9A9A + +; Teal +teshade1 = #004D40 +teshade2 = #00695C +teshade3 = #00796B +teshade4 = #00897B +teshade5 = #009688 +teshade6 = #26A69A +teshade7 = #4DB6AC +teshade8 = #80CBC4 + +; Yellow +yeshade1 = #F57F17 +yeshade2 = #F9A825 +yeshade3 = #FBC02D +yeshade4 = #FDD835 +yeshade5 = #FFEB3B +yeshade6 = #FFEE58 +yeshade7 = #FFF176 +yeshade8 = #FFF59D + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +;; __________ ______ +;; / ____/ __ \/ ____/ +;; / __/ / / / / /_ +;; / /___/ /_/ / __/ +;; /_____/\____/_/ +;; +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ diff --git a/polybar/config b/polybar/config new file mode 100644 index 0000000..064442f --- /dev/null +++ b/polybar/config @@ -0,0 +1,105 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== + +[colors] +;background = ${xrdb:color0:#222} +background = #222 +background-alt = #444 +;foreground = ${xrdb:color7:#222} +foreground = #dfdfdf +foreground-alt = #555 +prefix-foreground = #E4FF00 +primary = #ffb52a +secondary = #e60053 +alert = #bd2c40 + +[global/wm] +margin-top = 0 +margin-bottom = 0 +include-file = ~/.config/polybar/colors.ini +include-file = ~/.config/polybar/modules.ini + +[bar/main] +monitor = +offset-x = 0 +offset-y = 0 +radius = 0 +fixed-center = true + +background = ${colors.background} +foreground = ${colors.foreground} +foreground-alt = ${colors.foreground-alt} +prefix-foreground = ${colors.prefix-foreground} + +line-size = 3 +line-color = #f00 + +border-size = 0 +border-color = #00000000 + +padding = 2 + +module-margin-left = 1 +module-margin-right = 2 + +font-0 = "Iosevka Nerd Font:size=10;2" +font-1 = "Iosevka Nerd Font:bold:size=10;2" +font-2 = unifont:fontformat=truetype:size=8:antialias=false;0 +font-3 = siji:pixelsize=10;1 +font-4 = fixed:pixelsize=10;1 + +;wm-restack = bspwm +;wm-restack = i3 + +override-redirect = true + +;scroll-up = bspwm-desknext +;scroll-down = bspwm-deskprev + +;scroll-up = i3wm-wsnext +;scroll-down = i3wm-wsprev + +cursor-click = pointer +cursor-scroll = ns-resize + +[bar/primary] +inherit = bar/main + +monitor = ${env:MONITOR:HDMI-1} +width = 100% +height = 27 + +modules-left = mpd +modules-center = filesystem cpu memory eth +modules-right = pa-microphone pulseaudio redshift date time + +#tray-position = right +#tray-padding = 0 +#tray-background = #0063ff + + +[settings] +screenchange-reload = true +;compositing-background = xor +;compositing-background = screen +;compositing-foreground = source +;compositing-border = over +;pseudo-transparency = false + + +; vim:ft=dosini diff --git a/polybar/launch.sh b/polybar/launch.sh new file mode 100755 index 0000000..f19e555 --- /dev/null +++ b/polybar/launch.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Terminate already running bar instances +killall -q polybar +# If all your bars have ipc enabled, you can also use +# polybar-msg cmd quit + +# Launch bar1 and bar2 +echo "---" | tee -a /tmp/polybar1.log +polybar primary >>/tmp/polybar1.log 2>&1 & + +echo "Bars launched..." diff --git a/polybar/modules.ini b/polybar/modules.ini new file mode 100644 index 0000000..ca4718e --- /dev/null +++ b/polybar/modules.ini @@ -0,0 +1,425 @@ +[module/xwindow] +type = internal/xwindow +label = %title:0:30:...% + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock + +format-prefix = " " +format-prefix-foreground = ${colors.foreground-alt} +format-prefix-underline = ${colors.secondary} + +label-layout = %layout% +label-layout-underline = ${colors.secondary} + +label-indicator-padding = 2 +label-indicator-margin = 1 +label-indicator-background = ${colors.secondary} +label-indicator-underline = ${colors.secondary} + +[module/filesystem] +type = internal/fs +interval = 10 + +mount-0 = / +mount-1 = /home + +label-mounted = %{F#0a81f5} %mountpoint%%{F-}: %used%/%total% +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.foreground-alt} + +[module/bspwm] +type = internal/bspwm + +label-focused = %index% +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 2 + +label-occupied = %index% +label-occupied-padding = 2 + +label-urgent = %index%! +label-urgent-background = ${colors.alert} +label-urgent-padding = 2 + +label-empty = %index% +label-empty-foreground = ${colors.foreground-alt} +label-empty-padding = 2 + +; Separator in between workspaces +; label-separator = | + +[module/i3] +type = internal/i3 +format = +index-sort = true +wrapping-scroll = false + +; Only show workspaces on the same output as the bar +;pin-workspaces = true + +label-mode-padding = 2 +label-mode-foreground = #000 +label-mode-background = ${colors.primary} + +; focused = Active workspace on focused monitor +label-focused = %index% +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 2 + +; unfocused = Inactive workspace on any monitor +label-unfocused = %index% +label-unfocused-padding = 2 + +; visible = Active workspace on unfocused monitor +label-visible = %index% +label-visible-background = ${self.label-focused-background} +label-visible-underline = ${self.label-focused-underline} +label-visible-padding = ${self.label-focused-padding} + +; urgent = Workspace with urgency hint set +label-urgent = %index% +label-urgent-background = ${colors.alert} +label-urgent-padding = 2 + +; Separator in between workspaces +; label-separator = | + + +[module/mpd] +type = internal/mpd +interval = 1 +host = /home/ericteunis/.config/mpd/socket +format-online = +format-offline = +label-offline = " MPD is offline" + +icon-play = 契 +icon-pause =  +icon-stop = 栗 +icon-prev = 玲 +icon-next = 怜 +icon-seekb = 寧 +icon-seekf = 嶺 +icon-random =  +icon-random-off = 劣 +icon-repeat = 凌 +icon-repeat-off = 稜 +icon-single = 綾 +icon-consume = 碌 + +label-song-maxlen = 75 +label-song-ellipsis = true +label-song-font = 2 + +label-time = %elapsed%/%total% +toggle-on-foreground = ${root.foreground} +toggle-off-foreground = ${root.foreground-alt} + +[module/backlight] +;https://github.com/jaagr/polybar/wiki/Module:-backlight + +type = internal/backlight + +; Use the following command to list available cards: +; $ ls -1 /sys/class/backlight/ +card = intel_backlight + +; Available tags: +;