diff --git a/flake.lock b/flake.lock index f139a46..1bb0c32 100644 --- a/flake.lock +++ b/flake.lock @@ -205,11 +205,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1769318308, - "narHash": "sha256-Mjx6p96Pkefks3+aA+72lu1xVehb6mv2yTUUqmSet6Q=", + "lastModified": 1769598131, + "narHash": "sha256-e7VO/kGLgRMbWtpBqdWl0uFg8Y2XWFMdz0uUJvlML8o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1cd347bf3355fce6c64ab37d3967b4a2cb4b878c", + "rev": "fa83fd837f3098e3e678e6cf017b2b36102c7211", "type": "github" }, "original": { @@ -243,11 +243,11 @@ ] }, "locked": { - "lastModified": 1769619830, - "narHash": "sha256-HSsga0w7sb0/6DTlL/++FsJzquZhfeB7VyQRlRipYNU=", + "lastModified": 1769690747, + "narHash": "sha256-sCAAgFSXkINqciVgIfsvfhmiwc/HuUNrYYtyLXiHscA=", "owner": "nix-community", "repo": "NUR", - "rev": "3067f1733723fd959bd600157a16658764d1743e", + "rev": "6534d0bdf753e2e722e9a428fdf379cc2c49f9bb", "type": "github" }, "original": { @@ -264,11 +264,11 @@ ] }, "locked": { - "lastModified": 1769619830, - "narHash": "sha256-HSsga0w7sb0/6DTlL/++FsJzquZhfeB7VyQRlRipYNU=", + "lastModified": 1769690747, + "narHash": "sha256-sCAAgFSXkINqciVgIfsvfhmiwc/HuUNrYYtyLXiHscA=", "owner": "nix-community", "repo": "NUR", - "rev": "3067f1733723fd959bd600157a16658764d1743e", + "rev": "6534d0bdf753e2e722e9a428fdf379cc2c49f9bb", "type": "github" }, "original": { diff --git a/home/wm/sway.nix b/home/wm/sway.nix index 9b94396..20a56db 100644 --- a/home/wm/sway.nix +++ b/home/wm/sway.nix @@ -100,11 +100,14 @@ }; # end swayidle } else {}; - hostnameInputs = - if hostName == "tower" then "us,se" - else "se,us"; + hostnameInput1 = + if hostName == "tower" then "us" + else "se"; + hostnameInput2 = + if hostName == "tower" then "se" + else "us"; in - { +{ wayland.windowManager.sway = { enable = true; wrapperFeatures.gtk = true; @@ -123,6 +126,7 @@ middle_emulation = "enabled"; click_method = "clickfinger"; clickfinger_button_map = "lrm"; + scroll_factor = "0.6"; }; "type:mouse" = { natural_scroll = "disabled"; @@ -130,7 +134,7 @@ pointer_accel = "0.5"; }; "*" = { - xkb_layout = hostnameInputs; + xkb_layout = "${hostnameInput1},${hostnameInput2}"; xkb_options = "grp:win_space_toggle"; }; }; # end input @@ -253,26 +257,19 @@ toggle_key = "OFF"; preserve_clipboard = true; show_notifications = true; + keyboard_layout = { layout="${hostnameInput1}"; }; }; }; matches = { base = { matches = [ { - trigger = ":date"; - replace = "{{currentdate}}"; - } - { - trigger = ":time"; - replace = "{{currenttime}}"; - } - { - trigger = ":ip"; - replace = "{{pubip}}"; + trigger = ":ip "; + replace = "{{pubip}} "; } { regex = ":em(?P\\S+) "; - replace = "{{emoji}}"; + replace = "{{emoji}} "; vars = [ { name = "emoji"; @@ -287,16 +284,6 @@ }; global_vars = { global_vars = [ - { - name = "currentdate"; - type = "date"; - params = {format = "%Y-%m-%d";}; - } - { - name = "currenttime"; - type = "date"; - params = {format = "%R";}; - } { name = "pubip"; type = "shell"; @@ -361,6 +348,7 @@ "tray" "idle_inhibitor" "network" + "bluetooth" "pulseaudio" "battery" "sway/language" @@ -388,12 +376,13 @@ }; "sway/language" = { format = "| {flag}"; + tooltip-format = "{long}"; }; "clock" = { interval = 60; tooltip = true; - format = "| {:%Y-%m-%d %R}"; - tooltip-format = "{:%A}"; + format = "| {:%H:%M}"; + tooltip-format = "{:%Y-%m-%d}"; }; "battery" = { interval = 60; @@ -415,13 +404,20 @@ format-ethernet = "| ⇄"; format-linked = "| 🔗"; format-disconnected = "| ⛓️‍💥"; - format-alt = "| {essid}: {ipaddr}"; interval = 15; + on-click = "${uwsm} ${term} -e nmtui"; + }; + "bluetooth" = { + format-connected = "| ᛒ"; + format-disconnected = "| ᚧ"; + interval = 15; + on-click = "${uwsm} ${term} -e bluetui"; }; "pulseaudio" = { format = "| 🔊{volume}%"; format-muted = "| 🔈0%"; format-bluetooth = "| 🎧{volume}%"; + on-click = "${uwsm} pavucontrol"; }; }; # end mainbar }; # end settings @@ -502,7 +498,6 @@ }; }; }; - systemd.user.sessionVariables = { # this right here offends me https://source.chromium.org/chromium/chromium/src/+/main:base/nix/xdg_util.cc;l=179-180 # setting GNOME_DESKTOP_SESSION_ID will fool some legacy systems into thinking we're running gnome diff --git a/hosts/electra/configuration.nix b/hosts/electra/configuration.nix index 9e97c89..3bd45da 100644 --- a/hosts/electra/configuration.nix +++ b/hosts/electra/configuration.nix @@ -4,9 +4,6 @@ imports = [ ./hardware-configuration.nix ]; networking.hostName = "electra"; - environment.systemPackages = with pkgs; [ - wakeonlan - ]; boot = { loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = true; @@ -17,6 +14,10 @@ }; #resumeDevice = "/dev/disk/by-uuid/c49249b9-0d68-44af-97e0-e399c8409408"; }; # end boot + environment.systemPackages = [ + pkgs.bluetui + pkgs.wakeonlan + ]; systemd.services = { fprintd = { wantedBy = [ "multi-user.target" ]; diff --git a/util/wol_man.py b/util/wol_man.py index c0d58fa..a4e9865 100644 --- a/util/wol_man.py +++ b/util/wol_man.py @@ -11,7 +11,7 @@ TARGET_HOSTNAME = "tower.home.the.malice.zone" TARGET_IP = socket.gethostbyname(TARGET_HOSTNAME) def remote_cmd(command): - print(f"Executing: ssh tower '{command}'") + print(f"Executing: ssh alisceon@tower.home.the.malice.zone '{command}'") response = subprocess.run(f"ssh tower '{command}'", shell=True, capture_output=True, text=True) return (response.returncode, response.stdout, response.stderr) @@ -20,7 +20,7 @@ def weboot(): code, stdout, stderr = remote_cmd("sudo efibootmgr -n 0000") if code == 0: code, stdout, stderr = remote_cmd("sudo reboot") - time.sleep(60) + time.sleep(120) if code != 0: raise RuntimeError(f"weboot failed {stderr}") return code, stdout, stderr @@ -38,7 +38,7 @@ def get_os(): return "offline" elif code != 0: raise RuntimeError(f"win_or_linux failed {stderr}") - if "windows" in stdout.lower(): + if "tower\\alisceon" in stdout.lower(): print("Target is running Windows") return "windows" else: @@ -108,16 +108,20 @@ def shutdown(): print("Shutting down target") match get_os(): case "windows": - code, stdout, stderr = remote_cmd("shutdown /s") + code, stdout, stderr = remote_cmd("shutdown /s /t 0") time.sleep(30) - return True case "linux": code, stdout, stderr = remote_cmd("sudo shutdown -h now") time.sleep(30) - return True case "offline": print("Target is already offline") return False + if get_os() == "offline": + print("Target is now offline") + return True + else: + print("Failed to shut down target") + return False def action_do(action): match action: