diff --git a/eww/bars/horizontal-bspwm/eww.yuck b/eww/bars/horizontal-bspwm/eww.yuck index c8d5795..746368d 100644 --- a/eww/bars/horizontal-bspwm/eww.yuck +++ b/eww/bars/horizontal-bspwm/eww.yuck @@ -103,7 +103,6 @@ :space-evenly "false" (h-volume) (h-brightness) - (h-bat) (h-wifi) )) diff --git a/eww/bars/horizontal/eww.yuck b/eww/bars/horizontal/eww.yuck index a7dab4b..65dfcad 100644 --- a/eww/bars/horizontal/eww.yuck +++ b/eww/bars/horizontal/eww.yuck @@ -100,7 +100,6 @@ :space-evenly "false" (h-volume) (h-brightness) - (h-bat) (h-wifi) )) diff --git a/eww/cards.sh b/eww/cards.sh index dedda4b..210665f 100755 --- a/eww/cards.sh +++ b/eww/cards.sh @@ -3,7 +3,7 @@ # Opens all the eww cards EWW="eww-wayland" -CARD_NAMES=(np profile distro quickapps powermenu weather confirmation clock system sliders github youtube brightspace twitch calendar) +CARD_NAMES=(np profile distro quickapps powermenu weather confirmation clock system sliders github youtube brightspace twitch todoist wifi sysfetch) open() { for i in ${CARD_NAMES[*]}; @@ -18,8 +18,19 @@ close() { $EWW close $i done } +toggle() { + CURRENT_STATE=$($EWW state | grep cardsvisible) + if [[ $CURRENT_STATE == "cardsvisible: false" ]]; then + $EWW update cardsvisible=true + else + $EWW update cardsvisible=false + fi +} -close -if [[ $1 != "close" ]]; then - open +if [[ $1 == "open" ]]; then + open +elif [[ $1 == "close" ]]; then + close +elif [[ $1 == "toggle" ]]; then + toggle fi diff --git a/eww/cards/calendar/eww.yuck b/eww/cards/calendar/eww.yuck deleted file mode 100644 index 85f5a7d..0000000 --- a/eww/cards/calendar/eww.yuck +++ /dev/null @@ -1,14 +0,0 @@ -(defwindow calendar - :monitor 0 - :geometry (geometry :x "${320 + 11 * 6}px" - :y "${140 + 61 * 6}px" - :anchor "top left") - :stacking "bg" - :focusable false - :hexpand false - (box - :class "card" - :width {10 * 6} - :height {10 * 6} - ) - ) diff --git a/eww/cards/clock/eww.yuck b/eww/cards/clock/eww.yuck index ae53d34..4daf034 100644 --- a/eww/cards/clock/eww.yuck +++ b/eww/cards/clock/eww.yuck @@ -12,6 +12,7 @@ :hexpand false (box :class "card" + :visible {cardsvisible} :width {59 * 6} :height {25 * 6} (clock) diff --git a/eww/cards/confirmation/eww.yuck b/eww/cards/confirmation/eww.yuck index 9a10d09..e636b6c 100644 --- a/eww/cards/confirmation/eww.yuck +++ b/eww/cards/confirmation/eww.yuck @@ -11,6 +11,7 @@ (revealer :reveal {poweroperation != ""} + :visible {cardsvisible} :transition "slideleft" (box :class "popupl" diff --git a/eww/cards/distro/eww.yuck b/eww/cards/distro/eww.yuck index 6489e22..8c574f2 100644 --- a/eww/cards/distro/eww.yuck +++ b/eww/cards/distro/eww.yuck @@ -7,6 +7,7 @@ :focusable false :hexpand false (box + :visible {cardsvisible} :class "card" :width {10 * 6} :height {10 * 6} diff --git a/eww/cards/eww.css b/eww/cards/eww.css index 7e30682..36460b1 100644 --- a/eww/cards/eww.css +++ b/eww/cards/eww.css @@ -123,7 +123,7 @@ scale.songduration trough highlight { font-family: "Product Sans", sans-serif; color: #cdd6f4; font-style: italic; - font-size: 17px; + font-size: 16px; } .bigtime { font-family: "Jetbrains Mono NFM"; @@ -176,3 +176,39 @@ scale.system-slider trough { .v-slider scale trough highlight { background-color: #74c7ec; } +.task { + background-color: #313244; + padding: 4px; + border-radius: 6px; +} +.task .content { + font-size: 16px; +} +.complete-button { + border-radius: 30px; + border: 2px solid white; +} +.complete-button.priority-1 { + border-color: #a9a9a9; + background-color: #575757; +} +.complete-button.priority-2 { + border-color: #5297ff; + background-color: #345079; +} +.complete-button.priority-3 { + border-color: #ff9a13; + background-color: #79511b; +} +.complete-button.priority-4 { + border-color: #ff7066; + background-color: #79403c; +} + +.wifi.card { + font-size: 18px; + font-weight: bold; +} +.wifi.card .icon { + font-size: 28px; +} diff --git a/eww/cards/eww.yuck b/eww/cards/eww.yuck index 89f38c0..438b5d1 100644 --- a/eww/cards/eww.yuck +++ b/eww/cards/eww.yuck @@ -9,10 +9,14 @@ (include "cards/system/eww.yuck") (include "cards/sliders/eww.yuck") (include "cards/webshortcuts/eww.yuck") -(include "cards/calendar/eww.yuck") +(include "cards/todoist/eww.yuck") +(include "cards/sysfetch/eww.yuck") +(include "cards/wifi/eww.yuck") (include "cards/frame.yuck") +(defvar cardsvisible true) + ; Each card is an element that shows up on the bottom of the desktop ; The full dashboard is scaled to be around 1280x720, centered on the screen ; All cards are built in units of 6px, so the spacing remains even in between them diff --git a/eww/cards/np/eww.yuck b/eww/cards/np/eww.yuck index a56c701..014db81 100644 --- a/eww/cards/np/eww.yuck +++ b/eww/cards/np/eww.yuck @@ -9,6 +9,7 @@ (box :width {92 * 6} :height {25 * 6} + :visible {cardsvisible} :valign "center" :hexpand false :space-evenly false @@ -70,7 +71,7 @@ :halign "start" :hexpand false :orientation "v" - (label :limit-width 50 :xalign 0 :class "title" :text {title}) + (label :limit-width 48 :xalign 0 :class "title" :text {title}) (label :xalign 0 :class "artist" :text {artist}) ) ) diff --git a/eww/cards/powermenu/eww.yuck b/eww/cards/powermenu/eww.yuck index 3c90350..558874d 100644 --- a/eww/cards/powermenu/eww.yuck +++ b/eww/cards/powermenu/eww.yuck @@ -9,6 +9,7 @@ (box :class "card" :orientation "v" + :visible {cardsvisible} :width {10 * 6} :height {29 * 6} (button :onclick "${EWW_CMD} update poweroperation=poweroff" (label :class "poweroff" :text "󰤆")) diff --git a/eww/cards/profile/eww.yuck b/eww/cards/profile/eww.yuck index 6204c13..648617b 100644 --- a/eww/cards/profile/eww.yuck +++ b/eww/cards/profile/eww.yuck @@ -9,6 +9,7 @@ (box :class "card" :space-evenly false + :visible {cardsvisible} :spacing 10 :width {50 * 6} :height {60 * 6} diff --git a/eww/cards/quickapps/eww.yuck b/eww/cards/quickapps/eww.yuck index de91f64..fba78d4 100644 --- a/eww/cards/quickapps/eww.yuck +++ b/eww/cards/quickapps/eww.yuck @@ -8,6 +8,7 @@ :hexpand false (box :class "card" + :visible {cardsvisible} :width {10 * 6} :orientation "v" :height {79 * 6} diff --git a/eww/cards/sliders/eww.yuck b/eww/cards/sliders/eww.yuck index af0a47e..ecbc700 100644 --- a/eww/cards/sliders/eww.yuck +++ b/eww/cards/sliders/eww.yuck @@ -8,6 +8,7 @@ :hexpand false (box :class "card" + :visible {cardsvisible} :width {34 * 6} :height {46 * 6} (box diff --git a/eww/cards/sysfetch/eww.yuck b/eww/cards/sysfetch/eww.yuck new file mode 100644 index 0000000..abe80ba --- /dev/null +++ b/eww/cards/sysfetch/eww.yuck @@ -0,0 +1,16 @@ +(defwindow sysfetch + :monitor 0 + :geometry (geometry :x "${320 + 84 * 6}px" + :y "${140 + 73 * 6}px" + :anchor "top left") + :stacking "bg" + :focusable false + :hexpand false + (box + :class "card" + :width {82 * 6} + :visible {cardsvisible} + :height {47 * 6} + (empty) + ) + ) diff --git a/eww/cards/system/eww.yuck b/eww/cards/system/eww.yuck index accb5eb..64260fe 100644 --- a/eww/cards/system/eww.yuck +++ b/eww/cards/system/eww.yuck @@ -13,6 +13,7 @@ :hexpand false (box :class "card" + :visible {cardsvisible} :width {46 * 6} :height {46 * 6} (box diff --git a/eww/cards/todoist/eww.yuck b/eww/cards/todoist/eww.yuck new file mode 100644 index 0000000..90e730e --- /dev/null +++ b/eww/cards/todoist/eww.yuck @@ -0,0 +1,73 @@ +(defpoll tasks :interval "30s" "scripts/todoist.sh list") + +(defwindow todoist + :monitor 0 + :geometry (geometry :x "${320 + 11 * 6}px" + :y "${140 + 61 * 6}px" + :anchor "top left") + :stacking "bg" + :focusable false + :hexpand false + (box + :class "card" + :width {70 * 6} + :height {59 * 6} + :space-evenly false + :visible {cardsvisible} + :spacing 12 + :orientation "v" + (label :text "Todo" ) + (scroll + :width {68 * 6} + :height {50 * 6} + :vscroll true + (box + :orientation "v" + :space-evenly false + :spacing 10 + (for taskdata in tasks + (task :data taskdata) + ) + ) + ) + ) + ) + +(defwidget task [data] + (box + :class "task" + :width {50 * 6} + :height {7 * 6} + :space-evenly false + :spacing 6 + (transform + :translate-y "6px" + (box + :width {3 * 6} + :space-evenly false + :orientation "v" + (eventbox + :cursor "pointer" + :height {3 * 6} + :width {3 * 6} + :class "complete-button priority-${data.priority}" + (empty)) + ) + ) + (box + :halign "start" + :orientation "v" + (eventbox + :cursor "pointer" + :onclick "librewolf ${data.url}" + (label :class "content" :limit-width 45 :text {data.content}) + ) + (centerbox + :class "due" + (label :text {data.due.string}) + (empty) + (empty) + ) + ) + ) + ) diff --git a/eww/cards/weather/eww.yuck b/eww/cards/weather/eww.yuck index 91d3884..bf84859 100644 --- a/eww/cards/weather/eww.yuck +++ b/eww/cards/weather/eww.yuck @@ -16,6 +16,7 @@ (box :class "card" :width {70 * 6} + :visible {cardsvisible} :height {34 * 6} :orientation "v" :valign "end" diff --git a/eww/cards/webshortcuts/eww.yuck b/eww/cards/webshortcuts/eww.yuck index 8a73462..67a5a24 100644 --- a/eww/cards/webshortcuts/eww.yuck +++ b/eww/cards/webshortcuts/eww.yuck @@ -44,14 +44,18 @@ ) (defwidget webshortcut [icon color link] - (box - :class "card weblink" - :width {23 * 6} - :style "background-color: ${color}" - :height {23 * 6} - (button - :onclick "$BROWSER ${link}" - (label :class "icon" :text icon) + (eventbox + :cursor "pointer" + :visible {cardsvisible} + (box + :class "card weblink" + :width {23 * 6} + :style "background-color: ${color}" + :height {23 * 6} + (button + :onclick "$BROWSER ${link}" + (label :class "icon" :text icon) + ) ) ) ) diff --git a/eww/cards/wifi/eww.yuck b/eww/cards/wifi/eww.yuck new file mode 100644 index 0000000..bd4c0ce --- /dev/null +++ b/eww/cards/wifi/eww.yuck @@ -0,0 +1,21 @@ +(defwindow wifi + :monitor 0 + :geometry (geometry :x "${320 + 84 * 6}px" + :y "${140 + 61 * 6}px" + :anchor "top left") + :stacking "bg" + :focusable false + :hexpand false + (box + :class "wifi card" + :space-evenly false + :halign "center" + :valign "center" + :spacing 10 + :width {48 * 6} + :visible {cardsvisible} + :height {11 * 6} + (label :text {wifi-icon} :class "icon" ) + (label :text {wifi-name}) + ) + ) diff --git a/eww/scripts/todoist.sh b/eww/scripts/todoist.sh new file mode 100755 index 0000000..1a6d007 --- /dev/null +++ b/eww/scripts/todoist.sh @@ -0,0 +1,40 @@ +# /bin/bash +# +# author: clxxiii +# +# TODOIST.SH + +FILTER="!no date" +KEYFILE="$HOME/.todoist_token" + +## Get Key +if [[ ! -e $KEYFILE ]]; then + echo "Key not found! Make a file at the keyfile's directory (default ~/.todoist_token) that contains your todoist API token" + exit 1 +else + KEY="$(cat $KEYFILE)" +fi +BASE_URL="https://api.todoist.com/rest/v2" + +url_encode() { + jq -Rr @uri <<< "$@" +} + +list() { + curl -X GET \ + "$BASE_URL/tasks?filter=$(url_encode $FILTER)" \ + -H "Authorization: Bearer $KEY" +} + +mark_complete () { + echo $1 +} + + +if [[ $1 == "list" ]]; then + list +elif [[ $1 == "mark_complete" ]]; then + mark_complete $2 +fi + + diff --git a/eww/scripts/weather.sh b/eww/scripts/weather.sh index 7aa9139..8cfdf56 100755 --- a/eww/scripts/weather.sh +++ b/eww/scripts/weather.sh @@ -78,27 +78,27 @@ get_weather_data() { weather_quote="It's a cloudy night \nHow about some hot chocolate and a warm bed?" weather_hex="#adadff" elif [ "$weather_icon_code" == "09d" ]; then - weather_icon=" " + weather_icon=" " weather_quote="It's rainy, it's a great day! \nGet some ramen and watch as the rain falls..." weather_hex="#6b95ff" elif [ "$weather_icon_code" == "09n" ]; then - weather_icon=" " + weather_icon=" " weather_quote=" It's gonna rain tonight it seems \nMake sure your clothes aren't still outside..." weather_hex="#6b95ff" elif [ "$weather_icon_code" == "10d" ]; then - weather_icon=" " + weather_icon=" " weather_quote="It's rainy, it's a great day! \nGet some ramen and watch as the rain falls..." weather_hex="#6b95ff" elif [ "$weather_icon_code" == "10n" ]; then - weather_icon=" " + weather_icon=" " weather_quote=" It's gonna rain tonight it seems \nMake sure your clothes aren't still outside..." weather_hex="#6b95ff" elif [ "$weather_icon_code" == "11d" ]; then - weather_icon="" + weather_icon="󰖓 " weather_quote="There's storm for forecast today \nMake sure you don't get blown away..." weather_hex="#ffeb57" elif [ "$weather_icon_code" == "11n" ]; then - weather_icon="" + weather_icon=" " weather_quote="There's gonna be storms tonight \nMake sure you're warm in bed and the windows are shut..." weather_hex="#ffeb57" elif [ "$weather_icon_code" == "13d" ]; then diff --git a/eww/scripts/wifi.sh b/eww/scripts/wifi.sh index 78a7b9c..838fce4 100755 --- a/eww/scripts/wifi.sh +++ b/eww/scripts/wifi.sh @@ -6,7 +6,7 @@ echo  } name() { -nmcli | grep "^wlan0" | sed 's/\ connected\ to\ /Connected to /g' | cut -d ':' -f2 +nmcli | grep "^wlan0" | sed 's/\ connected\ to\ //g' | cut -d ':' -f2 } [ "$1" = "icon" ] && symbol && exit diff --git a/i3/config b/i3/config index d769c00..0ae6349 100644 --- a/i3/config +++ b/i3/config @@ -228,6 +228,8 @@ bindsym $mod+Shift+0 move container to workspace number $ws10 bindsym $mod+Shift+c reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym $mod+Shift+r restart +# Dashboard toggler +bindsym $mod+Shift+d exec "~/.config/eww/cards.sh toggle" # exit i3 (logs you out of your X session) # bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"