From 57b4642ed0f32051f508410c1770cd24094f84f7 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Tue, 17 Nov 2020 13:58:04 +0100 Subject: [PATCH] Added Polybar config --- Bin/device_battery.sh | 6 + config/polybar/colors | 19 ++ config/polybar/config | 66 ++++ config/polybar/global | 33 ++ config/polybar/modules | 303 ++++++++++++++++++ .../polybar/scripts/inbox-imap-shellnetrc.sh | 12 + config/polybar/scripts/info-tmux-sessions.sh | 21 ++ .../scripts/vpn-networkmanager-status.sh | 9 + .../polybar/scripts/vpn-openvpn-isrunning.sh | 9 + config/polybar/settings | 5 + 10 files changed, 483 insertions(+) create mode 100755 Bin/device_battery.sh create mode 100644 config/polybar/colors create mode 100644 config/polybar/config create mode 100644 config/polybar/global create mode 100644 config/polybar/modules create mode 100755 config/polybar/scripts/inbox-imap-shellnetrc.sh create mode 100755 config/polybar/scripts/info-tmux-sessions.sh create mode 100755 config/polybar/scripts/vpn-networkmanager-status.sh create mode 100755 config/polybar/scripts/vpn-openvpn-isrunning.sh create mode 100644 config/polybar/settings diff --git a/Bin/device_battery.sh b/Bin/device_battery.sh new file mode 100755 index 0000000..e847979 --- /dev/null +++ b/Bin/device_battery.sh @@ -0,0 +1,6 @@ +#! /bin/bash + +MOUSE_PATH=`qdbus --system org.freedesktop.UPower|grep $1` +PERCENTAGE=`qdbus --system org.freedesktop.UPower ${MOUSE_PATH} org.freedesktop.UPower.Device.Percentage` + +echo ${PERCENTAGE}% diff --git a/config/polybar/colors b/config/polybar/colors new file mode 100644 index 0000000..b4fc821 --- /dev/null +++ b/config/polybar/colors @@ -0,0 +1,19 @@ +; vim:ft=dosini + +[colors] +nord0 = #2E3440 +nord1 = #3B4252 +nord2 = #434C5E +nord3 = #4C566A +nord4 = #D8DEE9 +nord5 = #E5E9F0 +nord6 = #ECEFF4 +nord7 = #8FBCBB +nord8 = #88C0D0 +nord9 = #81A1C1 +nord10= #5E81AC +nord11= #BF616A +nord12= #D08770 +nord13= #EBCB8B +nord14= #A3BE8C +nord15= #B48EAD diff --git a/config/polybar/config b/config/polybar/config new file mode 100644 index 0000000..0e49cc6 --- /dev/null +++ b/config/polybar/config @@ -0,0 +1,66 @@ +; vim:ft=dosini + +include-file = $HOME/.config/polybar/colors +include-file = $HOME/.config/polybar/global +include-file = $HOME/.config/polybar/modules +include-file = $HOME/.config/polybar/settings + + +[global-wm] +margin-top = 4 +margin-bottom = 4 + + +[bar/base] +width = ${global.width} +height = ${global.height} +radius = ${global.radius} + +fixed-center = ${global.fixed-center} + +background = ${global.background} +foreground = ${global.foreground} + +line-size = ${global.line-size} +line-color = ${global.line-color} + +border-size = ${global.border-size} +border-color = ${global.border-color} + +padding-left = ${global.padding-left} +padding-right = ${global.padding-right} + +module-margin-left = ${global.module-margin-left} +module-margin-right = ${global.module-margin-right} + +font-0 = ${global.font-0} +font-1 = ${global.font-1} +font-2 = ${global.font-2} + +separator = ${global.separator} + +cursor-click = ${global.cursor-click} +cursor-scroll = ${global.cursor-scroll} + + +[bar/top] +inherit = bar/base +bottom = false + +modules-left = i3 +modules-right = filesystem vpn wlan eth cpu memory battery hhkb logitech lcd_brightness pulseaudio bluetooth_headphones_status multimedia_previous multimedia_current multimedia_next imap tmux date + + +[bar/bottom] +inherit = bar/base +bottom = true + +modules-left = i3 +modules-right = filesystem vpn wlan eth battery hhkb logitech lcd_brightness pulseaudio bluetooth_headphones_status multimedia_previous multimedia_current multimedia_next date +; disabled modules +; imap tmux cpu memory temperature-wifi + +tray-position = right +tray-padding = 2 +tray-background = ${global.background} +tray-detached = false diff --git a/config/polybar/global b/config/polybar/global new file mode 100644 index 0000000..8112940 --- /dev/null +++ b/config/polybar/global @@ -0,0 +1,33 @@ +; vim:ft=dosini + +[global] +width = 100% +height = 26 + +radius = 0 + +fixed-center = false + +background = ${colors.nord0} +foreground = ${colors.nord10} + +line-size = 4 +line-color = ${colors.nord10} + +border-size = 0 +border-color = ${colors.nord0} + +padding-left = 0 +padding-right = 4 + +module-margin-left = 2 +module-margin-right = 2 + +font-0 = DejaVu Sans Mono for Powerline Book:size=9 +font-1 = FontAwesome:pixelsize=9;0 +font-2 = ProFontIIx Nerd Font:pixelsize=9;0 + +separator = ❱ + +cursor-click = pointer +cursor-scroll = ns-resize diff --git a/config/polybar/modules b/config/polybar/modules new file mode 100644 index 0000000..586641b --- /dev/null +++ b/config/polybar/modules @@ -0,0 +1,303 @@ +; vim:ft=dosini + +[module/filesystem] +type = internal/fs + +interval = 120 + +mount-0 = /home + +label-mounted = " %mountpoint%: %percentage_used%%" + +label-unmounted =  %mountpoint% not mounted +label-unmounted-foreground = ${colors.nord11} + + +[module/i3] +type = internal/i3 + +format = + +index-sort = true + +wrapping-scroll = false + +label-focused-foreground = ${colors.nord0} +label-focused-background = ${colors.nord8} +label-focused-underline= ${colors.nord10} +label-focused-padding = 2 + +label-unfocused-foreground = ${colors.nord5} +label-unfocused-background = ${colors.nord3} +label-unfocused-padding = 2 + +label-visible-foreground = ${colors.nord5} +label-visible-background = ${colors.nord3} +label-visible-underline = ${colors.nord10} +label-visible-padding = 2 + +label-urgent-foreground = ${colors.nord5} +label-urgent-background = ${colors.nord12} +label-urgent-underline = ${colors.nord11} +label-urgent-padding = 2 + + +[module/vpn] +type = custom/script +exec = ~/.config/polybar/scripts/vpn-networkmanager-status.sh +interval = 5 + + +[module/wlan] +type = internal/network +interface = wlp59s0 + +interval = 3.0 + +format-connected = 直 +label-connected = %essid% +format-connected-underline = ${colors.nord14} + +format-disconnected = 睊 +format-disconnected-underline = ${colors.nord11} + + +[module/eth] +type = internal/network +interface = enp0s31f6 + +interval = 3.0 + +format-connected-underline = ${colors.nord14} +label-connected =  %linkspeed% + +format-disconnected =  +format-disconnected-underline = ${colors.nord11} + + +[module/date] +type = internal/date + +interval = 30 + +date = %d/%m +time = %H:%M + +label =  %date% %time% + + +[module/pulseaudio] +type = internal/pulseaudio + +format-volume = + +label-volume = ♪ %percentage%% + +label-muted =  - +label-muted-foreground = ${colors.nord11} + +bar-volume-width = 10 +bar-volume-foreground-0 = ${colors.nord14} +bar-volume-foreground-1 = ${colors.nord14} +bar-volume-foreground-2 = ${colors.nord14} +bar-volume-foreground-3 = ${colors.nord14} +bar-volume-foreground-4 = ${colors.nord13} +bar-volume-foreground-5 = ${colors.nord13} +bar-volume-foreground-6 = ${colors.nord12} +bar-volume-foreground-7 = ${colors.nord12} +bar-volume-foreground-8 = ${colors.nord11} +bar-volume-foreground-9 = ${colors.nord11} + +bar-volume-gradient = true + +bar-volume-indicator = | +bar-volume-indicator-font = 2 + +bar-volume-fill = ▄ +bar-volume-fill-font = 2 + +bar-volume-empty = ▄ +bar-volume-empty-font = 2 +bar-volume-empty-foreground = ${colors.nord6} + + +[module/battery] +type = internal/battery + +battery = BAT0 +adapter = AC + +full-at = 100 + +format-charging = +format-charging-underline = ${colors.nord14} + +format-discharging = +format-discharging-underline = ${colors.nord13} + +format-full-prefix = " " +format-full-underline = ${colors.nord10} + +animation-charging-0 =  +animation-charging-1 =  +animation-charging-2 =  +animation-charging-3 =  +animation-charging-4 =  +animation-charging-5 =  +animation-charging-framerate = 750 + +animation-discharging-0 =  +animation-discharging-1 =  +animation-discharging-2 =  +animation-discharging-3 =  +animation-discharging-4 =  +animation-discharging-5 =  +animation-discharging-framerate = 750 + + +[module/logitech] +type = custom/script +exec = ~/Bin/device_battery.sh mouse 2>/dev/null + +format = 