diff options
| author | srdusr <trevorgray@srdusr.com> | 2025-08-30 19:22:59 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2025-08-30 19:22:59 +0200 |
| commit | 19120d4f9761c67d99ed1ce3da6084b83f5a49c9 (patch) | |
| tree | f234cad1bdad88114a63c9702144da487024967a /.config/polybar/scripts/popup-calendar.sh | |
| parent | 5928998af5404ae2be84c6cecc10ebf84bd3f3ed (diff) | |
| download | dotfiles-19120d4f9761c67d99ed1ce3da6084b83f5a49c9.tar.gz dotfiles-19120d4f9761c67d99ed1ce3da6084b83f5a49c9.zip | |
Linux-specific dotfiles
Diffstat (limited to '.config/polybar/scripts/popup-calendar.sh')
| -rwxr-xr-x | .config/polybar/scripts/popup-calendar.sh | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/.config/polybar/scripts/popup-calendar.sh b/.config/polybar/scripts/popup-calendar.sh deleted file mode 100755 index 4e5303c..0000000 --- a/.config/polybar/scripts/popup-calendar.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/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, %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 |
