diff --git a/tree/.config/eww/eww.scss b/tree/.config/eww/eww.scss index a02642b..8c45b9d 100644 --- a/tree/.config/eww/eww.scss +++ b/tree/.config/eww/eww.scss @@ -57,19 +57,20 @@ window { } .thingy { - //border: solid $highlight1 2px; - //border-top: solid $highlight1 1px; - //border-bottom: solid $highlight2 3px; - //border-bottom: dotted $highlight1 6px; - //color: $highlight1; - //background: $lowlight1; - //border-radius: 30px; - padding-top: 0.5em; - padding-bottom: 0.5em; + padding-top: 8px; + padding-bottom: 8px; min-height: 20px; border-top: solid $highlight1 2px; } +.bigthingy { + padding-top: 8px; + padding-bottom: 8px; + min-height: 20px; + border-top: solid $highlight1 2px; + font-size: 35px; +} + scale trough { all: unset; background-color: #22242b; @@ -176,6 +177,9 @@ scale trough { margin-top: -8px; } +.color_scheme { +} + .pwrbtn { font-size: 35px; font-weight: 400; diff --git a/tree/.config/eww/eww.yuck b/tree/.config/eww/eww.yuck index b469ec1..9b79973 100644 --- a/tree/.config/eww/eww.yuck +++ b/tree/.config/eww/eww.yuck @@ -41,10 +41,11 @@ (temperature) (battery) (box :class "thingy" (systray :orientation "v")) + (color_scheme) (kb_layout) (date) (clock) - (pwr) + (lock) )) (defwidget workspaces [monitor] @@ -152,6 +153,19 @@ ;(label :text "${bat_charge}%") )) +(defwidget color_scheme [] + (button + :onclick { + color_scheme == "light" ? "set-color-scheme dark && ${EWW_CMD} update color_scheme=dark" + : "set-color-scheme light && ${EWW_CMD} update color_scheme=light" + } + :hexpand true + :class "bigthingy clickable" + (label :text { + color_scheme == "light" ? "" : "" + }) +)) + (defwidget kb_layout [] (button :onclick "niri msg action switch-layout next" :hexpand true @@ -178,10 +192,18 @@ (label :text current_minute) )) +(defwidget lock [] + (button :orientation "v" + :valign "end" + :class "bigthingy clickable" + :onclick "loginctl lock-session" + (label :text "󰩈") +)) + (defwidget pwr [] (button :orientation "v" :valign "end" - :class "thingy pwrbtn clickable" + :class "bigthingy clickable" :onclick "${EWW_CMD} open --toggle pwrctl" (label :text "⏻") )) @@ -216,3 +238,4 @@ (defpoll bat_charge :interval "15s" "cat /sys/class/power_supply/BAT0/capacity") (defpoll bat_status :interval "15s" "cat /sys/class/power_supply/BAT0/status") (defpoll current_temp :interval "5s" "cat /sys/class/thermal/thermal_zone*/temp") +(defpoll color_scheme :interval "5s" "get-color-scheme") diff --git a/tree/.local/bin/get-color-scheme.tpl b/tree/.local/bin/get-color-scheme.tpl new file mode 100755 index 0000000..19a05d4 --- /dev/null +++ b/tree/.local/bin/get-color-scheme.tpl @@ -0,0 +1,7 @@ +#!/bin/sh + +{% if light %} +echo light +{% else %} +echo dark +{% end %} diff --git a/tree/.local/bin/set-color-scheme b/tree/.local/bin/set-color-scheme new file mode 100755 index 0000000..53f053c --- /dev/null +++ b/tree/.local/bin/set-color-scheme @@ -0,0 +1,21 @@ +#!/bin/env fish + +switch $argv[1] + case 'light' + # configure terminal stuff with light theme + dotfiles light + + # change gtk theme + gsettings set org.gnome.desktop.interface color-scheme prefer-light + + case 'dark' + # configure terminal stuff with dark theme + dotfiles + + # change gtk theme + gsettings set org.gnome.desktop.interface color-scheme prefer-dark + + case '*' + echo "usage: set-color-scheme " + exit 1 +end