Add polybar

This commit is contained in:
Nicolas Duhamel 2018-05-09 17:54:48 +02:00
parent a12e8db471
commit 421cf595bf
2 changed files with 216 additions and 0 deletions
user/polybar/.config/polybar

@ -0,0 +1,186 @@
;=====================================================
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains alot of information
;
;=====================================================
[colors]
background = #383C4A
background-alt = #22242D
foreground = #D3DAE3
foreground-alt = #555
primary = #F0DFAF
secondary = #CC9393
alert = #CC9393
ok = #5294e2
[bar/laptop]
monitor = eDP1
monitor-strict = true
width = 100%
height = 45
radius = 0
fixed-center = true
background = ${colors.background}
foreground = ${colors.foreground}
underline-size = 4
underline-color = ${colors.background}
overline-size = 0
border-size = 0
border-bottom-size = 3
border-bottom-color = ${colors.background}
padding-left = 0
padding-right = 1
module-margin-left = 1
module-margin-right = 1
font-0 = Inconsolata Nerd Font:style=Medium:size=25:antialias=true;0
modules-left = i3 xwindow
modules-center =
modules-right = wlan volume xbacklight redshift battery date
tray-position = right
tray-padding = 2
tray-scale = 1
tray-transparent = false
enable-scroll = false
[module/xwindow]
type = internal/xwindow
label = %title:0:50:...%
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
enable-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
[module/xbacklight]
type = internal/xbacklight
format = <label>
label =  %percentage%%
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
[module/wlan]
type = internal/network
interface = wlp58s0
interval = 3.0
format-connected = <label-connected>
format-connected-underline = ${colors.ok}
label-connected =  %essid% (%signal%%)
format-disconnected = <label-disconnected>
format-disconnected-underline = ${colors.secondary}
label-disconnected =  %ifname% disconnected
label-disconnected-foreground = ${colors.foreground-alt}
[module/date]
type = internal/date
interval = 60
time = %H:%M
date = "%m/%d/%Y"
label = %time% %date%
[module/volume]
type = internal/pulseaudio
sink = alsa_output.pci-0000_00_1f.3.analog-stereo
format-volume = <label-volume>
label-volume =  %percentage%%
label-volume-foreground = ${root.foreground}
format-muted-foreground = ${colors.foreground-alt}
label-muted = 
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 98
time-format = %Hh%M
format-charging = <animation-charging> <label-charging>
format-charging-underline = ${colors.ok}
label-charging = %percentage%% %time%
format-full-prefix = ""
format-full-prefix-foreground = ${colors.ok}
format-full-underline = ${self.format-charging-underline}
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${colors.primary}
label-discharging = %percentage%% %time%
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.foreground}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-framerate = 1500
[module/redshift]
type = custom/script
exec = ~/.config/polybar/redshift.sh status
label = %output%
tail = true
interval = 5
click-left = ~/.config/polybar/redshift.sh toggle
; vim:ft=dosini

@ -0,0 +1,30 @@
#!/bin/sh
_help() {
echo "$0 [status|toggle]"
exit 1
}
_status() {
if systemctl --user is-active redshift >/dev/null; then
echo ""
return 0
else
echo "盛"
return 1
fi
}
_toggle() {
if _status >/dev/null; then
systemctl --user stop redshift
else
systemctl --user start redshift
fi
}
case "$1" in
status) _status ;;
toggle) _toggle ;;
*) _help ;;
esac