New-laptop readiness: firstrun.sh, --with-apps, DMS theme sync, guarded autostart, doctor checks
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -269,5 +269,7 @@
|
||||
"monoFontFamily": "JetBrains Mono",
|
||||
"displayFontFamily": "JetBrains Mono",
|
||||
"fontWeight": 300,
|
||||
"fontScale": 1
|
||||
"fontScale": 1,
|
||||
"currentThemeName": "pink",
|
||||
"wallpaperFillMode": "Fill"
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
# DankMaterialShell: bar, launcher, control center, notifications (replaces waybar/swaync/rofi launcher)
|
||||
exec_always sh -c 'pgrep -x dms >/dev/null || exec dms run'
|
||||
|
||||
# First login on a new machine: wallpaper + monitor layout (does nothing when already set up)
|
||||
exec ~/.config/sway/firstrun.sh
|
||||
|
||||
# Hotkeys: $mod+d launcher, $mod+n control center, $mod+Shift+n notifications, $mod+Shift+p power menu (set in config / config.d)
|
||||
bindsym --to-code $mod+Shift+v exec dms ipc call clipboard toggle
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Autostart (xdg-autostart does not run under sway). Delayed so the DMS tray is ready; guarded against duplicates.
|
||||
exec sh -c 'sleep 5; pgrep -f "[n]extcloud.*--background" >/dev/null || flatpak run com.nextcloud.desktopclient.nextcloud --background'
|
||||
exec sh -c 'sleep 5; pgrep -f "[R]emmina.* -i" >/dev/null || flatpak run org.remmina.Remmina -i'
|
||||
exec sh -c 'sleep 8; pgrep -x geary >/dev/null || geary --gapplication-service'
|
||||
# Autostart (xdg-autostart does not run under sway). Delayed so the DMS tray is ready;
|
||||
# guarded against duplicates and against apps that are not installed on this machine.
|
||||
exec sh -c 'sleep 5; flatpak info com.nextcloud.desktopclient.nextcloud >/dev/null 2>&1 && ! pgrep -f "[n]extcloud.*--background" >/dev/null && flatpak run com.nextcloud.desktopclient.nextcloud --background'
|
||||
exec sh -c 'sleep 5; flatpak info org.remmina.Remmina >/dev/null 2>&1 && ! pgrep -f "[R]emmina.* -i" >/dev/null && flatpak run org.remmina.Remmina -i'
|
||||
exec sh -c 'sleep 8; command -v geary >/dev/null && ! pgrep -x geary >/dev/null && geary --gapplication-service'
|
||||
|
||||
@@ -22,6 +22,10 @@ if have dms; then
|
||||
pgrep -x dms >/dev/null && ok "dms is running" || { [ -n "${SWAYSOCK:-}" ] && bad "dms is not running" || warn "dms not running (not in session)"; }
|
||||
else bad "dms not installed"; fi
|
||||
[ -f "$CFG/dms/settings.json" ] && ok "DMS settings present" || warn "no DMS settings yet"
|
||||
if have dms && pgrep -x dms >/dev/null; then
|
||||
w=$(dms ipc call wallpaper get 2>/dev/null | head -1)
|
||||
case $w in /*) ok "wallpaper set in DMS ($(basename "$w"))";; *) warn "no wallpaper chosen in DMS yet (firstrun.sh sets one at the next sway start)";; esac
|
||||
fi
|
||||
|
||||
section "Session / portals"
|
||||
if systemctl --user is-active sway-session.target >/dev/null 2>&1; then ok "sway-session.target active"
|
||||
@@ -46,7 +50,7 @@ done
|
||||
|
||||
section "Per-machine config"
|
||||
[ -f "$CFG/sway/config.d/05-outputs.conf" ] && ok "monitor layout (05-outputs.conf)" || warn "no monitor layout yet: run ~/.config/sway/outputs-setup.sh inside sway"
|
||||
for t in grim swappy jq swaylock swayidle brightnessctl wl-copy notify-send; do have "$t" && ok "$t" || warn "$t missing"; done
|
||||
for t in nautilus grim swappy jq swaylock swayidle brightnessctl wl-copy notify-send; do have "$t" && ok "$t" || warn "$t missing"; done
|
||||
|
||||
printf '\n'; [ "$fails" -eq 0 ] && echo "No failures." || echo "$fails failure(s)."
|
||||
exit "$fails"
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
# Runs at every sway start; does something only on a fresh machine (idempotent):
|
||||
# - picks the shipped wallpaper in DMS when none is chosen yet
|
||||
# - generates the monitor layout when this machine has none
|
||||
cfg=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
walls=$HOME/.local/share/backgrounds
|
||||
|
||||
# wait until DMS has registered its IPC targets (up to ~40 s)
|
||||
i=0
|
||||
while [ "$i" -lt 40 ]; do
|
||||
dms ipc show 2>/dev/null | grep -q '^target wallpaper' && break
|
||||
i=$((i+1)); sleep 1
|
||||
done
|
||||
cur=$(dms ipc call wallpaper get 2>/dev/null | head -1)
|
||||
|
||||
# DMS prints the path when a wallpaper is set; anything else means "none yet"
|
||||
case "$cur" in
|
||||
/*) ;;
|
||||
*) [ -f "$walls/kitty.jpg" ] && dms ipc call wallpaper set "$walls/kitty.jpg" >/dev/null 2>&1 ;;
|
||||
esac
|
||||
|
||||
# monitor layout (laptop panel left, the rest to the right); the file is per machine
|
||||
[ -e "$cfg/sway/config.d/05-outputs.conf" ] || "$cfg/sway/outputs-setup.sh" --auto >/dev/null 2>&1
|
||||
exit 0
|
||||
Reference in New Issue
Block a user