feat: add date widget

This commit is contained in:
matt1432 2023-05-29 15:59:55 -04:00
parent ed88184a04
commit 99464bed6e
6 changed files with 21 additions and 12 deletions

View file

@ -1,8 +1,7 @@
.actions { .actions {
background-color: $bg; background-color: $bg;
color: $fg; color: $fg;
//font-family: Product Sans; font-family: Product Sans;
font-family: Ubuntu Mono;
border-radius: 30px; border-radius: 30px;
border: 5px solid $contrastbg; border: 5px solid $contrastbg;
padding: 10px 18px; padding: 10px 18px;
@ -10,7 +9,7 @@
.controlsbox { .controlsbox {
background-color: $contrastbg; background-color: $contrastbg;
border-radius: 7px; border-radius: 15px;
padding: 7px 12px; padding: 7px 12px;
.vol-slider { .vol-slider {
@ -81,8 +80,7 @@
font-size: 14px; font-size: 14px;
} }
.username { .username {
//font-family: Product Sans; font-family: Product Sans;
font-family: Ubuntu Mono;
} }
.useractions { .useractions {
.logout { .logout {

View file

@ -1,7 +1,8 @@
.date { .date {
background-color: $bg; background-color: $bg;
color: $fg; color: $fg;
border-radius: 4px; border-radius: 30px;
border: 5px solid $contrastbg;
} }
.timebox { .timebox {
@ -68,4 +69,4 @@ calendar.highlight {
calendar:indeterminate { calendar:indeterminate {
color: $lightblack; color: $lightblack;
} }

View file

@ -48,10 +48,10 @@
(defwindow date (defwindow date
:monitor 0 :monitor 0
:geometry (geometry :x "6px" :geometry (geometry :x "70px"
:y "-44px" :y "4px"
:width "0px" ; automatically generated :width "0px" ; automatically generated
:height "0px" ; automatically generated :height "0px" ; automatically generated
:anchor "left bottom") :anchor "top right")
:wm-ignore true :wm-ignore true
(date)) (date))

View file

@ -23,8 +23,9 @@
"spacing": 5 "spacing": 5
}, },
"clock": { "clock": {
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>", "on-click": "$HOME/.config/waybar/scripts/date-toggle.sh",
"format-alt": "{:%Y-%m-%d}" //"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
//"format-alt": "{:%Y-%m-%d}"
}, },
"cpu": { "cpu": {
"format": "{usage}% ", "format": "{usage}% ",

8
waybar/scripts/date-toggle.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
if [[ $(eww state | grep calendar_month) ]]; then
eww close date && eww close closer
else
eww close-all
eww open date && eww open closer
fi

View file

@ -3,5 +3,6 @@
if [[ $(eww state | grep br_icon) ]]; then if [[ $(eww state | grep br_icon) ]]; then
eww close actions && eww close closer eww close actions && eww close closer
else else
eww close-all
eww open actions && eww open closer eww open actions && eww open closer
fi fi