Commit 95c5b937 authored by peacerebel's avatar peacerebel
Browse files

Add polybar config

parent 98e56e41
;+++++++++++++++++++++++++++++
;
; Polybar configuration
;
;+++++++++++++++++++++++++++++
[colors]
background = #0b0b0b
foreground = #e92f2f
alert-bg = #dddd13
alert-fg = ${self.foreground}
background-alt = #1d1d1c
foreground-alt = #0ed839
primary = #23edda
secondary = #3b48e3
pink = #f996e2
lime = #26a98b
brown = #d26939
[global/wm]
margin-top = 0
margin-bottom = 0
[settings]
screenchange-reload = false
[bar/i3]
scroll-up = i3wm-wsnext
scroll-down = i3wm-wsprev
cursor-click = pointer
enable-ipc = true
bottom = true
dpi = 100
; wm-restack = i3
background = ${colors.background}
foreground = ${colors.foreground}
height = 20
width = 100%
radius = 1.0
fixed-center = false
line-size = 2
line-color = ${colors.foreground-alt}
padding = 0
module-margin = 1
font-0 = "Hack:style=Regular:antialias=true:size=9;1"
font-1 = "FontAwesome:style=Bold:size=10:antialias=true;2"
font-2 = "Font Awesome 5 Free:style=Bold:size=10:antialias=true;1"
tray-background = ${root.background}
tray-position = right
modules-left = i3
; modules-center = mpd
modules-right = backlight-acpi pulseaudio memory cpu temperature wlan battery calendar powermenu
[module/i3]
type = internal/i3
pin-workspaces = true
strip-wsnumbers = true
index-sort = true
fuzzy-match = true
label-mode = %mode%
label-mode-padding = 0
label-mode-foreground = ${colors.foreground}
label-mode-background = ${colors.background}
label-focused = %name%
label-focused-background = ${colors.background-alt}
label-focused-foreground = ${colors.foreground-alt}
label-focused-underline = ${colors.primary}
label-focused-padding = 1
label-unfocused = %name%
label-unfocused-padding = 1
label-urgent = %name%
label-urgent-background = ${colors.alert-bg}
label-urgent-foreground = ${colors.alert-fg}
label-urgent-padding = 1
enable-scroll = false
[module/backlight-acpi]
type = internal/backlight
card = intel_backlight
format-prefix =
format = <label>
label = %percentage%%
enable-scroll = false
; ramp-0 = 🌕
; ramp-1 = 🌔
; ramp-2 = 🌓
; ramp-3 = 🌒
; ramp-4 = 🌑
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <ramp-volume> <bar-volume>
label-volume-foreground = ${root.foreground}
ramp-volume-0 =
ramp-volume-1 =
ramp-volume-2 =
label-muted =
bar-volume-width = 10
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.foreground-alt}
[module/cpu]
type = internal/cpu
interval = 2
format-prefix-foreground = ${colors.foreground-alt}
format-underline = ${colors.lime}
label =  %percentage:2%%
[module/memory]
type = internal/memory
interval = 2
format-prefix-foreground = ${colors.foreground}
format-underline = ${colors.pink}
label = MEM %percentage_used%%
[module/wlan]
type = internal/network
interface = wlp2s0
interval = 3.0
format-connected = <label-connected>
format-connected-underline = #9f78e1
label-connected = %{F#f996e2}  %local_ip%%{F-} %{F#0ed839}  %downspeed%%{F-}  %upspeed%
label-connected-underline = ${colors.brown}
[module/calendar]
type = custom/script
exec = ~/.config/polybar/popup-calendar.sh
interval = 5
click-left = ~/polybar-scripts/polybar-scripts/popup-calendar/popup-calendar.sh --popup &
; [module/date]
; type = internal/date
; interval = 5
; date = "%Y-%m-%d"
; date-alt = " %Y-%m-%d"
; time = %H:%M
; time-alt = %H:%M:%S
; format-prefix-foreground = ${colors.foreground-alt}
; format-underline = #0a6cf5
; label = %{F#23edda} %date%%{F-} %{F#23edda} %time%%{F-}
[module/battery]
type = internal/battery
battery = BAT0
adapter = ADP0
full-at = 98
label-full = FULL
format-full-underline = ${colors.foreground-alt}
label-charging =  %percentage%%
format-charging-underline = ${colors.alert-bg}
format-discharging = <ramp-capacity> <label-discharging>
label-discharging = %percentage%%
format-discharging-underline = ${colors.foreground}
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-3 =
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open =
label-open-foreground = ${colors.foreground-alt}
label-close =  cancel
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 =  reboot
menu-0-0-exec = menu-open-1
menu-0-1 =  power off
menu-0-1-exec = menu-open-2
menu-1-0 =  reboot?
menu-1-0-exec = ~/.config/i3/i3exit.sh reboot
menu-2-0 =  power off?
menu-2-0-exec = ~/.config/i3/i3exit.sh shutdown
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
format-underline = ${colors.foreground-alt}
format-warn =  <label-warn>
format-warn-underline = ${colors.alert-bg}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.alert-fg}
ramp-0 =
ramp-1 =
ramp-2 =
ramp-foreground = ${colors.foreground}
#!/bin/sh
BAR_HEIGHT=22 # polybar height
BORDER_SIZE=1 # border size from your wm settings
YAD_WIDTH=222 # 222 is minimum possible value
YAD_HEIGHT=193 # 193 is minimum possible value
DATE="$(date +"%a %d, %b %Y %H:%M")"
case "$1" in
--popup)
if [ "$(xdotool getwindowfocus getwindowname)" = "yad-calendar" ]; then
exit 0
fi
eval "$(xdotool getmouselocation --shell)"
eval "$(xdotool getdisplaygeometry --shell)"
# X
if [ "$((X + YAD_WIDTH / 2 + BORDER_SIZE))" -gt "$WIDTH" ]; then #Right side
: $((pos_x = WIDTH - YAD_WIDTH - BORDER_SIZE))
elif [ "$((X - YAD_WIDTH / 2 - BORDER_SIZE))" -lt 0 ]; then #Left side
: $((pos_x = BORDER_SIZE))
else #Center
: $((pos_x = X - YAD_WIDTH / 2))
fi
# Y
if [ "$Y" -gt "$((HEIGHT / 2))" ]; then #Bottom
: $((pos_y = HEIGHT - YAD_HEIGHT - BAR_HEIGHT - BORDER_SIZE))
else #Top
: $((pos_y = BAR_HEIGHT + BORDER_SIZE))
fi
yad --calendar --undecorated --fixed --close-on-unfocus --no-buttons \
--width="$YAD_WIDTH" --height="$YAD_HEIGHT" --posx="$pos_x" --posy="$pos_y" \
--title="yad-calendar" --borders=0 >/dev/null &
;;
*)
echo "$DATE"
;;
esac
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment