Step 1 of the home-manager/desktop simplification from docs/roadmap.md
-- lukas only needs plain workspace switching (Super+1-9, already had
that under Hyprland too), not a full compositor with animations/Lua
rules/window decorations. sway is the natural minimal replacement:
i3-compatible, single plain config, no plugin system.
- hosts/tnix/configuration.nix: programs.hyprland.enable ->
programs.sway.enable
- home/tnix/localModules/hyprland.nix + hyprpaper.nix -> sway.nix.
Ported: workspace 1-9 bindings (same dynamic generation as before),
app launchers (kitty/alacritty+aerc/keepassxc/qutebrowser/btop),
volume/brightness, drive mount/unmount, wallpaper (via sway's own
output bg, no separate daemon needed). Screenshot binding swapped
from grimblast (Hyprland-ecosystem tool) to plain grim+slurp+wl-copy.
Dropped as explicitly out of scope ("brauche kein Hyprland, Workspaces
reichen"): the clock-toggle widget and light/dark theme-toggle script
in packages.nix, both hyprctl/hyprpaper-specific with no sway
equivalent -- can be rebuilt later if actually wanted.
- Notifications: hyprctl notify (used here, in bat.nix's battery
script, and in the system-level battery-monitor.nix) has no sway
equivalent; switched all three to notify-send + a new mako service
(the standard minimal sway-ecosystem notification daemon).
Verified: nix flake check + full local build of the tnix toplevel both
succeed (needed wayland.windowManager.sway.checkConfig = false -- the
build-time config validator can't reach the wallpaper file under
/home/builder, a documented sway/home-manager limitation, not a real
config error). Cannot go further than this: tnix has been offline for
this entire session, so no nixos-rebuild test/switch or actual visual
verification is possible yet -- do that the next time tnix is on,
before relying on this.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
40 lines
937 B
Nix
40 lines
937 B
Nix
{config, ...}:
|
||
{
|
||
home.file.".config/battery_notify/notify_if_on_battery.sh" = {
|
||
text = ''
|
||
#!/usr/bin/env bash
|
||
|
||
AC_PATH="/sys/class/power_supply/AC/online" # evtl. anpassen
|
||
|
||
if [ -f "$AC_PATH" ]; then
|
||
AC_STATUS=$(cat "$AC_PATH")
|
||
|
||
if [ "$AC_STATUS" -eq 0 ]; then
|
||
notify-send -u normal "🔋 Du bist nicht am Strom!"
|
||
fi
|
||
else
|
||
notify-send -u critical "⚠️ AC-Status nicht gefunden"
|
||
fi
|
||
'';
|
||
executable = true;
|
||
};
|
||
|
||
|
||
systemd.user.services.notify-on-battery = {
|
||
Unit.Description = "Notify when on battery";
|
||
Service = {
|
||
Type = "oneshot";
|
||
ExecStart = "${config.home.homeDirectory}/.config/battery_notify/notify_if_on_battery.sh";
|
||
};
|
||
};
|
||
|
||
systemd.user.timers.notify-on-battery = {
|
||
Unit.Description = "Check battery status every 2 minutes";
|
||
Timer = {
|
||
OnBootSec = "30s";
|
||
OnUnitActiveSec = "5min";
|
||
};
|
||
Install.WantedBy = [ "default.target" ];
|
||
};
|
||
|
||
}
|