Compare commits

...

2 Commits

Author SHA1 Message Date
62c641e1fc swayidle: add sputnik config 2024-07-26 11:21:48 +02:00
dcbdc4203c eww: Fix errors and warnings 2024-07-26 11:21:24 +02:00
3 changed files with 25 additions and 18 deletions

View File

@ -70,7 +70,7 @@
(defwidget workspace [monitor n]
(button :visible {jq(workspaces, '.["${n}"] != null')}
:class 'workspace ${workspaces[n].active && monitor == workspaces[n].monitor ? "active" : ""}'
:class 'workspace ${workspaces?.[n]?.active == true && monitor == workspaces?.[n]?.monitor ? "active" : ""}'
:onclick 'wmutils switch-workspace ${n}'
(label :text n))
)
@ -140,15 +140,16 @@
(box :orientation "v"
:valign "end"
:class "thingy"
:visible {EWW_BATTERY != "" && EWW_BATTERY.BAT0.capacity != ""}
:visible {EWW_BATTERY != "" && EWW_BATTERY?.BAT0?.capacity != ""}
(label :text "BAT")
(circular-progress
:thickness 4.0
:value {EWW_BATTERY.BAT0.capacity}
:value {EWW_BATTERY != "" ? EWW_BATTERY?.BAT0?.capacity : 100.0}
:class {
EWW_BATTERY.BAT0.status == "Charging" ? "battery-gauge charging" :
EWW_BATTERY.BAT0.capacity < 15 ? "battery-gauge low" :
"battery-gauge"
EWW_BATTERY == "" ? "" :
EWW_BATTERY?.BAT0?.status == "Charging" ? "battery-gauge charging" :
EWW_BATTERY?.BAT0?.capacity < 15 ? "battery-gauge low" :
"battery-gauge"
}
)
))
@ -229,16 +230,14 @@
(defpoll workspaces :interval "1s" "wmutils workspaces")
(defpoll volume_out :interval "1s" "pamixer --get-volume")
(defpoll is_muted :interval "1s" "pamixer --get-mute")
(defpoll color_scheme :interval "5s" "get-color-scheme")
(defpoll is_muted :interval "1s" :initial false "pamixer --get-mute")
(defpoll current_minute :interval "1s" "date +%M")
(defpoll current_hour :interval "1s" "date +%H")
(defpoll current_day :interval "60s" "date +%d")
(defpoll current_month :interval "60s" "date +%b")
(defpoll current_temp :interval "5s" "cat /sys/class/thermal/thermal_zone*/temp")
(defpoll color_scheme :interval "5s" "get-color-scheme")
{% if disablemullvad %}
(defvar vpn_status "{'icon': '-', 'class': 'disconnected'}" )
{% else %}
(defpoll vpn_status :interval "1s" "mullvad-status")
{% end %}

View File

@ -1,6 +0,0 @@
lock '$HOME/.local/bin/screenlock'
timeout 530 'notify-send "Locking in 30s"'
before-sleep 'loginctl lock-session'
timeout 600 'loginctl lock-session'
timeout 610 'niri msg action power-off-monitors'

View File

@ -0,0 +1,14 @@
lock '$HOME/.local/bin/screenlock'
before-sleep 'loginctl lock-session'
{% if hostname == "buran" %}
timeout 530 'notify-send "Locking in 30s"'
timeout 600 'loginctl lock-session'
timeout 610 'niri msg action power-off-monitors'
{% end %}
{% if hostname == "sputnik" %}
timeout 5030 'notify-send "Locking in 30s"'
timeout 6000 'loginctl lock-session'
timeout 6010 'niri msg action power-off-monitors'
{% end %}