commit
Add a few other things in
diff --git a/.gitignore b/.gitignore
index 9007487..9bf24ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,9 @@
# --- Scripts (linked into ~/.local/bin by install-scripts.sh) ---
!/binaries/
+# --- Login theme (installed to /usr/share/sddm/themes by install-assets.sh) ---
+!/sddm/
+
# --- Cursor theme (linked into ~/.icons by install-assets.sh) ---
!/icons/
diff --git a/README.md b/README.md
index 391f52d..9d1d9ff 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,7 @@ A swayfx desktop with a "Clockwork" theme pulled from the wallpaper: deep-space
- **waybar** (status bar)
- **kitty** (terminal) with an **oh-my-posh** prompt
- **fuzzel** (app launcher), **mako** (notifications), **gtklock** (lock screen)
+- An optional **SDDM** login screen to match
- The **sandrone-linux** cursor (my own)
## Install
@@ -34,6 +35,18 @@ The installer runs four scripts, and you can run any of them on its own:
| `install-config.sh` | Links the configs into `~/.config` |
| `install-scripts.sh` | Links the helper scripts into `~/.local/bin` |
+### Login screen (optional)
+
+The Clockwork SDDM theme has its own script and works without the rest of the dots:
+
+```sh
+./install-sddm.sh # install and make it the login screen
+./install-sddm.sh --no-video # still wallpaper instead of the animated one
+./install-sddm.sh --uninstall # remove it and restore your old sddm.conf
+```
+
+Or add `--with-sddm` to `./install` to get everything at once.
+
Anything already in the way is renamed to `.bak-<date>`, never deleted.
## Bar controls
@@ -41,12 +54,105 @@ Anything already in the way is renamed to `.bak-<date>`, never deleted.
| Module | Left click | Middle click | Right click |
|---|---|---|---|
| Battery | Power saver on/off | Pick a power profile | Performance on/off |
+| Clock | Show this month's calendar (click again to close) | | |
| Brightness | Toggle 15% / 100% | | |
| Network | Wi-Fi on/off | | Open nmtui |
| Bluetooth | Bluetooth on/off | Open bluetui | |
| Volume | Mute | Open pavucontrol | |
| CPU / RAM | Open btop | | |
-| Picture icon (next to the logo) | Still / animated wallpaper | | |
+| Picture icon (next to the logo) | Still / animated wallpaper (only plays when plugged in and not in power saver) | | |
+| Coffee cup | Stay awake (no auto-lock) | | |
+| Moon | Night light (warm screen) | | |
+| Bell | Notification list (pick one to see it again) | | Do not disturb |
+| Package (shows when updates are waiting) | Run the update | | |
+| REC (shows while recording) | Stop recording | | |
+
+## Keybindings
+
+Press **Super+/** to search every shortcut (picking one runs it). The full list:
+
+<details>
+<summary>Show all shortcuts</summary>
+
+| Keys | Action |
+|---|---|
+| `Super+Return` | `kitty` |
+| `Ctrl+Alt+t` | `kitty` |
+| `Super+q` | `kill` |
+| `Super+space` | `fuzzel` |
+| `Super+f` | `firefox` |
+| `Super+b` | `pkill -SIGUSR1 waybar` |
+| `Super+e` | `kitty -e yazi` |
+| `Super+Alt+l` | `~/.local/bin/lock-screen` |
+| `Super+n` | `makoctl restore` |
+| `Super+v` | `cliphist list \| fuzzel --dmenu --prompt "clip " \| cliphist decode \|...` |
+| `Super+Shift+v` | `cliphist wipe` |
+| `Super+slash` | `~/.local/bin/keybinds` |
+| `Super+Shift+r` | `reload` |
+| `Super+Shift+e` | `swaynag -t warning -m 'You pressed the exit shortcut. Do you really...` |
+| `Ctrl+Alt+Delete` | `~/.local/bin/powermenu` |
+| `Super+Left` | `focus left` |
+| `Super+Down` | `focus down` |
+| `Super+Up` | `focus up` |
+| `Super+Right` | `focus right` |
+| `Super+Shift+Left` | `move left` |
+| `Super+Shift+Down` | `move down` |
+| `Super+Shift+Up` | `move up` |
+| `Super+Shift+Right` | `move right` |
+| `Super+1` | `workspace number 1` |
+| `Super+2` | `workspace number 2` |
+| `Super+3` | `workspace number 3` |
+| `Super+4` | `workspace number 4` |
+| `Super+5` | `workspace number 5` |
+| `Super+6` | `workspace number 6` |
+| `Super+7` | `workspace number 7` |
+| `Super+8` | `workspace number 8` |
+| `Super+9` | `workspace number 9` |
+| `Super+Alt+1` | `move container to workspace number 1` |
+| `Super+Alt+2` | `move container to workspace number 2` |
+| `Super+Alt+3` | `move container to workspace number 3` |
+| `Super+Alt+4` | `move container to workspace number 4` |
+| `Super+Alt+5` | `move container to workspace number 5` |
+| `Super+Alt+6` | `move container to workspace number 6` |
+| `Super+Alt+7` | `move container to workspace number 7` |
+| `Super+Alt+8` | `move container to workspace number 8` |
+| `Super+Alt+9` | `move container to workspace number 9` |
+| `Super+Ctrl+Left` | `workspace prev_on_output` |
+| `Super+Ctrl+Right` | `workspace next_on_output` |
+| `Super+w` | `floating toggle` |
+| `Super+Shift+minus` | `move scratchpad` |
+| `Super+minus` | `scratchpad show` |
+| `resize: Left` | `resize shrink width 10px` |
+| `resize: Down` | `resize grow height 10px` |
+| `resize: Up` | `resize shrink height 10px` |
+| `resize: Right` | `resize grow width 10px` |
+| `resize: Return` | `mode "default"` |
+| `resize: Escape` | `mode "default"` |
+| `Super+r` | `mode "resize"` |
+| `XF86AudioRaiseVolume` | `wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+ -l 1.5` |
+| `XF86AudioLowerVolume` | `wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05- -l 1.0` |
+| `XF86AudioMute` | `wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle` |
+| `XF86AudioMicMute` | `wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle` |
+| `Shift+XF86AudioRaiseVolume` | `wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.01+ -l 1.5` |
+| `Shift+XF86AudioLowerVolume` | `wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.01- -l 1.0` |
+| `XF86MonBrightnessUp` | `brightnessctl -q s 5%+` |
+| `XF86MonBrightnessDown` | `brightnessctl -q s 5%-` |
+| `Super+o` | `brightnessctl --device='tpacpi::kbd_backlight' set 1-` |
+| `Super+p` | `brightnessctl --device='tpacpi::kbd_backlight' set +1` |
+| `Print` | `~/.local/bin/screenshot -c` |
+| `Ctrl+Shift+Print` | `~/.local/bin/screenshot -s -c` |
+| `Ctrl+Print` | `~/.local/bin/screenshot` |
+| `Shift+Print` | `~/.local/bin/screenshot -s` |
+| `Ctrl+Alt+Print` | `~/.local/bin/screenshot -r` |
+| `Super+a` | `playerctl previous` |
+| `Super+d` | `playerctl next` |
+| `Super+s` | `playerctl play-pause` |
+| `Super+z` | `flatpak run org.equicord.equibop` |
+| `Super+c` | `flatpak run com.vscodium.codium` |
+
+Regenerate with `binaries/keybinds --markdown`.
+
+</details>
## Tested on
diff --git a/binaries/calendar b/binaries/calendar
new file mode 100755
index 0000000..28dc0cd
--- /dev/null
+++ b/binaries/calendar
@@ -0,0 +1,33 @@
+#!/bin/sh
+# calendar: show this month as a notification (the waybar clock's click).
+# Click the clock again to close it. Colors match the Clockwork palette:
+# month cyan, weekdays gold, today red.
+ID_FILE="${XDG_RUNTIME_DIR:-/tmp}/waybar-calendar.id"
+
+# Second click closes the open calendar
+if [ -f "$ID_FILE" ] && makoctl list -j 2>/dev/null | grep -q "\"id\": *$(cat "$ID_FILE")\b"; then
+ makoctl dismiss -n "$(cat "$ID_FILE")"
+ rm -f "$ID_FILE"
+ exit 0
+fi
+
+today=$(date +%-d)
+body=$(cal | awk -v t="$today" '
+ NR == 1 { next } # month title is added below
+ NR == 2 { printf "<span color=\"#D4B072\"><b>%s</b></span>\n", $0; next }
+ NF == 0 { next }
+ {
+ out = ""
+ for (i = 1; i <= length($0); i += 3) { # cal uses 3-char columns
+ cell = substr($0, i, 3); d = cell; gsub(/ /, "", d)
+ if (d == t) { k = index(cell, d)
+ cell = substr(cell, 1, k - 1) "<span color=\"#E0485C\"><b><u>" d "</u></b></span>" substr(cell, k + length(d)) }
+ out = out cell
+ }
+ sub(/ +$/, "", out); print out
+ }')
+
+title="<span color=\"#5FD4F0\"><b>$(date '+%B %Y')</b></span>"
+id=$(notify-send -p -t 15000 -a calendar "Calendar" "$title
+$body")
+echo "$id" > "$ID_FILE"
diff --git a/binaries/dnd b/binaries/dnd
new file mode 100755
index 0000000..1836865
--- /dev/null
+++ b/binaries/dnd
@@ -0,0 +1,18 @@
+#!/bin/sh
+# dnd: mako do-not-disturb for the waybar bell.
+# dnd toggle turn do-not-disturb on/off
+# dnd status JSON for waybar (count = notifications waiting while muted)
+# When it's turned off, the waiting notifications pop up again.
+case ${1:-status} in
+ toggle)
+ makoctl mode -t do-not-disturb >/dev/null
+ pkill -RTMIN+10 -x waybar ;;
+ status)
+ if makoctl mode | grep -qx do-not-disturb; then
+ n=$(makoctl list -j 2>/dev/null | jq 'length' 2>/dev/null || echo 0)
+ [ "$n" -gt 0 ] 2>/dev/null && txt="\\udb80\\udc9b $n" || txt="\\udb80\\udc9b"
+ printf '{"text":"%s","tooltip":"Do not disturb is on (%s waiting)\\nClick: notifications · Right-click: turn off","class":"on"}\n' "$txt" "${n:-0}"
+ else
+ printf '{"text":"\\udb80\\udc9a","tooltip":"Notifications on\\nClick: notifications · Right-click: do not disturb","class":"off"}\n'
+ fi ;;
+esac
diff --git a/binaries/keybinds b/binaries/keybinds
new file mode 100755
index 0000000..3fa59e5
--- /dev/null
+++ b/binaries/keybinds
@@ -0,0 +1,51 @@
+#!/bin/sh
+# keybinds: every sway shortcut, read live from ~/.config/sway/config.
+# keybinds show them in fuzzel; picking one runs it
+# keybinds --markdown print a Markdown table (for the README)
+# keybinds --list print plain "keys action" lines
+
+CONF="${XDG_CONFIG_HOME:-$HOME/.config}/sway/config"
+
+parse() {
+ awk '
+ function trim(s) { sub(/^[ \t]+/, "", s); sub(/[ \t]+$/, "", s); return s }
+ /^[ \t]*set[ \t]+\$/ {
+ name = $2; val = $0; sub(/^[ \t]*set[ \t]+\$[^ \t]+[ \t]+/, "", val)
+ vars[name] = val; order[++nv] = name; next
+ }
+ /^[ \t]*mode[ \t]+"/ { m = $0; sub(/^[^"]*"/, "", m); sub(/".*/, "", m); mode = m; next }
+ /^[ \t]*}/ { mode = ""; next }
+ /^[ \t]*bindsym[ \t]/ {
+ line = trim($0); sub(/^bindsym[ \t]+/, "", line)
+ while (line ~ /^--[a-z-]+[ \t]/) sub(/^--[a-z-]+[ \t]+/, "", line)
+ key = line; sub(/[ \t].*/, "", key)
+ cmd = line; sub(/^[^ \t]+[ \t]+/, "", cmd)
+ for (pass = 0; pass < 4; pass++) # resolve nested $vars,
+ for (len = 40; len > 0; len--) # longest names first
+ for (i = 1; i <= nv; i++) if (length(order[i]) == len) {
+ pat = order[i]; gsub(/\$/, "\\$", pat); gsub(pat, vars[order[i]], cmd)
+ }
+ for (i = 1; i <= nv; i++) { pat = order[i]; gsub(/\$/, "\\$", pat); gsub(pat, vars[order[i]], key) }
+ gsub(/Mod4/, "Super", key); gsub(/Mod1/, "Alt", key)
+ gsub(/--no-startup-id[ \t]+/, "", cmd)
+ shown = cmd; sub(/^exec[ \t]+/, "", shown)
+ if (length(shown) > 70) shown = substr(shown, 1, 67) "..."
+ if (mode != "") key = mode ": " key
+ printf "%s\t%s\t%s\n", key, shown, (mode == "" ? cmd : "")
+ }
+ ' "$CONF"
+}
+
+case ${1:-} in
+ --markdown)
+ echo "| Keys | Action |"; echo "|---|---|"
+ parse | awk -F'\t' '{ a = $2; gsub(/\|/, "\\|", a); printf "| `%s` | `%s` |\n", $1, a }' ;;
+ --list)
+ parse | awk -F'\t' '{ printf "%-30s %s\n", $1, $2 }' ;;
+ *)
+ data=$(parse)
+ pick=$(printf '%s\n' "$data" | awk -F'\t' '{ printf "%-30s %s\n", $1, $2 }' |
+ fuzzel --dmenu --index --width 80 --lines 18 --prompt "keys ") || exit 0
+ cmd=$(printf '%s\n' "$data" | sed -n "$((pick + 1))p" | cut -f3)
+ [ -n "$cmd" ] && swaymsg -- "$cmd" >/dev/null ;;
+esac
diff --git a/binaries/lock-screen b/binaries/lock-screen
index 019e6c2..1b2967e 100755
--- a/binaries/lock-screen
+++ b/binaries/lock-screen
@@ -16,4 +16,7 @@ if command -v magick >/dev/null && [ -f "$wall" ]; then
bg="$blurred"
fi
-exec gtklock -d -b "$bg"
+layout="${XDG_CONFIG_HOME:-$HOME/.config}/gtklock/layout.ui"
+[ -f "$layout" ] && set -- -x "$layout"
+
+exec gtklock -d -b "$bg" "$@"
diff --git a/binaries/nightlight b/binaries/nightlight
new file mode 100755
index 0000000..4066ea0
--- /dev/null
+++ b/binaries/nightlight
@@ -0,0 +1,21 @@
+#!/bin/sh
+# nightlight: warm the screen to 4000K (wlsunset) for the waybar moon.
+# nightlight toggle | on | off | status
+on() { pgrep -x wlsunset >/dev/null || setsid -f wlsunset -T 4001 -t 4000 >/dev/null 2>&1; }
+off() { pkill -x wlsunset; }
+case ${1:-status} in
+ on) on ;;
+ off) off ;;
+ toggle)
+ if ! command -v wlsunset >/dev/null; then
+ notify-send "Night light" "wlsunset isn't installed (run install-deps.sh)"; exit 1
+ fi
+ if pgrep -x wlsunset >/dev/null; then off; else on; fi
+ sleep 0.3; pkill -RTMIN+12 -x waybar ;;
+ status)
+ if pgrep -x wlsunset >/dev/null; then
+ printf '{"text":"\\udb81\\udd94","tooltip":"Night light on (warm screen)\\nClick to turn off","class":"on"}\n'
+ else
+ printf '{"text":"\\udb81\\udd94","tooltip":"Night light off\\nClick to warm the screen","class":"off"}\n'
+ fi ;;
+esac
diff --git a/binaries/notifications b/binaries/notifications
new file mode 100755
index 0000000..d6f0858
--- /dev/null
+++ b/binaries/notifications
@@ -0,0 +1,37 @@
+#!/bin/sh
+# notifications: a small notification centre in fuzzel (the waybar bell's left click).
+# Lists notifications waiting behind do-not-disturb (●) and recent history.
+# Picking one shows it again; "Dismiss waiting" clears the waiting ones.
+command -v jq >/dev/null || { notify-send "Notifications" "jq isn't installed"; exit 1; }
+
+# kind<TAB>app<TAB>summary<TAB>body (markup stripped, one line each)
+rows() {
+ makoctl "$1" -j 2>/dev/null | jq -r --arg k "$2" '.[]
+ | select(.app_name != "calendar" and .app_name != "notifications")
+ | [$k, (.app_name // "app"), (.summary // ""),
+ ((.body // "") | gsub("<[^>]*>"; "") | gsub("\\s+"; " ") | .[0:90])] | @tsv'
+}
+waiting=$(rows list waiting)
+history=$(rows history history)
+all=$(printf '%s\n%s\n' "$waiting" "$history" | grep -v '^$')
+
+if [ -z "$all" ]; then
+ notify-send -a notifications "Notifications" "Nothing here yet"
+ exit 0
+fi
+
+menu=$(printf '%s\n' "$all" | awk -F'\t' '{
+ mark = ($1 == "waiting") ? "●" : " "
+ line = mark " " $2 ": " $3; if ($4 != "") line = line " " $4
+ print line }')
+[ -n "$waiting" ] && menu=$(printf ' Dismiss waiting\n%s' "$menu")
+
+pick=$(printf '%s\n' "$menu" | fuzzel --dmenu --index --width 70 --lines 14 --prompt "notifications ") || exit 0
+
+if [ -n "$waiting" ]; then
+ [ "$pick" = 0 ] && { makoctl dismiss -a; pkill -RTMIN+10 -x waybar; exit 0; }
+ pick=$((pick - 1))
+fi
+row=$(printf '%s\n' "$all" | sed -n "$((pick + 1))p")
+app=$(printf '%s' "$row" | cut -f2); summary=$(printf '%s' "$row" | cut -f3); body=$(printf '%s' "$row" | cut -f4)
+notify-send -a notifications "$app · $summary" "$body"
diff --git a/binaries/recording-status b/binaries/recording-status
new file mode 100755
index 0000000..a0ffc3e
--- /dev/null
+++ b/binaries/recording-status
@@ -0,0 +1,8 @@
+#!/bin/sh
+# recording-status: red dot on the bar while wf-recorder is running.
+# Prints nothing when idle, so waybar hides the module.
+if pgrep -x wf-recorder >/dev/null; then
+ printf '{"text":"\\udb81\\udc4a REC","tooltip":"Recording the screen\\nClick (or Ctrl+Alt+Print) to stop","class":"recording"}\n'
+else
+ echo '{"text":""}'
+fi
diff --git a/binaries/screenshot b/binaries/screenshot
index 596b42c..ef8222e 100755
--- a/binaries/screenshot
+++ b/binaries/screenshot
@@ -11,10 +11,15 @@ while getopts scr opt; do
r)
if pkill -INT -x wf-recorder; then
notify-send "Recording saved" "$HOME/Videos"
+ sleep 0.5; pkill -RTMIN+11 -x waybar # hide the REC dot
else
g=$(slurp) || exit 1
+ mkdir -p "$HOME/Videos"
notify-send "Recording" "Press Ctrl+Alt+Print again to stop"
- wf-recorder -g "$g" -f "$HOME/Videos/rec-$(date +%F_%H-%M-%S).mp4"
+ wf-recorder -g "$g" -f "$HOME/Videos/rec-$(date +%F_%H-%M-%S).mp4" &
+ sleep 0.5; pkill -RTMIN+11 -x waybar # show the REC dot
+ wait
+ pkill -RTMIN+11 -x waybar
fi
exit ;;
*) exit 1 ;;
diff --git a/binaries/updates b/binaries/updates
new file mode 100755
index 0000000..965ecc8
--- /dev/null
+++ b/binaries/updates
@@ -0,0 +1,21 @@
+#!/bin/sh
+# updates: count pending package updates for the waybar icon.
+# updates status JSON for waybar (hidden when there's nothing to update)
+# updates run open kitty and run the upgrade
+# Void only for now; other distros just hide the icon.
+case ${1:-status} in
+ status)
+ command -v xbps-install >/dev/null || { echo '{"text":""}'; exit 0; }
+ list=$(xbps-install -Mun 2>/dev/null)
+ n=$(printf '%s' "$list" | grep -c .)
+ if [ "$n" -gt 0 ]; then
+ names=$(printf '%s\n' "$list" | awk '{print $1}' | head -15 | sed 's/$/\\n/' | tr -d '\n')
+ [ "$n" -gt 15 ] && names="${names}…and $((n - 15)) more\\n"
+ printf '{"text":"\\udb80\\udfd5 %s","tooltip":"%s update(s) waiting\\n%sClick to update","class":"pending"}\n' "$n" "$n" "$names"
+ else
+ echo '{"text":""}'
+ fi ;;
+ run)
+ kitty --title "System update" sh -c 'sudo xbps-install -Su; printf "\nDone. Press Enter to close."; read _'
+ pkill -RTMIN+13 -x waybar ;;
+esac
diff --git a/binaries/wallpaper b/binaries/wallpaper
index 2b09186..3afc912 100755
--- a/binaries/wallpaper
+++ b/binaries/wallpaper
@@ -5,8 +5,12 @@
# wallpaper static still image only
# wallpaper animated play sway/background.webm on top of the still
# wallpaper restore start whichever mode was last chosen (run at login)
+# wallpaper sync play/stop the video to match power (run by waybar-battery)
# wallpaper status JSON for the waybar button
#
+# Animated mode only actually plays on AC power and outside power-saver;
+# otherwise the still shows and the button turns amber ("paused").
+#
# The still (sway/config "output * bg") always runs underneath, so stopping
# the video just reveals it. mpvpaper pauses itself while windows cover it.
@@ -17,6 +21,16 @@ mode() { cat "$STATE" 2>/dev/null || echo static; }
save() { mkdir -p "$(dirname "$STATE")"; echo "$1" > "$STATE"; }
refresh() { pkill -RTMIN+9 -x waybar; }
+# Should the video run right now? Plugged in and not in power-saver.
+power_ok() {
+ ac=0
+ for f in /sys/class/power_supply/*/online; do
+ [ -r "$f" ] && [ "$(cat "$f")" = 1 ] && ac=1
+ done
+ [ "$ac" = 1 ] || return 1
+ [ "$(powerprofilesctl get 2>/dev/null)" != power-saver ]
+}
+
start_video() {
pgrep -x mpvpaper >/dev/null && return 0
if ! command -v mpvpaper >/dev/null; then
@@ -30,11 +44,24 @@ start_video() {
case ${1:-status} in
static) pkill -x mpvpaper; save static; refresh ;;
- animated) start_video && save animated; refresh ;;
+ animated)
+ save animated
+ if power_ok; then start_video || save static
+ else notify-send "Animated wallpaper" "Paused until you plug in and leave power-saver"
+ fi
+ refresh ;;
toggle) if [ "$(mode)" = animated ]; then "$0" static; else "$0" animated; fi ;;
- restore) [ "$(mode)" = animated ] && start_video ;;
+ restore) [ "$(mode)" = animated ] && power_ok && start_video ;;
+ sync)
+ [ "$(mode)" = animated ] && command -v mpvpaper >/dev/null || exit 0
+ running=0; pgrep -x mpvpaper >/dev/null && running=1
+ if power_ok; then [ "$running" = 1 ] || { start_video; refresh; }
+ else [ "$running" = 0 ] || { pkill -x mpvpaper; refresh; }
+ fi ;;
status)
- if [ "$(mode)" = animated ]; then
+ if [ "$(mode)" = animated ] && ! pgrep -x mpvpaper >/dev/null; then
+ printf '{"text":"<span color=\\"#E8964A\\">\\udb82\\udd3a</span>","tooltip":"Animated wallpaper paused (on battery or power-saver)\\nClick for the still","class":"paused"}\n'
+ elif [ "$(mode)" = animated ]; then
printf '{"text":"<span color=\\"#5FD4F0\\">\\udb82\\udd3a</span>","tooltip":"Animated wallpaper (click for still)","class":"animated"}\n'
else
printf '{"text":"<span color=\\"#E0485C\\">\\udb80\\udee9</span>","tooltip":"Still wallpaper (click to animate)","class":"static"}\n'
diff --git a/binaries/waybar-battery b/binaries/waybar-battery
index 5383252..b25438f 100755
--- a/binaries/waybar-battery
+++ b/binaries/waybar-battery
@@ -25,9 +25,13 @@ case $1 in
esac
if [ -n "$1" ]; then
pkill -RTMIN+8 -x waybar
+ ~/.local/bin/wallpaper sync &
exit
fi
+# Keep the animated wallpaper in step with power (cheap; exits early if unused)
+~/.local/bin/wallpaper sync >/dev/null 2>&1 &
+
cap=$(cat "$BAT/capacity")
status=$(cat "$BAT/status")
e_now=$(cat "$BAT/energy_now")
diff --git a/btop/btop.conf b/btop/btop.conf
new file mode 100644
index 0000000..4d16a01
--- /dev/null
+++ b/btop/btop.conf
@@ -0,0 +1,6 @@
+#? Config file for btop
+
+# Clockwork theme from ./themes, transparent so kitty's glass shows through
+color_theme = "clockwork"
+theme_background = false
+truecolor = true
diff --git a/btop/themes/clockwork.theme b/btop/themes/clockwork.theme
new file mode 100644
index 0000000..9110a94
--- /dev/null
+++ b/btop/themes/clockwork.theme
@@ -0,0 +1,43 @@
+# Clockwork theme for btop, matches ~/.config/sway/clockwork
+theme[main_bg]=""
+theme[main_fg]="#E9E4DF"
+theme[title]="#E9E4DF"
+theme[hi_fg]="#5FD4F0"
+theme[selected_bg]="#1E2C42"
+theme[selected_fg]="#9EE8F8"
+theme[inactive_fg]="#4A5A72"
+theme[graph_text]="#8A9AB0"
+theme[meter_bg]="#1E2C42"
+theme[proc_misc]="#D4B072"
+theme[cpu_box]="#5FD4F0"
+theme[mem_box]="#D4B072"
+theme[net_box]="#4A8FE0"
+theme[proc_box]="#D7718F"
+theme[div_line]="#2A3A52"
+theme[temp_start]="#5FD4F0"
+theme[temp_mid]="#D4B072"
+theme[temp_end]="#E0485C"
+theme[cpu_start]="#4A8FE0"
+theme[cpu_mid]="#5FD4F0"
+theme[cpu_end]="#E0485C"
+theme[free_start]="#14335A"
+theme[free_mid]="#4A8FE0"
+theme[free_end]="#5FD4F0"
+theme[cached_start]="#5A0F1C"
+theme[cached_mid]="#B83F61"
+theme[cached_end]="#D7718F"
+theme[available_start]="#2A3A52"
+theme[available_mid]="#6AA6E8"
+theme[available_end]="#9EE8F8"
+theme[used_start]="#A8834A"
+theme[used_mid]="#D4B072"
+theme[used_end]="#E0485C"
+theme[download_start]="#14335A"
+theme[download_mid]="#4A8FE0"
+theme[download_end]="#5FD4F0"
+theme[upload_start]="#5A0F1C"
+theme[upload_mid]="#C8283E"
+theme[upload_end]="#E0485C"
+theme[process_start]="#5FD4F0"
+theme[process_mid]="#D4B072"
+theme[process_end]="#E0485C"
diff --git a/gtk-3.0/gtk.css b/gtk-3.0/gtk.css
new file mode 100644
index 0000000..27f89b4
--- /dev/null
+++ b/gtk-3.0/gtk.css
@@ -0,0 +1,22 @@
+/* Clockwork palette for GTK 3 apps (Adwaita-dark), matches ~/.config/sway/clockwork */
+@define-color theme_bg_color #0E1828;
+@define-color theme_fg_color #E9E4DF;
+@define-color theme_base_color #050A14;
+@define-color theme_text_color #E9E4DF;
+@define-color theme_selected_bg_color #5FD4F0;
+@define-color theme_selected_fg_color #050A14;
+@define-color insensitive_bg_color #0E1828;
+@define-color insensitive_fg_color #6B7A90;
+@define-color insensitive_base_color #050A14;
+@define-color theme_unfocused_bg_color #0E1828;
+@define-color theme_unfocused_fg_color #B9C2CE;
+@define-color theme_unfocused_base_color #050A14;
+@define-color borders #1E2C42;
+@define-color unfocused_borders #1E2C42;
+@define-color warning_color #E8964A;
+@define-color error_color #E0485C;
+@define-color success_color #5CC8A0;
+
+/* Adwaita draws these with hard-coded colors, so restate them */
+headerbar, .titlebar { background: #050A14; color: #E9E4DF; border-color: #1E2C42; box-shadow: none; }
+selection, *:selected { background-color: alpha(#5FD4F0, 0.85); color: #050A14; }
diff --git a/gtk-4.0/gtk.css b/gtk-4.0/gtk.css
new file mode 100644
index 0000000..27f0180
--- /dev/null
+++ b/gtk-4.0/gtk.css
@@ -0,0 +1,34 @@
+/* Clockwork palette for GTK 4 / libadwaita apps, matches ~/.config/sway/clockwork */
+@define-color accent_color #5FD4F0;
+@define-color accent_bg_color #2F8FB0;
+@define-color accent_fg_color #050A14;
+@define-color destructive_color #E0485C;
+@define-color destructive_bg_color #C8283E;
+@define-color destructive_fg_color #E9E4DF;
+@define-color success_color #5CC8A0;
+@define-color warning_color #E8964A;
+@define-color error_color #E0485C;
+@define-color window_bg_color #0E1828;
+@define-color window_fg_color #E9E4DF;
+@define-color view_bg_color #050A14;
+@define-color view_fg_color #E9E4DF;
+@define-color headerbar_bg_color #050A14;
+@define-color headerbar_fg_color #E9E4DF;
+@define-color headerbar_backdrop_color #0E1828;
+@define-color sidebar_bg_color #050A14;
+@define-color sidebar_fg_color #E9E4DF;
+@define-color card_bg_color #16233A;
+@define-color card_fg_color #E9E4DF;
+@define-color dialog_bg_color #0E1828;
+@define-color dialog_fg_color #E9E4DF;
+@define-color popover_bg_color #16233A;
+@define-color popover_fg_color #E9E4DF;
+
+/* Plain GTK 4 apps (no libadwaita) still read the old names */
+@define-color theme_bg_color #0E1828;
+@define-color theme_fg_color #E9E4DF;
+@define-color theme_base_color #050A14;
+@define-color theme_text_color #E9E4DF;
+@define-color theme_selected_bg_color #5FD4F0;
+@define-color theme_selected_fg_color #050A14;
+@define-color borders #1E2C42;
diff --git a/gtklock/avatar.png b/gtklock/avatar.png
new file mode 100644
index 0000000..d1628fd
Binary files /dev/null and b/gtklock/avatar.png differ
diff --git a/gtklock/config.ini b/gtklock/config.ini
index 47efaf2..b2675ca 100644
--- a/gtklock/config.ini
+++ b/gtklock/config.ini
@@ -1,6 +1,6 @@
[main]
# Background is passed by ~/.local/bin/lock-screen (blurred wallpaper)
-# style.css in this folder is loaded automatically
+# style.css in this folder is loaded automatically; lock-screen also passes layout.ui (adds the avatar)
time-format=%H:%M
date-format=%A, %d %B
idle-hide=true
diff --git a/gtklock/layout.ui b/gtklock/layout.ui
new file mode 100644
index 0000000..0a26247
--- /dev/null
+++ b/gtklock/layout.ui
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- gtklock's built-in layout plus an "avatar" box above the clock.
+ The picture itself is set in style.css (avatar.png in this folder). -->
+<interface><object class="GtkBox" id="window-box"><property name="name">window-box</property><property name="margin">100</property><property name="halign">center</property><property name="valign">center</property><property name="orientation">vertical</property><property name="spacing">10</property><child><object class="GtkBox" id="info-box"><property name="name">info-box</property><property name="halign">center</property><property name="orientation">vertical</property><property name="spacing">5</property><child><object class="GtkBox" id="avatar"><property name="name">avatar</property><property name="halign">center</property></object></child><child><object class="GtkBox" id="time-box"><property name="name">time-box</property><property name="halign">center</property><property name="orientation">vertical</property><child><object class="GtkLabel" id="clock-label"><property name="name">clock-label</property><property name="halign">center</property></object></child><child><object class="GtkLabel" id="date-label"><property name="name">date-label</property><property name="halign">center</property></object></child></object></child></object></child><child><object class="GtkRevealer" id="body-revealer"><property name="transition-type">none</property><property name="reveal-child">0</property><child><object class="GtkGrid" id="body-grid"><property name="row-spacing">5</property><property name="column-spacing">5</property><child><object class="GtkLabel" id="input-label"><property name="name">input-label</property><property name="label" translatable="yes">Password:</property></object><packing><property name="left-attach">0</property><property name="top-attach">0</property></packing></child><child><object class="GtkEntry" id="input-field"><property name="name">input-field</property><property name="width-request">380</property><property name="visibility">0</property><property name="caps-lock-warning">0</property><property name="input-purpose">password</property><property name="secondary-icon-name">view-reveal-symbolic</property><signal name="icon-release" handler="window_pw_toggle_vis"/><signal name="activate" handler="window_pw_check"/></object><packing><property name="left-attach">1</property><property name="top-attach">0</property><property name="width">2</property></packing></child><child><object class="GtkRevealer" id="message-revealer"><property name="transition-type">none</property><property name="no-show-all">1</property><child><object class="GtkScrolledWindow" id="message-scrolled-window"><property name="hscrollbar-policy">never</property><property name="max-content-height">256</property><property name="propagate-natural-height">1</property><child><object class="GtkViewport"><child><object class="GtkBox" id="message-box"><property name="orientation">vertical</property><property name="homogeneous">1</property></object></child></object></child></object></child></object><packing><property name="left-attach">1</property><property name="top-attach">1</property><property name="width">2</property></packing></child><child><object class="GtkBox"><property name="halign">end</property><property name="spacing">5</property><child><object class="GtkLabel" id="warning-label"><property name="name">warning-label</property></object></child><child><object class="GtkLabel" id="error-label"><property name="name">error-label</property></object></child><child><object class="GtkButton" id="unlock-button"><property name="name">unlock-button</property><property name="label" translatable="yes">Unlock</property><style><class name="suggested-action"/></style><signal name="clicked" handler="window_pw_check"/></object></child></object><packing><property name="left-attach">1</property><property name="top-attach">2</property><property name="width">2</property></packing></child></object></child></object></child></object></interface>
diff --git a/gtklock/style.css b/gtklock/style.css
index 55a914e..fa89304 100644
--- a/gtklock/style.css
+++ b/gtklock/style.css
@@ -27,6 +27,19 @@ window {
box-shadow: 0 0 24px alpha(@glow, 0.45);
}
+/* Round avatar above the clock (avatar.png next to this file; layout.ui adds the box) */
+#avatar {
+ min-width: 112px;
+ min-height: 112px;
+ margin-bottom: 14px;
+ background-image: url("avatar.png");
+ background-size: cover;
+ background-position: center;
+ border-radius: 50%;
+ border: 2px solid @glow;
+ box-shadow: 0 0 16px alpha(@glow, 0.45);
+}
+
#clock-label {
font-size: 72px;
font-weight: bold;
@@ -83,6 +96,7 @@ window {
box-shadow: none;
}
+#unlock-button label { color: @bg; } /* beat the "* { color }" rule */
#unlock-button:hover { background-color: @frost; }
#unlock-button:active { background-color: @gold; }
diff --git a/install b/install
index c68ca8b..fc5f596 100755
--- a/install
+++ b/install
@@ -8,24 +8,26 @@
# ./install everything
# ./install --dry-run print every command without running anything
# --no-flatpak, --no-services passed through to install-deps.sh
+# --with-sddm also install the Clockwork login theme (install-sddm.sh)
#
# Each script also works on its own.
set -uo pipefail
-ALL=() DEPS=()
+ALL=() DEPS=() PARTS=(deps assets config scripts)
for arg in "$@"; do
case $arg in
--dry-run) ALL+=("$arg") ;;
--no-flatpak|--no-services) DEPS+=("$arg") ;;
- -h|--help) sed -n '2,12p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
+ --with-sddm) PARTS+=(sddm) ;;
+ -h|--help) sed -n '2,13p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
*) echo "Unknown option: $arg (try --help)"; exit 1 ;;
esac
done
REPO=$(cd "$(dirname "$0")" && pwd)
failed=()
-for part in deps assets config scripts; do
+for part in "${PARTS[@]}"; do
printf '\n\e[1;35m######## install-%s ########\e[0m\n' "$part"
if [ "$part" = deps ]; then
"$REPO/install-deps.sh" "${ALL[@]}" "${DEPS[@]}" || failed+=("$part")
diff --git a/install-assets.sh b/install-assets.sh
index e1e3861..603c463 100755
--- a/install-assets.sh
+++ b/install-assets.sh
@@ -6,6 +6,7 @@
#
# - JetBrainsMono Nerd Font Mono -> ~/.local/share/fonts/jetbrainsmono-nfm (downloaded)
# - icons/<cursor theme>/ -> linked into ~/.icons/
+# The SDDM login theme has its own script: install-sddm.sh
# The wallpaper needs no step: sway/config points straight at sway/background.png.
# Needs curl, unzip and fontconfig, which install-deps.sh installs.
@@ -15,7 +16,7 @@ DRY=0
for arg in "$@"; do
case $arg in
--dry-run) DRY=1 ;;
- -h|--help) sed -n '2,10p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
+ -h|--help) sed -n '2,11p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
*) echo "Unknown option: $arg (try --help)"; exit 1 ;;
esac
done
diff --git a/install-config.sh b/install-config.sh
index 2fd5109..53d1d4b 100755
--- a/install-config.sh
+++ b/install-config.sh
@@ -38,7 +38,7 @@ fi
# Every "!/name" line in .gitignore is a tracked config, minus the repo's own
# files and the assets that install-assets.sh handles.
mapfile -t ITEMS < <(sed -n 's|^!/\([^/]*\)/\{0,1\}$|\1|p' "$REPO/.gitignore" |
- grep -v -x -E '\.gitignore|README\.md|screenshot\.png|install|install-.*\.sh|icons|binaries')
+ grep -v -x -E '\.gitignore|README\.md|screenshot\.png|install|install-.*\.sh|icons|binaries|sddm')
stamp=$(date +%Y%m%d-%H%M%S)
run mkdir -p "$TARGET"
diff --git a/install-deps.sh b/install-deps.sh
index 87954d8..c1533a3 100755
--- a/install-deps.sh
+++ b/install-deps.sh
@@ -62,7 +62,7 @@ echo "Detected ${PRETTY_NAME:-$ID} (using the $FAMILY package list)"
# apps, portals, build tools for the cargo steps below.
case $FAMILY in
void)
- PKGS=(swayfx Waybar swaybg mpvpaper swayidle autotiling polkit-gnome gnome-keyring
+ PKGS=(swayfx Waybar swaybg mpvpaper wlsunset swayidle autotiling polkit-gnome gnome-keyring
mako libnotify fuzzel gtklock ImageMagick kitty yazi
wl-clipboard cliphist pipewire wireplumber pavucontrol
brightnessctl playerctl power-profiles-daemon
@@ -70,7 +70,7 @@ void)
grim slurp wf-recorder firefox flatpak xdg-desktop-portal-wlr
jq curl unzip git fontconfig rustup) ;;
arch)
- PKGS=(swayfx waybar swaybg mpvpaper swayidle autotiling polkit-gnome gnome-keyring
+ PKGS=(swayfx waybar swaybg mpvpaper wlsunset swayidle autotiling polkit-gnome gnome-keyring
mako libnotify fuzzel gtklock imagemagick kitty yazi
wl-clipboard cliphist pipewire pipewire-pulse wireplumber pavucontrol
brightnessctl playerctl power-profiles-daemon
@@ -78,7 +78,7 @@ arch)
grim slurp wf-recorder firefox flatpak xdg-desktop-portal-wlr
jq curl unzip git fontconfig base-devel rustup) ;;
fedora)
- PKGS=(swayfx waybar swaybg mpvpaper swayidle autotiling polkit-gnome gnome-keyring
+ PKGS=(swayfx waybar swaybg mpvpaper wlsunset swayidle autotiling polkit-gnome gnome-keyring
mako libnotify fuzzel gtklock ImageMagick kitty yazi
wl-clipboard cliphist pipewire wireplumber pavucontrol
brightnessctl playerctl power-profiles-daemon
@@ -86,7 +86,7 @@ fedora)
grim slurp wf-recorder firefox flatpak xdg-desktop-portal-wlr
jq curl unzip git fontconfig gcc rustup) ;;
debian)
- PKGS=(swayfx waybar swaybg mpvpaper swayidle autotiling policykit-1-gnome gnome-keyring
+ PKGS=(swayfx waybar swaybg mpvpaper wlsunset swayidle autotiling policykit-1-gnome gnome-keyring
mako-notifier libnotify-bin fuzzel gtklock imagemagick kitty yazi
wl-clipboard cliphist pipewire pipewire-pulse wireplumber pavucontrol
brightnessctl playerctl power-profiles-daemon
@@ -94,7 +94,7 @@ debian)
grim slurp wf-recorder firefox flatpak xdg-desktop-portal-wlr
jq curl unzip git fontconfig build-essential rustup) ;;
suse)
- PKGS=(swayfx waybar swaybg mpvpaper swayidle autotiling polkit-gnome gnome-keyring
+ PKGS=(swayfx waybar swaybg mpvpaper wlsunset swayidle autotiling polkit-gnome gnome-keyring
mako libnotify-tools fuzzel gtklock ImageMagick kitty yazi
wl-clipboard cliphist pipewire wireplumber pavucontrol
brightnessctl playerctl power-profiles-daemon
diff --git a/install-sddm.sh b/install-sddm.sh
new file mode 100755
index 0000000..1bdbab8
--- /dev/null
+++ b/install-sddm.sh
@@ -0,0 +1,141 @@
+#!/usr/bin/env bash
+# install-sddm.sh: install the Clockwork SDDM login theme. Works on its own,
+# without the rest of the dotfiles.
+#
+# ./install-sddm.sh install the theme and make it the login screen
+# ./install-sddm.sh --dry-run print the commands without running them
+# ./install-sddm.sh --no-video use the still wallpaper instead of the animated one
+# ./install-sddm.sh --uninstall remove the theme and restore your previous sddm.conf
+#
+# The theme is copied (not linked) to /usr/share/sddm/themes/clockwork, because
+# the login screen runs as its own user and can't read your home folder.
+# Needs: sddm (Qt 6 greeter), Qt 6 declarative + multimedia, curl and unzip.
+
+set -uo pipefail
+
+DRY=0 VIDEO=1 UNINSTALL=0
+for arg in "$@"; do
+ case $arg in
+ --dry-run) DRY=1 ;;
+ --no-video) VIDEO=0 ;;
+ --uninstall) UNINSTALL=1 ;;
+ -h|--help) sed -n '2,13p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
+ *) echo "Unknown option: $arg (try --help)"; exit 1 ;;
+ esac
+done
+
+c_head=$'\e[1;36m' c_warn=$'\e[1;33m' c_ok=$'\e[1;32m' c_off=$'\e[0m'
+step() { printf '\n%s==> %s%s\n' "$c_head" "$*" "$c_off"; }
+warn() { printf '%s ! %s%s\n' "$c_warn" "$*" "$c_off"; }
+run() { printf ' $ %s\n' "$*"; [ "$DRY" = 1 ] || "$@"; }
+
+if [ "$(id -u)" = 0 ]; then SUDO=()
+elif command -v sudo >/dev/null; then SUDO=(sudo)
+elif command -v doas >/dev/null; then SUDO=(doas)
+else echo "Need sudo or doas to install a login theme."; exit 1
+fi
+
+REPO=$(cd "$(dirname "$0")" && pwd)
+THEMES=/usr/share/sddm/themes
+DEST=$THEMES/clockwork
+CONF=/etc/sddm.conf
+[ "$DRY" = 1 ] && echo "Dry run: nothing will be changed."
+
+# ---------- Uninstall ----------
+if [ "$UNINSTALL" = 1 ]; then
+ step "Removing the Clockwork login theme"
+ run "${SUDO[@]}" rm -rf "$DEST" /etc/sddm.conf.d/clockwork.conf
+ backup=$(ls -1t "$CONF".bak-* 2>/dev/null | head -1)
+ if [ -n "$backup" ]; then
+ run "${SUDO[@]}" cp "$backup" "$CONF"
+ echo " restored $backup"
+ elif [ -f "$CONF" ] && grep -qx 'Current=clockwork' "$CONF"; then
+ run "${SUDO[@]}" sed -i '/^Current=clockwork$/d' "$CONF"
+ echo " SDDM will use its default theme"
+ fi
+ step "Done"
+ exit 0
+fi
+
+# ---------- Checks ----------
+step "Checking requirements"
+missing=()
+command -v sddm >/dev/null || missing+=("sddm")
+command -v sddm-greeter-qt6 >/dev/null || [ -x /usr/lib/sddm/sddm-greeter-qt6 ] ||
+ missing+=("the SDDM Qt 6 greeter (sddm-greeter-qt6)")
+qml_has() { for d in /usr/lib*/qt6/qml /usr/lib/*/qt6/qml /usr/share/qt6/qml; do [ -d "$d/$1" ] && return 0; done; return 1; }
+qml_has QtQuick/Effects || missing+=("Qt 6 declarative (QtQuick.Effects)")
+if [ "$VIDEO" = 1 ] && ! qml_has QtMultimedia; then
+ warn "Qt 6 multimedia isn't installed, so the theme will use the still wallpaper"
+ VIDEO=0
+fi
+for t in curl unzip; do command -v $t >/dev/null || missing+=("$t"); done
+if [ ${#missing[@]} -gt 0 ]; then
+ warn "Install these first: ${missing[*]}"
+ [ "$DRY" = 1 ] || exit 1
+fi
+[ -d "$THEMES" ] || { warn "$THEMES doesn't exist; is SDDM installed?"; [ "$DRY" = 1 ] || exit 1; }
+echo " ok"
+
+# ---------- Build the theme folder ----------
+step "Building the theme"
+stage=$(mktemp -d)
+trap 'rm -rf "$stage"' EXIT
+mkdir -p "$stage/clockwork/fonts"
+cp "$REPO"/sddm/clockwork/* "$stage/clockwork/"
+cp "$REPO/sway/background.png" "$stage/clockwork/background.png"
+cp "$REPO/gtklock/avatar.png" "$stage/clockwork/avatar.png"
+if [ "$VIDEO" = 1 ] && [ -f "$REPO/sway/background.webm" ]; then
+ cp "$REPO/sway/background.webm" "$stage/clockwork/background.webm"
+else
+ sed -i 's/^useVideo=.*/useVideo=false/' "$stage/clockwork/theme.conf"
+ echo " using the still wallpaper"
+fi
+
+# Font: reuse the dotfiles' copy if it's there, otherwise download it
+fonts="$HOME/.local/share/fonts/jetbrainsmono-nfm"
+if cp "$fonts"/JetBrainsMonoNerdFontMono-{Regular,Bold}.ttf "$stage/clockwork/fonts/" 2>/dev/null; then
+ echo " font copied from $fonts"
+else
+ url=https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.zip
+ echo " downloading JetBrainsMono Nerd Font"
+ if curl -fsSL -o "$stage/font.zip" "$url" &&
+ unzip -oq "$stage/font.zip" 'JetBrainsMonoNerdFontMono-Regular.ttf' 'JetBrainsMonoNerdFontMono-Bold.ttf' \
+ -d "$stage/clockwork/fonts"; then
+ echo " font downloaded"
+ else
+ warn "Font download failed; the login screen will use a plain font and lose its icons"
+ fi
+fi
+
+# ---------- Install ----------
+step "Installing to $DEST"
+run "${SUDO[@]}" rm -rf "$DEST"
+run "${SUDO[@]}" cp -r "$stage/clockwork" "$DEST"
+
+step "Setting Clockwork as the login theme"
+# /etc/sddm.conf overrides sddm.conf.d, so edit it directly when it has a [Theme] section.
+if [ -f "$CONF" ] && grep -q '^\[Theme\]' "$CONF"; then
+ if grep -qx 'Current=clockwork' "$CONF"; then
+ echo " already the login theme"
+ else
+ run "${SUDO[@]}" cp "$CONF" "$CONF.bak-$(date +%Y%m%d-%H%M%S)"
+ if grep -q '^Current=' "$CONF"; then
+ run "${SUDO[@]}" sed -i 's/^Current=.*/Current=clockwork/' "$CONF"
+ else
+ run "${SUDO[@]}" sed -i 's/^\[Theme\]$/[Theme]\nCurrent=clockwork/' "$CONF"
+ fi
+ # Settings for other themes' on-screen keyboards don't apply here
+ run "${SUDO[@]}" sed -i 's/^\(InputMethod=qtvirtualkeyboard\)/#\1/; s/^\(GreeterEnvironment=.*QML2_IMPORT_PATH.*\)/#\1/' "$CONF"
+ fi
+else
+ run "${SUDO[@]}" mkdir -p /etc/sddm.conf.d
+ if [ "$DRY" = 1 ]; then echo " $ write /etc/sddm.conf.d/clockwork.conf ([Theme] Current=clockwork)"
+ else printf '[Theme]\nCurrent=clockwork\n' | "${SUDO[@]}" tee /etc/sddm.conf.d/clockwork.conf >/dev/null
+ fi
+fi
+
+step "Done"
+printf '%s Log out or reboot to see it.%s Preview without logging out:\n' "$c_ok" "$c_off"
+echo " sddm-greeter-qt6 --test-mode --theme $DEST"
+echo " Undo with: $0 --uninstall"
diff --git a/mako/config b/mako/config
index 19f18ff..4aecc4b 100644
--- a/mako/config
+++ b/mako/config
@@ -10,6 +10,7 @@ padding=12
outer-margin=12
width=360
max-visible=5
+max-history=50
default-timeout=6000
icons=1
max-icon-size=48
@@ -27,3 +28,15 @@ default-timeout=0
[mode=do-not-disturb]
invisible=1
+
+# The clock's calendar: body only (it carries its own title), tall enough for 6 weeks
+[app-name=calendar]
+format=%b
+height=320
+
+# ...and these are opened on purpose, so they show even in do-not-disturb
+[mode=do-not-disturb app-name=calendar]
+invisible=0
+
+[mode=do-not-disturb app-name=notifications]
+invisible=0
diff --git a/screenshot.png b/screenshot.png
index fcec6b7..80d0cc6 100644
Binary files a/screenshot.png and b/screenshot.png differ
diff --git a/sddm/clockwork/Main.qml b/sddm/clockwork/Main.qml
new file mode 100644
index 0000000..40ba122
--- /dev/null
+++ b/sddm/clockwork/Main.qml
@@ -0,0 +1,400 @@
+// Clockwork SDDM theme: the login twin of the gtklock lock screen.
+// Palette matches ~/.config/sway/clockwork. Needs Qt 6.5+ (QtQuick.Effects).
+
+import QtQuick
+import QtQuick.Effects
+import QtMultimedia
+
+Rectangle {
+ id: root
+ width: 1920
+ height: 1080
+ color: c.base
+
+ // ---------- Clockwork palette ----------
+ QtObject {
+ id: c
+ readonly property color base: "#050A14"
+ readonly property color surface: "#0E1828"
+ readonly property color line: "#1E2C42"
+ readonly property color muted: "#8A9AB0"
+ readonly property color text: "#E9E4DF"
+ readonly property color glow: "#5FD4F0"
+ readonly property color frost: "#9EE8F8"
+ readonly property color gold: "#D4B072"
+ readonly property color amber: "#E8964A"
+ readonly property color scarlet: "#E0485C"
+ }
+
+ // ---------- Config (theme.conf) ----------
+ function cfg(key, fallback) {
+ var v = config[key]
+ return (v === undefined || v === null || v === "") ? fallback : String(v)
+ }
+ readonly property bool useVideo: cfg("useVideo", "true") === "true"
+ readonly property real dim: parseFloat(cfg("dim", "0.25"))
+
+ FontLoader { id: mono; source: "fonts/JetBrainsMonoNerdFontMono-Regular.ttf" }
+ FontLoader { id: monoBold; source: "fonts/JetBrainsMonoNerdFontMono-Bold.ttf" }
+ readonly property string fontName: mono.status === FontLoader.Ready ? mono.name : "monospace"
+ function icon(cp) { return String.fromCodePoint(cp) }
+
+ // ---------- Users and sessions ----------
+ property var users: []
+ property int userIndex: userModel.lastIndex >= 0 ? userModel.lastIndex : 0
+ property var sessions: []
+ property int sessionIndex: sessionModel.lastIndex >= 0 ? sessionModel.lastIndex : 0
+
+ Repeater {
+ model: userModel
+ Item {
+ Component.onCompleted: {
+ var u = root.users.slice()
+ u[index] = { name: model.name, real: model.realName || model.name }
+ root.users = u
+ }
+ }
+ }
+ Repeater {
+ model: sessionModel
+ Item {
+ Component.onCompleted: {
+ var s = root.sessions.slice()
+ s[index] = model.name
+ root.sessions = s
+ }
+ }
+ }
+ readonly property string userName: users.length ? users[userIndex].name : userModel.lastUser
+ readonly property string userLabel: users.length ? users[userIndex].real : userModel.lastUser
+ readonly property string sessionName: sessions.length ? sessions[sessionIndex] : "Session"
+
+ // ---------- Background: still underneath, video on top ----------
+ Item {
+ id: background
+ anchors.fill: parent
+
+ Image {
+ anchors.fill: parent
+ source: Qt.resolvedUrl(root.cfg("background", "background.png"))
+ fillMode: Image.PreserveAspectCrop
+ asynchronous: true
+ }
+ Video {
+ anchors.fill: parent
+ visible: root.useVideo
+ source: root.useVideo ? Qt.resolvedUrl(root.cfg("video", "background.webm")) : ""
+ fillMode: VideoOutput.PreserveAspectCrop
+ loops: MediaPlayer.Infinite
+ muted: true
+ autoPlay: true
+ }
+ Rectangle { anchors.fill: parent; color: c.base; opacity: root.dim }
+ }
+
+
+ // ---------- The glass box ----------
+ Item {
+ id: box
+ width: 520
+ height: column.implicitHeight + 72
+ anchors.centerIn: parent
+ transform: Translate { id: shake }
+
+ // Frosted glass: the box's slice of the background, blurred and
+ // masked to rounded corners, then tinted.
+ ShaderEffectSource {
+ id: boxSource
+ sourceItem: background
+ sourceRect: Qt.rect(box.x, box.y, box.width, box.height)
+ live: true
+ visible: false
+ }
+ Rectangle {
+ id: glassMask
+ anchors.fill: parent
+ radius: 16
+ visible: false
+ layer.enabled: true
+ }
+ MultiEffect {
+ anchors.fill: parent
+ source: boxSource
+ autoPaddingEnabled: false
+ blurEnabled: true
+ blur: 1.0
+ blurMax: 64
+ maskEnabled: true
+ maskSource: glassMask
+ }
+ Rectangle { anchors.fill: parent; radius: 16; color: c.base; opacity: 0.55 }
+ Rectangle {
+ anchors.fill: parent
+ radius: 16
+ color: "transparent"
+ border.color: c.glow
+ border.width: 2
+ }
+
+ Column {
+ id: column
+ anchors.centerIn: parent
+ width: parent.width - 72
+ spacing: 14
+
+ // Avatar
+ Item {
+ width: 112; height: 112
+ anchors.horizontalCenter: parent.horizontalCenter
+ Image {
+ id: avatar
+ anchors.fill: parent
+ source: Qt.resolvedUrl(root.cfg("avatar", "avatar.png"))
+ fillMode: Image.PreserveAspectCrop
+ visible: false
+ layer.enabled: true
+ }
+ Rectangle {
+ id: avatarMask
+ anchors.fill: parent
+ radius: width / 2
+ visible: false
+ layer.enabled: true
+ }
+ MultiEffect {
+ anchors.fill: parent
+ source: avatar
+ maskEnabled: true
+ maskSource: avatarMask
+ }
+ Rectangle {
+ anchors.fill: parent
+ radius: width / 2
+ color: "transparent"
+ border.color: c.glow
+ border.width: 2
+ }
+ }
+
+ // User name (click the arrows to switch user when there are several)
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+ Text {
+ visible: root.users.length > 1
+ text: root.icon(0xf0141)
+ color: prevUser.containsMouse ? c.frost : c.muted
+ font { family: root.fontName; pixelSize: 18 }
+ MouseArea {
+ id: prevUser
+ anchors.fill: parent; hoverEnabled: true
+ onClicked: root.userIndex = (root.userIndex - 1 + root.users.length) % root.users.length
+ }
+ }
+ Text {
+ text: root.userLabel
+ color: c.text
+ font { family: root.fontName; pixelSize: 18; bold: true }
+ }
+ Text {
+ visible: root.users.length > 1
+ text: root.icon(0xf0142)
+ color: nextUser.containsMouse ? c.frost : c.muted
+ font { family: root.fontName; pixelSize: 18 }
+ MouseArea {
+ id: nextUser
+ anchors.fill: parent; hoverEnabled: true
+ onClicked: root.userIndex = (root.userIndex + 1) % root.users.length
+ }
+ }
+ }
+
+ // Clock and date
+ Text {
+ id: clock
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: c.frost
+ font { family: monoBold.status === FontLoader.Ready ? monoBold.name : root.fontName; pixelSize: 72; bold: true }
+ text: Qt.formatDateTime(new Date(), "HH:mm")
+ }
+ Text {
+ id: date
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: c.gold
+ font { family: root.fontName; pixelSize: 18 }
+ text: Qt.formatDateTime(new Date(), "dddd, dd MMMM")
+ }
+ Timer {
+ interval: 1000; running: true; repeat: true
+ onTriggered: {
+ clock.text = Qt.formatDateTime(new Date(), "HH:mm")
+ date.text = Qt.formatDateTime(new Date(), "dddd, dd MMMM")
+ }
+ }
+
+ Item { width: 1; height: 6 }
+
+ // Password
+ Rectangle {
+ id: field
+ width: parent.width
+ height: 46
+ radius: 8
+ color: Qt.rgba(0.02, 0.04, 0.08, 0.9)
+ border.color: password.activeFocus ? c.frost : c.line
+ border.width: 2
+
+ TextInput {
+ id: password
+ anchors.fill: parent
+ anchors.leftMargin: 16
+ anchors.rightMargin: 52
+ verticalAlignment: TextInput.AlignVCenter
+ echoMode: TextInput.Password
+ passwordCharacter: "●"
+ color: c.frost
+ selectionColor: c.glow
+ selectedTextColor: c.base
+ font { family: root.fontName; pixelSize: 18 }
+ clip: true
+ focus: true
+ onAccepted: root.login()
+ onTextChanged: if (text.length) message.text = ""
+ }
+ Text {
+ anchors.left: parent.left
+ anchors.leftMargin: 16
+ anchors.verticalCenter: parent.verticalCenter
+ visible: password.text.length === 0
+ text: "Password"
+ color: c.muted
+ font { family: root.fontName; pixelSize: 16 }
+ }
+ // Go button
+ Rectangle {
+ width: 36; height: 36; radius: 6
+ anchors.right: parent.right
+ anchors.rightMargin: 5
+ anchors.verticalCenter: parent.verticalCenter
+ color: go.containsMouse ? c.frost : c.glow
+ Text {
+ anchors.centerIn: parent
+ text: root.icon(0xf0054)
+ color: c.base
+ font { family: root.fontName; pixelSize: 20 }
+ }
+ MouseArea { id: go; anchors.fill: parent; hoverEnabled: true; onClicked: root.login() }
+ }
+ }
+
+ // Errors and caps lock
+ Text {
+ id: message
+ width: parent.width
+ horizontalAlignment: Text.AlignHCenter
+ color: c.scarlet
+ font { family: root.fontName; pixelSize: 15; bold: true }
+ text: ""
+ visible: text.length > 0
+ }
+ Text {
+ width: parent.width
+ horizontalAlignment: Text.AlignHCenter
+ visible: keyboard.capsLock
+ text: root.icon(0xf030e) + " Caps Lock is on"
+ color: c.amber
+ font { family: root.fontName; pixelSize: 15; bold: true }
+ }
+ }
+
+ SequentialAnimation {
+ id: shakeAnim
+ NumberAnimation { target: shake; property: "x"; to: -14; duration: 50 }
+ NumberAnimation { target: shake; property: "x"; to: 12; duration: 70 }
+ NumberAnimation { target: shake; property: "x"; to: -8; duration: 70 }
+ NumberAnimation { target: shake; property: "x"; to: 0; duration: 60 }
+ }
+ }
+
+ // ---------- Bottom bar: session (left), power (right) ----------
+ Row {
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ anchors.margins: 28
+ spacing: 10
+ Text {
+ text: root.icon(0xf0379) + " " + root.sessionName
+ color: sessionArea.containsMouse ? c.frost : c.text
+ font { family: root.fontName; pixelSize: 16 }
+ MouseArea {
+ id: sessionArea
+ anchors.fill: parent; hoverEnabled: true
+ onClicked: if (root.sessions.length) root.sessionIndex = (root.sessionIndex + 1) % root.sessions.length
+ }
+ }
+ Text {
+ visible: root.sessions.length > 1
+ text: "(click to change)"
+ color: c.muted
+ font { family: root.fontName; pixelSize: 13 }
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+
+ Row {
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.margins: 28
+ spacing: 22
+ Repeater {
+ model: [
+ { glyph: 0xf0904, label: "Sleep", ok: sddm.canSuspend, run: function() { sddm.suspend() } },
+ { glyph: 0xf0709, label: "Restart", ok: sddm.canReboot, run: function() { sddm.reboot() } },
+ { glyph: 0xf0425, label: "Shut down", ok: sddm.canPowerOff, run: function() { sddm.powerOff() } }
+ ]
+ delegate: Item {
+ visible: modelData.ok
+ width: buttonCol.implicitWidth
+ height: buttonCol.implicitHeight
+ Column {
+ id: buttonCol
+ spacing: 4
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: root.icon(modelData.glyph)
+ color: area.containsMouse ? (index === 2 ? c.scarlet : c.frost) : c.text
+ font { family: root.fontName; pixelSize: 26 }
+ }
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: modelData.label
+ color: c.muted
+ font { family: root.fontName; pixelSize: 12 }
+ }
+ }
+ MouseArea {
+ id: area
+ anchors.fill: parent; hoverEnabled: true
+ onClicked: modelData.run()
+ }
+ }
+ }
+ }
+
+ // ---------- Login ----------
+ function login() {
+ message.text = ""
+ sddm.login(root.userName, password.text, root.sessionIndex)
+ }
+ Connections {
+ target: sddm
+ function onLoginFailed() {
+ password.text = ""
+ message.text = root.icon(0xf05d6) + " Wrong password, try again"
+ shakeAnim.restart()
+ password.forceActiveFocus()
+ }
+ }
+
+ Component.onCompleted: password.forceActiveFocus()
+}
diff --git a/sddm/clockwork/metadata.desktop b/sddm/clockwork/metadata.desktop
new file mode 100644
index 0000000..f2a2494
--- /dev/null
+++ b/sddm/clockwork/metadata.desktop
@@ -0,0 +1,12 @@
+[SddmGreeterTheme]
+Name=Clockwork
+Description=Clockwork login screen, matching the dotfiles' lock screen
+Website=https://github.com/doughmination/dots
+License=MIT
+Type=sddm-theme
+Version=1.0
+MainScript=Main.qml
+ConfigFile=theme.conf
+Theme-Id=clockwork
+Theme-API=2.0
+QtVersion=6
diff --git a/sddm/clockwork/theme.conf b/sddm/clockwork/theme.conf
new file mode 100644
index 0000000..34e5684
--- /dev/null
+++ b/sddm/clockwork/theme.conf
@@ -0,0 +1,10 @@
+[General]
+# These files are copied in next to Main.qml by install-assets.sh
+# (the login screen can't read your home folder).
+background=background.png
+video=background.webm
+# Play the animated wallpaper behind the login box (false = still only)
+useVideo=true
+avatar=avatar.png
+# Darken the wallpaper a little so the box stands out (0 = none, 1 = black)
+dim=0.25
diff --git a/sway/config b/sway/config
index 88064fb..8246233 100644
--- a/sway/config
+++ b/sway/config
@@ -121,6 +121,7 @@ bindsym $mod+Mod1+l exec $lock
bindsym $mod+n exec $notification
bindsym $mod+v exec $clipboard
bindsym $mod+Shift+v exec $clipwipe
+bindsym $mod+slash exec ~/.local/bin/keybinds
# $mod+grave (dashboard) is unbound for now.
floating_modifier $mod normal
diff --git a/waybar/config.jsonc b/waybar/config.jsonc
index 7c86d25..bfe98e9 100644
--- a/waybar/config.jsonc
+++ b/waybar/config.jsonc
@@ -10,7 +10,7 @@
"modules-left": ["custom/launcher", "custom/decor", "sway/workspaces", "sway/mode", "sway/scratchpad", "mpris"],
"modules-center": ["clock"],
- "modules-right": ["memory", "cpu", "wireplumber", "backlight", "network", "bluetooth", "custom/battery", "tray", "custom/power"],
+ "modules-right": ["custom/recording", "custom/updates", "idle_inhibitor", "custom/nightlight", "custom/dnd", "memory", "cpu", "wireplumber", "backlight", "network", "bluetooth", "custom/battery", "tray", "custom/power"],
"custom/launcher": {
"exec": "~/.config/waybar/scripts/distro-icon",
@@ -54,19 +54,49 @@
},
"clock": {
- "format": "{:%H:%M}",
- "format-alt": "{:%a %d %b %H:%M}",
- "tooltip-format": "<tt>{calendar}</tt>",
- "calendar": {
- "mode": "month",
- "weeks-pos": "left",
- "format": {
- "months": "<span color='#5FD4F0'><b>{}</b></span>",
- "weekdays": "<span color='#D4B072'><b>{}</b></span>",
- "weeks": "<span color='#4A5A72'>W{}</span>",
- "today": "<span color='#E0485C'><b><u>{}</u></b></span>"
- }
- }
+ "format": "{:%a %d %b %H:%M}",
+ "tooltip": false,
+ "on-click": "~/.local/bin/calendar"
+ },
+
+ "custom/recording": {
+ "exec": "~/.local/bin/recording-status",
+ "return-type": "json",
+ "interval": 5,
+ "signal": 11,
+ "on-click": "~/.local/bin/screenshot -r"
+ },
+
+ "custom/updates": {
+ "exec": "~/.local/bin/updates status",
+ "return-type": "json",
+ "interval": 3600,
+ "signal": 13,
+ "on-click": "~/.local/bin/updates run"
+ },
+
+ "idle_inhibitor": {
+ "format": "{icon}",
+ "format-icons": { "activated": "", "deactivated": "" },
+ "tooltip-format-activated": "Staying awake (no auto-lock)\nClick to allow locking",
+ "tooltip-format-deactivated": "Auto-lock after 5 min\nClick to stay awake"
+ },
+
+ "custom/nightlight": {
+ "exec": "~/.local/bin/nightlight status",
+ "return-type": "json",
+ "interval": "once",
+ "signal": 12,
+ "on-click": "~/.local/bin/nightlight toggle"
+ },
+
+ "custom/dnd": {
+ "exec": "~/.local/bin/dnd status",
+ "return-type": "json",
+ "interval": 5,
+ "signal": 10,
+ "on-click": "~/.local/bin/notifications",
+ "on-click-right": "~/.local/bin/dnd toggle"
},
"memory": {
diff --git a/waybar/style.css b/waybar/style.css
index 6327efd..de6d101 100644
--- a/waybar/style.css
+++ b/waybar/style.css
@@ -50,6 +50,11 @@ tooltip {
#scratchpad,
#mpris,
#clock,
+#custom-recording,
+#custom-updates,
+#idle_inhibitor,
+#custom-nightlight,
+#custom-dnd,
#memory,
#cpu,
#wireplumber,
@@ -79,6 +84,7 @@ tooltip {
border-color: alpha(@crimson, 0.55);
}
#custom-decor.animated { border-color: alpha(@glow, 0.55); }
+#custom-decor.paused { border-color: alpha(@amber, 0.55); }
#custom-decor:hover { background: alpha(@surface2, 0.95); }
#workspaces { padding: 0 4px; }
@@ -123,6 +129,26 @@ tooltip {
padding: 0 16px;
}
+/* Quick toggles: dim when off, lit when on */
+#idle_inhibitor,
+#custom-nightlight,
+#custom-dnd { color: @subtext0; padding: 0 11px; }
+#idle_inhibitor.activated { color: @peach; border-color: alpha(@peach, 0.55); }
+#custom-nightlight.on { color: @amber; border-color: alpha(@amber, 0.55); }
+#custom-dnd.on { color: @rose; border-color: alpha(@rose, 0.55); }
+
+#custom-updates { color: @gold; }
+
+@keyframes rec-pulse {
+ to { background: alpha(@crimson, 0.35); }
+}
+#custom-recording {
+ color: @text;
+ background: @crimson;
+ border-color: @scarlet;
+ animation: rec-pulse 1s ease-in-out infinite alternate;
+}
+
#memory { color: @frost; }
#cpu { color: @sky; }
#memory.warning,