fix espanso on elecrta, waybar tweaks, wol experiments

This commit is contained in:
alisceon 2026-01-29 14:08:41 +01:00
parent aceec1d4b5
commit e7632cb5d3
4 changed files with 48 additions and 48 deletions

18
flake.lock generated
View file

@ -205,11 +205,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1769318308, "lastModified": 1769598131,
"narHash": "sha256-Mjx6p96Pkefks3+aA+72lu1xVehb6mv2yTUUqmSet6Q=", "narHash": "sha256-e7VO/kGLgRMbWtpBqdWl0uFg8Y2XWFMdz0uUJvlML8o=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1cd347bf3355fce6c64ab37d3967b4a2cb4b878c", "rev": "fa83fd837f3098e3e678e6cf017b2b36102c7211",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -243,11 +243,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1769619830, "lastModified": 1769690747,
"narHash": "sha256-HSsga0w7sb0/6DTlL/++FsJzquZhfeB7VyQRlRipYNU=", "narHash": "sha256-sCAAgFSXkINqciVgIfsvfhmiwc/HuUNrYYtyLXiHscA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "3067f1733723fd959bd600157a16658764d1743e", "rev": "6534d0bdf753e2e722e9a428fdf379cc2c49f9bb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -264,11 +264,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1769619830, "lastModified": 1769690747,
"narHash": "sha256-HSsga0w7sb0/6DTlL/++FsJzquZhfeB7VyQRlRipYNU=", "narHash": "sha256-sCAAgFSXkINqciVgIfsvfhmiwc/HuUNrYYtyLXiHscA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "3067f1733723fd959bd600157a16658764d1743e", "rev": "6534d0bdf753e2e722e9a428fdf379cc2c49f9bb",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -100,11 +100,14 @@
}; # end swayidle }; # end swayidle
} }
else {}; else {};
hostnameInputs = hostnameInput1 =
if hostName == "tower" then "us,se" if hostName == "tower" then "us"
else "se,us"; else "se";
hostnameInput2 =
if hostName == "tower" then "se"
else "us";
in in
{ {
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
@ -123,6 +126,7 @@
middle_emulation = "enabled"; middle_emulation = "enabled";
click_method = "clickfinger"; click_method = "clickfinger";
clickfinger_button_map = "lrm"; clickfinger_button_map = "lrm";
scroll_factor = "0.6";
}; };
"type:mouse" = { "type:mouse" = {
natural_scroll = "disabled"; natural_scroll = "disabled";
@ -130,7 +134,7 @@
pointer_accel = "0.5"; pointer_accel = "0.5";
}; };
"*" = { "*" = {
xkb_layout = hostnameInputs; xkb_layout = "${hostnameInput1},${hostnameInput2}";
xkb_options = "grp:win_space_toggle"; xkb_options = "grp:win_space_toggle";
}; };
}; # end input }; # end input
@ -253,26 +257,19 @@
toggle_key = "OFF"; toggle_key = "OFF";
preserve_clipboard = true; preserve_clipboard = true;
show_notifications = true; show_notifications = true;
keyboard_layout = { layout="${hostnameInput1}"; };
}; };
}; };
matches = { matches = {
base = { base = {
matches = [ matches = [
{ {
trigger = ":date"; trigger = ":ip ";
replace = "{{currentdate}}"; replace = "{{pubip}} ";
}
{
trigger = ":time";
replace = "{{currenttime}}";
}
{
trigger = ":ip";
replace = "{{pubip}}";
} }
{ {
regex = ":em(?P<emname>\\S+) "; regex = ":em(?P<emname>\\S+) ";
replace = "{{emoji}}"; replace = "{{emoji}} ";
vars = [ vars = [
{ {
name = "emoji"; name = "emoji";
@ -287,16 +284,6 @@
}; };
global_vars = { global_vars = {
global_vars = [ global_vars = [
{
name = "currentdate";
type = "date";
params = {format = "%Y-%m-%d";};
}
{
name = "currenttime";
type = "date";
params = {format = "%R";};
}
{ {
name = "pubip"; name = "pubip";
type = "shell"; type = "shell";
@ -361,6 +348,7 @@
"tray" "tray"
"idle_inhibitor" "idle_inhibitor"
"network" "network"
"bluetooth"
"pulseaudio" "pulseaudio"
"battery" "battery"
"sway/language" "sway/language"
@ -388,12 +376,13 @@
}; };
"sway/language" = { "sway/language" = {
format = "| {flag}"; format = "| {flag}";
tooltip-format = "{long}";
}; };
"clock" = { "clock" = {
interval = 60; interval = 60;
tooltip = true; tooltip = true;
format = "| {:%Y-%m-%d %R}"; format = "| {:%H:%M}";
tooltip-format = "{:%A}"; tooltip-format = "{:%Y-%m-%d}";
}; };
"battery" = { "battery" = {
interval = 60; interval = 60;
@ -415,13 +404,20 @@
format-ethernet = "| "; format-ethernet = "| ";
format-linked = "| 🔗"; format-linked = "| 🔗";
format-disconnected = "| 💥"; format-disconnected = "| 💥";
format-alt = "| {essid}: {ipaddr}";
interval = 15; interval = 15;
on-click = "${uwsm} ${term} -e nmtui";
};
"bluetooth" = {
format-connected = "| ";
format-disconnected = "| ";
interval = 15;
on-click = "${uwsm} ${term} -e bluetui";
}; };
"pulseaudio" = { "pulseaudio" = {
format = "| 🔊{volume}%"; format = "| 🔊{volume}%";
format-muted = "| 🔈0%"; format-muted = "| 🔈0%";
format-bluetooth = "| 🎧{volume}%"; format-bluetooth = "| 🎧{volume}%";
on-click = "${uwsm} pavucontrol";
}; };
}; # end mainbar }; # end mainbar
}; # end settings }; # end settings
@ -502,7 +498,6 @@
}; };
}; };
}; };
systemd.user.sessionVariables = { systemd.user.sessionVariables = {
# this right here offends me https://source.chromium.org/chromium/chromium/src/+/main:base/nix/xdg_util.cc;l=179-180 # 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 # setting GNOME_DESKTOP_SESSION_ID will fool some legacy systems into thinking we're running gnome

View file

@ -4,9 +4,6 @@
imports = imports =
[ ./hardware-configuration.nix ]; [ ./hardware-configuration.nix ];
networking.hostName = "electra"; networking.hostName = "electra";
environment.systemPackages = with pkgs; [
wakeonlan
];
boot = { boot = {
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true; loader.efi.canTouchEfiVariables = true;
@ -17,6 +14,10 @@
}; };
#resumeDevice = "/dev/disk/by-uuid/c49249b9-0d68-44af-97e0-e399c8409408"; #resumeDevice = "/dev/disk/by-uuid/c49249b9-0d68-44af-97e0-e399c8409408";
}; # end boot }; # end boot
environment.systemPackages = [
pkgs.bluetui
pkgs.wakeonlan
];
systemd.services = { systemd.services = {
fprintd = { fprintd = {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];

View file

@ -11,7 +11,7 @@ TARGET_HOSTNAME = "tower.home.the.malice.zone"
TARGET_IP = socket.gethostbyname(TARGET_HOSTNAME) TARGET_IP = socket.gethostbyname(TARGET_HOSTNAME)
def remote_cmd(command): 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) response = subprocess.run(f"ssh tower '{command}'", shell=True, capture_output=True, text=True)
return (response.returncode, response.stdout, response.stderr) return (response.returncode, response.stdout, response.stderr)
@ -20,7 +20,7 @@ def weboot():
code, stdout, stderr = remote_cmd("sudo efibootmgr -n 0000") code, stdout, stderr = remote_cmd("sudo efibootmgr -n 0000")
if code == 0: if code == 0:
code, stdout, stderr = remote_cmd("sudo reboot") code, stdout, stderr = remote_cmd("sudo reboot")
time.sleep(60) time.sleep(120)
if code != 0: if code != 0:
raise RuntimeError(f"weboot failed {stderr}") raise RuntimeError(f"weboot failed {stderr}")
return code, stdout, stderr return code, stdout, stderr
@ -38,7 +38,7 @@ def get_os():
return "offline" return "offline"
elif code != 0: elif code != 0:
raise RuntimeError(f"win_or_linux failed {stderr}") raise RuntimeError(f"win_or_linux failed {stderr}")
if "windows" in stdout.lower(): if "tower\\alisceon" in stdout.lower():
print("Target is running Windows") print("Target is running Windows")
return "windows" return "windows"
else: else:
@ -108,16 +108,20 @@ def shutdown():
print("Shutting down target") print("Shutting down target")
match get_os(): match get_os():
case "windows": case "windows":
code, stdout, stderr = remote_cmd("shutdown /s") code, stdout, stderr = remote_cmd("shutdown /s /t 0")
time.sleep(30) time.sleep(30)
return True
case "linux": case "linux":
code, stdout, stderr = remote_cmd("sudo shutdown -h now") code, stdout, stderr = remote_cmd("sudo shutdown -h now")
time.sleep(30) time.sleep(30)
return True
case "offline": case "offline":
print("Target is already offline") print("Target is already offline")
return False 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): def action_do(action):
match action: match action: