diff options
Diffstat (limited to '.config/polybar')
| -rw-r--r-- | .config/polybar/config | 256 | ||||
| -rwxr-xr-x | .config/polybar/focus | 42 | ||||
| -rwxr-xr-x | .config/polybar/launch.sh | 12 |
3 files changed, 310 insertions, 0 deletions
diff --git a/.config/polybar/config b/.config/polybar/config new file mode 100644 index 0000000..144597e --- /dev/null +++ b/.config/polybar/config | |||
| @@ -0,0 +1,256 @@ | |||
| 1 | ;========================================================== | ||
| 2 | ; | ||
| 3 | ; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ | ||
| 4 | ; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ | ||
| 5 | ; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ | ||
| 6 | ; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ | ||
| 7 | ; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ | ||
| 8 | ; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ | ||
| 9 | ; | ||
| 10 | ;========================================================== | ||
| 11 | |||
| 12 | [colors] | ||
| 13 | background = #0c1014 | ||
| 14 | background_alt = #0a3749 | ||
| 15 | background_modules = #fbf1c7 | ||
| 16 | foreground = #d3ebe9 | ||
| 17 | foreground_alt = #99d1ce | ||
| 18 | foreground_modules = #282828 | ||
| 19 | red = #9d0006 | ||
| 20 | green = #427b58 | ||
| 21 | yellow = #b56714 | ||
| 22 | blue = #458588 | ||
| 23 | purple = #8f3f71 | ||
| 24 | aqua = #689d6a | ||
| 25 | orange = #d65d0e | ||
| 26 | primary = #d26937 | ||
| 27 | secondary = #888ca6 | ||
| 28 | alert = #c23127 | ||
| 29 | |||
| 30 | [bar/top] | ||
| 31 | monitor = DVI-I-1 | ||
| 32 | width = 100% | ||
| 33 | height = 20 | ||
| 34 | offset-x = 0 | ||
| 35 | offset-y = 0 | ||
| 36 | radius = 0 | ||
| 37 | fixed-center = true | ||
| 38 | |||
| 39 | background = ${colors.background} | ||
| 40 | foreground = ${colors.foreground} | ||
| 41 | |||
| 42 | border-top-size = 0 | ||
| 43 | border-bottom-size = 0 | ||
| 44 | border-top-color = ${colors.background} | ||
| 45 | border-bottom-color = ${colors.background} | ||
| 46 | |||
| 47 | padding = 2 | ||
| 48 | module-margin = 1 | ||
| 49 | |||
| 50 | font-0 = scientifica:antialias=false;0 | ||
| 51 | font-1 = Lato:size=10;1 | ||
| 52 | font-2 = Raleway:size=10;1 | ||
| 53 | font-3 = FuraCode Nerd Font Mono:size=12;2 | ||
| 54 | |||
| 55 | modules-left = i3 pulseaudio mpd | ||
| 56 | modules-center = xwindow | ||
| 57 | modules-right = focus download upload date time xkeyboard | ||
| 58 | |||
| 59 | tray-position = right | ||
| 60 | |||
| 61 | [module/focus] | ||
| 62 | type = custom/script | ||
| 63 | exec = ~/.config/polybar/focus | ||
| 64 | interval = 10 | ||
| 65 | |||
| 66 | [module/mpd] | ||
| 67 | type = internal/mpd | ||
| 68 | host = 127.0.0.1 | ||
| 69 | port = 6600 | ||
| 70 | |||
| 71 | format-online = <toggle> <label-song> <icon-random> | ||
| 72 | label-song = %artist% - %title% | ||
| 73 | icon-pause = | ||
| 74 | icon-play = | ||
| 75 | icon-random = 咽 | ||
| 76 | |||
| 77 | toggle-on-foreground = ${colors.background_modules} | ||
| 78 | toggle-off-foreground = ${colors.foreground_modules} | ||
| 79 | |||
| 80 | format-offline = <label-offline> | ||
| 81 | label-offline = mpd is offline | ||
| 82 | |||
| 83 | [module/xwindow] | ||
| 84 | type = internal/xwindow | ||
| 85 | format = <label> | ||
| 86 | label = %title:0:70:...% | ||
| 87 | |||
| 88 | y-offset = 10 | ||
| 89 | label-padding = 1 | ||
| 90 | label-font = 1 | ||
| 91 | |||
| 92 | label-empty = ﳓ | ||
| 93 | label-empty-font = 4 | ||
| 94 | label-empty-padding = 5 | ||
| 95 | |||
| 96 | [module/xkeyboard] | ||
| 97 | type = internal/xkeyboard | ||
| 98 | blacklist-0 = num lock | ||
| 99 | blacklist-1 = scroll lock | ||
| 100 | |||
| 101 | format = <label-layout> <label-indicator> | ||
| 102 | format-spacing = 0 | ||
| 103 | |||
| 104 | format-prefix = | ||
| 105 | format-prefix-padding = 1 | ||
| 106 | format-prefix-background = ${colors.blue} | ||
| 107 | format-prefix-foreground = ${colors.foreground} | ||
| 108 | format-prefix-font = 4 | ||
| 109 | |||
| 110 | label-layout = %layout% | ||
| 111 | label-layout-padding = 1 | ||
| 112 | label-layout-background = ${colors.background_modules} | ||
| 113 | label-layout-foreground = ${colors.foreground_modules} | ||
| 114 | |||
| 115 | label-indicator-padding = 2 | ||
| 116 | label-indicator-margin = | ||
| 117 | label-indicator-background = ${colors.alert} | ||
| 118 | |||
| 119 | [module/i3] | ||
| 120 | type = internal/i3 | ||
| 121 | format = <label-state> <label-mode> | ||
| 122 | index-sort = true | ||
| 123 | wrapping-scroll = false | ||
| 124 | strip-wsnumbers = true | ||
| 125 | |||
| 126 | label-mode-background = ${colors.background_modules} | ||
| 127 | label-mode-foreground = ${colors.foreground_modules} | ||
| 128 | label-mode-padding = 2 | ||
| 129 | |||
| 130 | label-focused = %name% | ||
| 131 | label-focused-background = ${colors.red} | ||
| 132 | label-focused-foreground = ${colors.background_modules} | ||
| 133 | label-focused-padding = 1 | ||
| 134 | |||
| 135 | label-unfocused = %name% | ||
| 136 | label-unfocused-background = ${colors.background_modules} | ||
| 137 | label-unfocused-foreground = ${colors.foreground_modules} | ||
| 138 | label-unfocused-padding = 1 | ||
| 139 | |||
| 140 | label-visible = %name% | ||
| 141 | label-visible-background = ${colors.background_modules} | ||
| 142 | label-visible-foreground = ${colors.foreground_modules} | ||
| 143 | label-visible-padding = 1 | ||
| 144 | |||
| 145 | label-urgent = %index% | ||
| 146 | label-urgent-background = ${colors.alert} | ||
| 147 | label-urgent-foreground = ${colors.background} | ||
| 148 | label-urgent-padding = 1 | ||
| 149 | |||
| 150 | [module/download] | ||
| 151 | type = internal/network | ||
| 152 | interface = eno1 | ||
| 153 | interval = 3.0 | ||
| 154 | |||
| 155 | format-connected = <label-connected> | ||
| 156 | |||
| 157 | format-connected-prefix = | ||
| 158 | format-connected-prefix-padding = 1 | ||
| 159 | format-connected-prefix-background = ${colors.green} | ||
| 160 | format-connected-prefix-foreground = ${colors.foreground} | ||
| 161 | |||
| 162 | label-connected = %downspeed% | ||
| 163 | label-connected-background = ${colors.background_modules} | ||
| 164 | label-connected-foreground = ${colors.foreground_modules} | ||
| 165 | label-connected-padding = 1 | ||
| 166 | |||
| 167 | format-disconnected = <label-disconnected> | ||
| 168 | label-disconnected = %ifname% disconnected | ||
| 169 | |||
| 170 | [module/upload] | ||
| 171 | type = internal/network | ||
| 172 | interface = eno1 | ||
| 173 | interval = 3.0 | ||
| 174 | |||
| 175 | format-connected = <label-connected> | ||
| 176 | |||
| 177 | format-connected-prefix = | ||
| 178 | format-connected-prefix-padding = 1 | ||
| 179 | format-connected-prefix-background = ${colors.yellow} | ||
| 180 | format-connected-prefix-foreground = ${colors.foreground} | ||
| 181 | |||
| 182 | label-connected = %upspeed% | ||
| 183 | label-connected-background = ${colors.background_modules} | ||
| 184 | label-connected-foreground = ${colors.foreground_modules} | ||
| 185 | label-connected-padding = 1 | ||
| 186 | |||
| 187 | [module/date] | ||
| 188 | type = internal/date | ||
| 189 | interval = 1 | ||
| 190 | |||
| 191 | date = %Y-%m-%d %A | ||
| 192 | label = %date% | ||
| 193 | format = <label> | ||
| 194 | |||
| 195 | format-prefix = | ||
| 196 | format-prefix-background = ${colors.orange} | ||
| 197 | format-prefix-foreground = ${colors.foreground} | ||
| 198 | format-prefix-font = 4 | ||
| 199 | format-prefix-padding = 1 | ||
| 200 | |||
| 201 | label-background = ${colors.background_modules} | ||
| 202 | label-foreground = ${colors.foreground_modules} | ||
| 203 | label-padding = 1 | ||
| 204 | |||
| 205 | [module/time] | ||
| 206 | type = internal/date | ||
| 207 | interval = 1 | ||
| 208 | |||
| 209 | time = %H:%M | ||
| 210 | label = %time% | ||
| 211 | format = <label> | ||
| 212 | |||
| 213 | format-prefix = | ||
| 214 | format-prefix-background = ${colors.secondary} | ||
| 215 | format-prefix-foreground = ${colors.foreground} | ||
| 216 | format-prefix-font = 4 | ||
| 217 | format-prefix-padding = 1 | ||
| 218 | |||
| 219 | label-background = ${colors.background_modules} | ||
| 220 | label-foreground = ${colors.foreground_modules} | ||
| 221 | label-padding = 1 | ||
| 222 | |||
| 223 | [module/pulseaudio] | ||
| 224 | type = internal/pulseaudio | ||
| 225 | interval = 5 | ||
| 226 | |||
| 227 | format-volume = <label-volume> | ||
| 228 | |||
| 229 | format-volume-prefix = ♫ | ||
| 230 | format-volume-prefix-background = ${colors.purple} | ||
| 231 | format-volume-prefix-foreground = ${colors.background_modules} | ||
| 232 | format-volume-prefix-font = 4 | ||
| 233 | format-volume-prefix-padding = 1 | ||
| 234 | |||
| 235 | label-volume = %percentage% | ||
| 236 | label-volume-background = ${colors.background_modules} | ||
| 237 | label-volume-foreground = ${colors.foreground_modules} | ||
| 238 | label-volume-padding = 1 | ||
| 239 | |||
| 240 | label-muted = | ||
| 241 | label-muted-background = ${colors.purple} | ||
| 242 | label-muted-foreground = ${colors.foreground} | ||
| 243 | label-muted-padding = 2 | ||
| 244 | |||
| 245 | [settings] | ||
| 246 | screenchange-reload = true | ||
| 247 | compositing-background = source | ||
| 248 | compositing-foreground = source | ||
| 249 | compositing-border = over | ||
| 250 | pseudo-transparency = false | ||
| 251 | |||
| 252 | [global/wm] | ||
| 253 | margin-top = 5 | ||
| 254 | margin-bottom = 5 | ||
| 255 | |||
| 256 | ; vim:ft=dosini | ||
diff --git a/.config/polybar/focus b/.config/polybar/focus new file mode 100755 index 0000000..0cccea4 --- /dev/null +++ b/.config/polybar/focus | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | #!/usr/bin/env perl | ||
| 2 | # shows active taskwarrior task on polybar | ||
| 3 | #Copyright © 2019 yourname | ||
| 4 | |||
| 5 | #This program is free software: you can redistribute it and/or modify | ||
| 6 | #it under the terms of the GNU General Public License as published by | ||
| 7 | #the Free Software Foundation, either version 3 of the License, or | ||
| 8 | #(at your option) any later version. | ||
| 9 | |||
| 10 | #This program is distributed in the hope that it will be useful, | ||
| 11 | #but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | #GNU General Public License for more details. | ||
| 14 | |||
| 15 | #You should have received a copy of the GNU General Public License | ||
| 16 | #along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | |||
| 18 | use strict; | ||
| 19 | use warnings; | ||
| 20 | use IO::CaptureOutput qw/capture_exec/; | ||
| 21 | |||
| 22 | my ($stdout, $stderr, $success, $exit_code) = capture_exec("task active"); | ||
| 23 | |||
| 24 | #print("out: $stdout\nerr: $stderr\nexit_code: $exit_code\n"); | ||
| 25 | |||
| 26 | if ($stderr =~ /No matches\./) { | ||
| 27 | system 'echo "What a beautiful day"'; | ||
| 28 | exit; | ||
| 29 | } | ||
| 30 | my $active_task_maybe = $stdout; | ||
| 31 | |||
| 32 | $active_task_maybe =~ s/^\s+|\s+$//g; | ||
| 33 | |||
| 34 | my @lines = split /\n/, $active_task_maybe; | ||
| 35 | |||
| 36 | my $task = $lines[2]; | ||
| 37 | $task =~ s/^\s+|\s+$//g; | ||
| 38 | $task =~ s/\s+/ /g; | ||
| 39 | |||
| 40 | if ($task =~ m/.*?next (.*)$/) { | ||
| 41 | print "$1"; | ||
| 42 | } | ||
diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh new file mode 100755 index 0000000..e6c42ff --- /dev/null +++ b/.config/polybar/launch.sh | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # Terminate already running bar instances | ||
| 4 | killall -q polybar | ||
| 5 | |||
| 6 | # Wait until the processes have been shut down | ||
| 7 | while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done | ||
| 8 | |||
| 9 | # Launch bar1 and bar2 | ||
| 10 | polybar top & | ||
| 11 | |||
| 12 | echo "Bars launched..." | ||
