Init
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
[colors]
|
||||
; Colors from https://github.com/rebelot/kanagawa.nvim
|
||||
background = #1F1F28
|
||||
foreground = #DCD7BA
|
||||
foreground-alt = #C8C093
|
||||
module-fg = #DCD7BA
|
||||
primary = #7E9CD8
|
||||
secondary = #7AA89F
|
||||
alert = #E82424
|
||||
disabled = #727169
|
||||
green = #98BB6C
|
||||
yellow = #FF9E3B
|
||||
red = #E46876
|
||||
blue = #7FB4CA
|
||||
|
||||
[bar/main]
|
||||
monitor = ${env:MONITOR:}
|
||||
width = calc(100% - 10px)
|
||||
height = 25
|
||||
bottom = true
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
line-size = 2
|
||||
padding = 2
|
||||
module-margin = 1
|
||||
font-0 = sans:size=14;2
|
||||
font-1 = FontAwesome:size=12;2
|
||||
separator = |
|
||||
tray-position = right
|
||||
modules-left = i3
|
||||
modules-center = date
|
||||
modules-right = pulseaudio network memory filesystem tray
|
||||
|
||||
[module/i3]
|
||||
type = internal/i3
|
||||
pin-workspaces = true
|
||||
strip-ws-numbers = true
|
||||
label-focused = %name%
|
||||
label-focused-foreground = ${colors.primary}
|
||||
label-focused-background = ${colors.background}
|
||||
label-focused-padding = 1
|
||||
label-unfocused = %name%
|
||||
label-unfocused-foreground = ${colors.disabled}
|
||||
label-unfocused-padding = 1
|
||||
label-visible = %name%
|
||||
label-visible-foreground = ${colors.foreground-alt}
|
||||
label-visible-padding = 1
|
||||
label-urgent = %name%
|
||||
label-urgent-foreground = ${colors.alert}
|
||||
label-urgent-padding = 1
|
||||
|
||||
[module/date]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/scripts/calendar.sh
|
||||
interval = 1
|
||||
label-foreground = ${colors.foreground}
|
||||
click-left = ~/.config/polybar/scripts/calendar.sh --popup
|
||||
|
||||
[module/pulseaudio]
|
||||
type = internal/pulseaudio
|
||||
format-volume = <ramp-volume> <label-volume>
|
||||
label-volume = Vol: %percentage%%
|
||||
ramp-volume-0 =
|
||||
ramp-volume-1 =
|
||||
ramp-volume-2 =
|
||||
label-muted = muted
|
||||
label-muted-foreground = ${colors.disabled}
|
||||
click-right = pavucontrol
|
||||
scroll-up = pactl set-sink-volume @DEFAULT_SINK@ +2%
|
||||
scroll-down = pactl set-sink-volume @DEFAULT_SINK@ -2%
|
||||
|
||||
[module/network]
|
||||
type = internal/network
|
||||
interface = wlp3s0 ; Replace with your network interface (use ip link to check, e.g., wlan0 or enp0s3)
|
||||
interval = 3
|
||||
format-connected = <label-connected>
|
||||
label-connected = %essid% ↓%downspeed% ↑%upspeed%
|
||||
label-connected-foreground = ${colors.green}
|
||||
format-disconnected = <label-disconnected>
|
||||
label-disconnected = disconnected
|
||||
label-disconnected-foreground = ${colors.alert}
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
interval = 2
|
||||
format = <label>
|
||||
label = RAM: %used% / %total% (%percentage_used%%)
|
||||
label-foreground = ${colors.yellow}
|
||||
|
||||
[module/filesystem]
|
||||
type = internal/fs
|
||||
mount-0 = /
|
||||
interval = 5
|
||||
format-mounted = <label-mounted>
|
||||
label-mounted = Disk: %used% / %total% (%percentage_used%%)
|
||||
label-mounted-foreground = ${colors.blue}
|
||||
|
||||
[module/tray]
|
||||
type = internal/tray
|
||||
tray-spacing = 2px
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
pkill polybar
|
||||
|
||||
# Wait until all polybar processes are fully gone
|
||||
while pgrep -u "$UID" -x polybar >/dev/null; do
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
sleep 0.2
|
||||
|
||||
# Launch one instance per connected monitor
|
||||
if type "xrandr" > /dev/null; then
|
||||
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||
MONITOR="$m" polybar --reload main &
|
||||
done
|
||||
else
|
||||
polybar --reload main &
|
||||
fi
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/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 %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
|
||||
Reference in New Issue
Block a user