diff options
Diffstat (limited to 'polybar/normal')
-rwxr-xr-x | polybar/normal/launch.sh | 18 | ||||
-rwxr-xr-x | polybar/normal/scr2.sh | 26 | ||||
-rw-r--r-- | polybar/normal/template.ini | 176 | ||||
-rwxr-xr-x | polybar/normal/tray.sh | 27 |
4 files changed, 235 insertions, 12 deletions
diff --git a/polybar/normal/launch.sh b/polybar/normal/launch.sh index 2bba345..aebe8a0 100755 --- a/polybar/normal/launch.sh +++ b/polybar/normal/launch.sh @@ -15,18 +15,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -sleep 1 +SCR1=$(xrandr -q | grep ' connected' | grep primary | awk '{print $1}') -polybar --reload -q main -c "${HOME}/.config/polybar/config.ini" & -polybar --reload -q opt -c "${HOME}/.config/polybar/config.ini" & - -polybar --reload -q tray -c "${HOME}/.config/polybar/config.ini" & +cp -p ${HOME}/.config/polybar/template.ini ${HOME}/.config/polybar/config.ini +sed -i "s/SCR1/${SCR1}/g" ${HOME}/.config/polybar/config.ini -while [[ $(pgrep -x polybar | wc -l) -lt 3 ]]; do sleep 1; done -sleep 2 - -while [ -z "$(bspc query -N -n any.fullscreen)" ]; do sleep 1; done -sleep 2 +polybar --reload -q main -c "${HOME}/.config/polybar/config.ini" & -TRAYBAR=$(pgrep -x polybar | tail -n 1) -xdo above -t $(bspc query -N -n any.fullscreen) $(xdo id -p ${TRAYBAR}) +${HOME}/.config/polybar/scr2.sh & +${HOME}/.config/polybar/tray.sh & diff --git a/polybar/normal/scr2.sh b/polybar/normal/scr2.sh new file mode 100755 index 0000000..d3a4b49 --- /dev/null +++ b/polybar/normal/scr2.sh @@ -0,0 +1,26 @@ +#! /bin/sh + +# Copyright (C) 2022 HimbeerserverDE +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +while [ -z "${SCR2}" ]; do + SCR2=$(xrandr -q | grep ' connected' | grep -v primary | awk '{print $1}') +done + +sleep 12 + +sed -i "s/SCR2/${SCR2}/g" ${HOME}/.config/polybar/config.ini + +polybar --reload -q opt -c "${HOME}/.config/polybar/config.ini" & diff --git a/polybar/normal/template.ini b/polybar/normal/template.ini new file mode 100644 index 0000000..44e9442 --- /dev/null +++ b/polybar/normal/template.ini @@ -0,0 +1,176 @@ +[bar/base] +monitor-strict = true +override-redirect = false +fixed-center = true +width = 100% +height = 44 +background = #111111 +foreground = #d8d8d8 +radius = 10.0 +border-size = 4 +border-color = #00000000 +border-bottom-size = 0 +padding = 2 +module-margin-left = 1 +module-margin-right = 1 +font-0 = "Terminus:size=10;3" +font-1 = "Noto Color Emoji:pixelsize=16:style=Regular:scale=10;3" + +modules-left = workspaces sep wireless sep wired +modules-right = cpu sep memory sep volume sep battery sep brightness sep date + +wm-name = bspwm +wm-restack = bspwm +enable-ipc = true + +[bar/main] +inherit = bar/base +monitor = SCR1 +width = 90% +border-right-size = 2 + +[bar/opt] +inherit = bar/base +monitor = SCR2 + +[bar/tray] +inherit = bar/base +monitor = SCR1 +override-reditect = true +width = 10% +offset-x = 90% +border-left-size = 2 + +modules-left = +modules-center = dummy +modules-right = + +tray-position = center +tray-detached = true + +wm-restack = + +[settings] +throttle-output = 5 +throttle-output-for = 10 + +; @see: https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t +compositing-background = source +compositing-foreground = over +compositing-overline = over +compositing-underline = over +compositing-border = over + +[module/workspaces] +type = internal/xworkspaces +pin-workspaces = true +enable-click = true +enable-scroll = true +reverse-scroll = true + +icon-0 = 1;e +icon-1 = 2;l +icon-2 = 3;i +icon-3 = 4;d +icon-4 = 5;r +icon-5 = 6;a +icon-6 = 7;g +icon-7 = 8;o +icon-8 = 9;n + +format = <label-state> +label-active = "%{F#3366ff}%icon%" +label-occupied = "%{F#33ff33}%icon%" +label-urgent = "%{F#ff3333}%icon%" +label-empty = "%{F#d8d8d8}%icon%" +label-active-padding = 1 +label-urgent-padding = 1 +label-occupied-padding = 1 +label-empty-padding = 1 + +[module/sep] +type = custom/text +content = | +content-foreground = #a5a5a5 + +[module/dummy] +type = custom/text +content = | +content-foreground = #00000000 + +[module/memory] +type = internal/memory +interval = 1 +format = <label> +label = "π %{F#33dddd}%gb_free%" +label-warn = "π %{F#ff3333}%gb_free%" + +[module/cpu] +type = internal/cpu +interval = 1 +format = <label> +label = "π» %{F#33dddd}%percentage-cores%" + +[module/battery] +type = internal/battery +full-at = 97 +low-at = 15 +battery = BAT0 +adapter = AC +poll-interval = 20 +time-format = %H:%M +format-charging = <label-charging> +format-discharging = <label-discharging> +format-full = <label-full> +format-low = <label-low> +label-charging = "β‘ %percentage%% %time%" +label-discharging = "π %percentage%% %time%" +label-full = "π %percentage%%" +label-low = "ππ¨ %{F#ff3333}%percentage%% %time%" + +[module/brightness] +type = internal/backlight +card = intel_backlight +enable-scroll = true +format = <label> +label = "π‘ %percentage%%" + +[module/wireless] +type = internal/network +interface-type = wireless +interval = 1.0 +format-connected = <label-connected> +format-disconnected = <label-disconnected> +format-packetloss = <label-packetloss> +label-connected = "πΆ %essid% %{F#33dddd}%signal%% %{F#11cc11}%upspeed%β %downspeed%β" +label-disconnected = "πΆπ«" +label-packetloss = "πΆπ¦π¨ %essid% %{F#33dddd}%signal%% %{F#11cc11}%upspeed%β %downspeed%β" + +[module/wired] +type = internal/network +interface-type = wired +interval = 1.0 +format-connected = <label-connected> +format-disconnected = <label-disconnected> +format-packetloss = <label-packetloss> +label-connected = "π %linkspeed% %{F#11cc11}%upspeed%β %downspeed%β" +label-disconnected = "ππ«" +label-packetloss = "ππ¦π¨ %linkspeed% %{F#11cc11}%upspeed%β %downspeed%β" + +[module/date] +type = internal/date +date = %Y-%m-%d +time = %H:%M:%S +date-alt = %d. %b %Y +time-alt = %H:%M:%S +format = <label> +label = %date% %time% + +[module/volume] +type = internal/alsa +master-soundcard = default +format-volume = <ramp-volume> <label-volume> +label-muted = "π%percentage%%" +ramp-volume-0 = π +ramp-volume-1 = π +ramp-volume-2 = π diff --git a/polybar/normal/tray.sh b/polybar/normal/tray.sh new file mode 100755 index 0000000..2029414 --- /dev/null +++ b/polybar/normal/tray.sh @@ -0,0 +1,27 @@ +#! /bin/sh + +# Copyright (C) 2022 HimbeerserverDE +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +polybar --reload -q tray -c "${HOME}/.config/polybar/config.ini" & + +while [[ $(pgrep -x polybar | wc -l) -lt 3 ]]; do sleep 1; done +sleep 2 + +while [ -z "$(bspc query -N -n any.fullscreen)" ]; do sleep 1; done +sleep 2 + +TRAYBAR=$(pgrep -x polybar | tail -n 1) +xdo above -t $(bspc query -N -n any.fullscreen) $(xdo id -p ${TRAYBAR}) |