diff --git a/bootstrap/packages.txt b/bootstrap/packages.txt index 97887e6..66c4e09 100644 --- a/bootstrap/packages.txt +++ b/bootstrap/packages.txt @@ -37,6 +37,7 @@ gnome-keyring go gopls grub +gsimplecal hugo i3-gaps i3blocks diff --git a/nvim/.config/nvim/spell/en.utf-8.add b/nvim/.config/nvim/spell/en.utf-8.add index 3ced7ae..ddb0308 100644 --- a/nvim/.config/nvim/spell/en.utf-8.add +++ b/nvim/.config/nvim/spell/en.utf-8.add @@ -100,3 +100,4 @@ flexicurity indices Anthropocene ecotourism +legitimation diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config index 5174185..b39d42e 100644 --- a/polybar/.config/polybar/config +++ b/polybar/.config/polybar/config @@ -56,9 +56,10 @@ height = 20 padding-left = 0 padding-right = 0 module-margin-left = 2 +module-margin-right = 2 modules-left = sxhkdmode workspaces pomo papersdue -modules-center = music date +modules-center = music datecal modules-right = dunstpaused networkspeed mail weather archupdates cpu temp volume battery ; do not use offsets for the bar, would only work with override-redirect ; and will mess up tray https://github.com/polybar/polybar/issues/1355 @@ -222,7 +223,15 @@ time = %H:%M ; the module will toggle between formats date-alt = %A, %d %B %Y (W %V) time-alt = %H:%M:%S -label = %date%%{T2} %{T-}%time% +label = %date%%{T2}  %{T-}%time% +format-underline = ${colors.primary} + +[module/datecal] +type = custom/script +exec = $XDG_CONFIG_HOME/polybar/scripts/poly-date +tail = true +click-left = gsimplecal +click-right = kill -USR1 %pid% format-underline = ${colors.primary} ; display information on currently playing track, allows simple track manipulation @@ -268,7 +277,7 @@ format-underline = ${colors.primary} [module/weather] type = custom/script -exec = $XDG_CONFIG_HOME/polybar/scripts/poly-weather '?format=%t+%C+(%p)' +exec = $XDG_CONFIG_HOME/polybar/scripts/poly-weather 'Copenhagen?m&format=%t+%C+(%p)' exec-if = type $XDG_CONFIG_HOME/polybar/scripts/poly-weather interval = 60.0 ; format-background = ${colors.primary} diff --git a/polybar/.config/polybar/scripts/poly-date b/polybar/.config/polybar/scripts/poly-date new file mode 100755 index 0000000..3af981d --- /dev/null +++ b/polybar/.config/polybar/scripts/poly-date @@ -0,0 +1,31 @@ +#!/usr/bin/env sh + +update_time=5 +mode=${1:-0} +separator='  ' +short_date_string='%d/%m'"${separator}"'%H:%M' +long_date_string='%A, %d %B %Y (CW %V)'"${separator}"'%H:%M:%S' + +modetoggle() { + mode=$(((mode + 1) % 2)) +} +trap "modetoggle" USR1 + +display_date() { + if [ "$1" = "long" ]; then + date +"${long_date_string}" + else + date +"${short_date_string}" + fi +} + +while true; do + if [ $mode -eq 0 ]; then + display_date short + elif [ $mode -eq 1 ]; then + display_date long + fi + + sleep $update_time & + wait +done diff --git a/polybar/.config/polybar/scripts/poly-weather b/polybar/.config/polybar/scripts/poly-weather index 9604207..99a5d41 100755 --- a/polybar/.config/polybar/scripts/poly-weather +++ b/polybar/.config/polybar/scripts/poly-weather @@ -1,9 +1,9 @@ #!/usr/bin/env sh wttr() { - # change Paris to your default location - request="wttr.in/${1-~Leipzig}" - curl -s -H "Accept-Language: ${LANG%_*}" --compressed "$request" + # change Paris to your default location + request="wttr.in/${1-~Leipzig}" + curl -s -H "Accept-Language: ${LANG%_*}" --compressed "${request}" } wttr "$@"