This commit is contained in:
Marco Thomas
2020-11-05 14:15:57 +01:00
parent ad6bae8f41
commit 3c4e3caaba
6 changed files with 19 additions and 77 deletions

View File

@@ -30,13 +30,13 @@ separator =
modules-left = i3 xwindow
modules-center = spotify
modules-right = network volume backlight battery calendar
modules-right = network volume backlight battery date
tray-position = right
tray-padding = 1
foreground = ${colors.foreground}
background = ${colors.background}
background-0 = ${colors.background}
line-size = 2
@@ -46,13 +46,13 @@ wm-restack = i3
[bar/desktop]
inherit = bar/laptop
modules-right = update_yay volume calendar
modules-right = update_yay volume date
[bar/desktop_second]
inherit = bar/desktop
tray-position = none
modules-right = volume calendar
modules-right = volume date
############################## MODULES
[module/i3]
@@ -105,16 +105,6 @@ format-prefix = " "
format-prefix-foreground = ${colors.accent-alt}
format-underline = ${colors.accent}
[module/calendar]
type = custom/script
exec = ~/.config/polybar/scripts/popup-calendar.sh
interval = 5
click-left = ~/.config/polybar/scripts/popup-calendar.sh --popup &
format-prefix = " "
format-prefix-foreground = ${colors.accent-alt}
format-underline = ${colors.accent}
[module/backlight]
type = internal/backlight
#ls -1 /sys/class/backlight

View File

@@ -1,41 +0,0 @@
#!/bin/sh
BAR_HEIGHT=27 # polybar height
BORDER_SIZE=10 # 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

View File

@@ -1,6 +1,6 @@
#!/bin/sh
if ! updates=$(yay -Qum 2> /dev/null | wc -l); then
if ! updates=$(yay -Qu 2> /dev/null | wc -l); then
updates=0
fi