From 3ac8ca1f5efc4a3adb205e9aaa3e5d82ce7dea7a Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Wed, 26 Mar 2025 23:25:25 +0100 Subject: [PATCH 01/10] rust stuff(tm) --- flake.nix | 10 ---------- programs/flip-bool/src/main.rs | 20 +++++++------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/flake.nix b/flake.nix index 8f30908..e5c7897 100644 --- a/flake.nix +++ b/flake.nix @@ -54,18 +54,8 @@ combine [ complete.toolchain ]; - # rs-platform = pkgs.makeRustPlatform { - # cargo = rs-toolchain; - # rustc = rs-toolchain; - # }; crane-lib = (crane.mkLib nixpkgs.legacyPackages.${system}).overrideToolchain rs-toolchain; rs-programs = final: prev: { - # s10e-jrnl = rs-platform.buildRustPackage { - # pname = "jrnl"; - # version = "0.0.1"; - # src = ./programs/jrnl; - # cargoLock.lockFile = ./programs/jrnl/Cargo.lock; - # }; s10e-jrnl = crane-lib.buildPackage { pname = "s10e-bs"; version = "0.0.1"; diff --git a/programs/flip-bool/src/main.rs b/programs/flip-bool/src/main.rs index 0b99ab8..8062888 100644 --- a/programs/flip-bool/src/main.rs +++ b/programs/flip-bool/src/main.rs @@ -1,7 +1,4 @@ -#![feature(iter_array_chunks)] -#![feature(round_char_boundary)] -#![feature(iter_collect_into)] -#![feature(pattern)] +#![feature(pattern, iter_array_chunks, round_char_boundary, iter_collect_into)] use std::{ io::{Read, Write}, @@ -17,17 +14,16 @@ const BOOLS: &[[&str; 2]] = &[ ["no", "yes"], ]; -fn main() { +fn main() -> std::io::Result<()> { let mut input = String::new(); let mut stdin = std::io::stdin(); let mut stdout = std::io::stdout(); - stdin.read_to_string(&mut input).unwrap(); + stdin.read_to_string(&mut input)?; let bool_locs = find_bools(&input); - stdout - .write_all(replace_bools(&mut input, bool_locs).as_bytes()) - .unwrap(); + + stdout.write_all(replace_bools(&mut input, bool_locs).as_bytes()) } type BoolLocs = [[Vec; 2]; BOOL_COUNT]; @@ -96,14 +92,12 @@ fn find_bools(input: &str) -> [[Vec; 2]; BOOL_COUNT] { && char_guard( input[it.1.floor_char_boundary(it.0 - 1)..it.0] .chars() - .last() - .unwrap(), + .last()?, ) && char_guard( input[(last_idx)..(input.ceil_char_boundary(last_idx + 1))] .chars() - .last() - .unwrap(), + .last()?, )) .then_some(it.0) }) From 66c22f7a137484e644c17b2e7380f41b44506787 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Wed, 26 Mar 2025 23:25:41 +0100 Subject: [PATCH 02/10] add fluent reader --- modules/desktop-environment/home/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/desktop-environment/home/default.nix b/modules/desktop-environment/home/default.nix index 06847ca..690a915 100644 --- a/modules/desktop-environment/home/default.nix +++ b/modules/desktop-environment/home/default.nix @@ -1,6 +1,6 @@ {...}: { programs.niri.enable = true; - home-manager.users.jade = {...}: { + home-manager.users.jade = {pkgs, ...}: { imports = [ ./notifications.nix ./terminal.nix @@ -17,6 +17,10 @@ services.network-manager-applet.enable = true; xsession.enable = true; + home.packages = [ + pkgs.fluent-reader + ]; + services.gpg-agent = { enable = true; enableNushellIntegration = true; From 2b8634a56ae15dca3cc3a3e8e6338206085cbcbd Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Wed, 26 Mar 2025 23:25:55 +0100 Subject: [PATCH 03/10] workspace moves from shift to ctrl mod --- .../desktop-environment/home/niri/binds.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/desktop-environment/home/niri/binds.nix b/modules/desktop-environment/home/niri/binds.nix index f0d3f62..df6fbc2 100644 --- a/modules/desktop-environment/home/niri/binds.nix +++ b/modules/desktop-environment/home/niri/binds.nix @@ -54,15 +54,15 @@ "Mod+7".action.focus-workspace = 7; "Mod+8".action.focus-workspace = 8; "Mod+9".action.focus-workspace = 9; - "Mod+Shift+1".action.move-column-to-workspace = 1; - "Mod+Shift+2".action.move-column-to-workspace = 2; - "Mod+Shift+3".action.move-column-to-workspace = 3; - "Mod+Shift+4".action.move-column-to-workspace = 4; - "Mod+Shift+5".action.move-column-to-workspace = 5; - "Mod+Shift+6".action.move-column-to-workspace = 6; - "Mod+Shift+7".action.move-column-to-workspace = 7; - "Mod+Shift+8".action.move-column-to-workspace = 8; - "Mod+Shift+9".action.move-column-to-workspace = 9; + "Mod+Ctrl+1".action.move-column-to-workspace = 1; + "Mod+Ctrl+2".action.move-column-to-workspace = 2; + "Mod+Ctrl+3".action.move-column-to-workspace = 3; + "Mod+Ctrl+4".action.move-column-to-workspace = 4; + "Mod+Ctrl+5".action.move-column-to-workspace = 5; + "Mod+Ctrl+6".action.move-column-to-workspace = 6; + "Mod+Ctrl+7".action.move-column-to-workspace = 7; + "Mod+Ctrl+8".action.move-column-to-workspace = 8; + "Mod+Ctrl+9".action.move-column-to-workspace = 9; # column editing stuffs "Mod+BracketLeft".action.consume-or-expel-window-left = []; From 38ace717a728d8042a34683742915623a2a337b6 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Wed, 26 Mar 2025 23:29:13 +0100 Subject: [PATCH 04/10] add yet another alias --- modules/shell/nu/aliases.nu | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/shell/nu/aliases.nu b/modules/shell/nu/aliases.nu index 3d6bfab..3643f48 100644 --- a/modules/shell/nu/aliases.nu +++ b/modules/shell/nu/aliases.nu @@ -16,6 +16,8 @@ alias cl = cargo clippy; alias cb = cargo build; alias cch = cargo check; +alias jb = just build; + alias togglecaps = xdotool key Caps_Lock; alias TOGGLECAPS = togglecaps; From 2de0639d54e3c24a813e432cfa25eb4d8302cd58 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Thu, 27 Mar 2025 00:06:06 +0100 Subject: [PATCH 05/10] remove xdg portal conf bc that, apparently, works better --- modules/desktop-environment/default.nix | 1 - modules/desktop-environment/xdg-portals.nix | 17 ----------------- 2 files changed, 18 deletions(-) delete mode 100644 modules/desktop-environment/xdg-portals.nix diff --git a/modules/desktop-environment/default.nix b/modules/desktop-environment/default.nix index ef44236..bfd7fde 100644 --- a/modules/desktop-environment/default.nix +++ b/modules/desktop-environment/default.nix @@ -2,7 +2,6 @@ imports = [ ./audio.nix ./eduroam.nix - ./xdg-portals.nix ./home ./media ./dm.nix diff --git a/modules/desktop-environment/xdg-portals.nix b/modules/desktop-environment/xdg-portals.nix deleted file mode 100644 index a15033a..0000000 --- a/modules/desktop-environment/xdg-portals.nix +++ /dev/null @@ -1,17 +0,0 @@ -{pkgs, ...}: { - services.gnome.gnome-keyring.enable = true; - xdg.portal = { - enable = true; - - config.common = { - default = ["gtk"]; - "org.freedesktop.impl.portal.Screencast" = ["gnome"]; - "org.freedesktop.impl.portal.Secret" = ["gnome-keyring"]; - }; - - extraPortals = [ - pkgs.xdg-desktop-portal-gnome - pkgs.xdg-desktop-portal-gtk - ]; - }; -} From 0162bcefd3609a30b0f606303807006e92988159 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Thu, 27 Mar 2025 01:54:57 +0100 Subject: [PATCH 06/10] add privacy screenshare blocking settings --- .../desktop-environment/home/niri/default.nix | 1 + .../desktop-environment/home/niri/privacy.nix | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 modules/desktop-environment/home/niri/privacy.nix diff --git a/modules/desktop-environment/home/niri/default.nix b/modules/desktop-environment/home/niri/default.nix index 8b80d13..d8db4c2 100644 --- a/modules/desktop-environment/home/niri/default.nix +++ b/modules/desktop-environment/home/niri/default.nix @@ -5,6 +5,7 @@ ./input.nix ./binds.nix ./style.nix + ./privacy.nix ]; programs.niri.settings = { outputs."eDP-1" = { diff --git a/modules/desktop-environment/home/niri/privacy.nix b/modules/desktop-environment/home/niri/privacy.nix new file mode 100644 index 0000000..1d4fbee --- /dev/null +++ b/modules/desktop-environment/home/niri/privacy.nix @@ -0,0 +1,21 @@ +{...}: { + programs.niri.settings = { + layer-rules = [ + { + matches = [ + {namespace = "notifications";} + ]; + block-out-from = "screen-capture"; + } + ]; + window-rules = [ + { + matches = [ + {app-id = "^signal|Element|org\.gnome\.Evolution$";} + {title = "^.*(Discord|Beispiel Screenshare block Bug).*$";} + ]; + block-out-from = "screen-capture"; + } + ]; + }; +} From ab35ec8d34bee2ea710af1719fc10cea24cbb097 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Thu, 27 Mar 2025 01:55:30 +0100 Subject: [PATCH 07/10] every sufficiently advanced software project will eventually develop a quirks file. --- .../desktop-environment/home/niri/default.nix | 16 +--------------- modules/desktop-environment/home/niri/quirks.nix | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 modules/desktop-environment/home/niri/quirks.nix diff --git a/modules/desktop-environment/home/niri/default.nix b/modules/desktop-environment/home/niri/default.nix index d8db4c2..b812229 100644 --- a/modules/desktop-environment/home/niri/default.nix +++ b/modules/desktop-environment/home/niri/default.nix @@ -6,6 +6,7 @@ ./binds.nix ./style.nix ./privacy.nix + ./quirks.nix ]; programs.niri.settings = { outputs."eDP-1" = { @@ -26,20 +27,5 @@ ]; } ]; - - window-rules = [ - # TODO: privacy screen rules - { - matches = [ - { - app-id = "steam"; - } - ]; - open-focused = false; - } - ]; - - # fix electron apps not doing wayland - environment.ELECTRON_OZONE_PLATFORM_HINT = "auto"; }; } diff --git a/modules/desktop-environment/home/niri/quirks.nix b/modules/desktop-environment/home/niri/quirks.nix new file mode 100644 index 0000000..ce67532 --- /dev/null +++ b/modules/desktop-environment/home/niri/quirks.nix @@ -0,0 +1,16 @@ +{...}: { + window-rules = [ + # handle steam grabbing focus 1000 times on startup + { + matches = [ + { + app-id = "steam"; + } + ]; + open-focused = false; + } + ]; + + # fix electron apps not doing wayland + environment.ELECTRON_OZONE_PLATFORM_HINT = "auto"; +} From 4c74dd5024d92b47625e3fa7d5dcfcf84a00e360 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Thu, 27 Mar 2025 01:55:37 +0100 Subject: [PATCH 08/10] formatting --- modules/desktop-environment/home/niri/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/desktop-environment/home/niri/default.nix b/modules/desktop-environment/home/niri/default.nix index b812229..f038aee 100644 --- a/modules/desktop-environment/home/niri/default.nix +++ b/modules/desktop-environment/home/niri/default.nix @@ -14,9 +14,7 @@ }; spawn-at-startup = [ - { - command = ["eww" "open-many" "topBar" "bottomBar"]; - } + {command = ["eww" "open-many" "topBar" "bottomBar"];} { command = [ "${pkgs.swaybg}/bin/swaybg" From ac251e6d90ade52fb8e6bba18aa61dc9b3e064d9 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Thu, 27 Mar 2025 01:57:44 +0100 Subject: [PATCH 09/10] start mullvad thing --- .../eww/configDir/bottomBar/bottomBar.yuck | 22 ++++++++++++++----- .../home/eww/configDir/eww.css | 16 ++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/modules/desktop-environment/home/eww/configDir/bottomBar/bottomBar.yuck b/modules/desktop-environment/home/eww/configDir/bottomBar/bottomBar.yuck index fd0bcbe..d955d31 100644 --- a/modules/desktop-environment/home/eww/configDir/bottomBar/bottomBar.yuck +++ b/modules/desktop-environment/home/eww/configDir/bottomBar/bottomBar.yuck @@ -29,7 +29,7 @@ (box :halign "end" ; (label :text "${iceData.speed}km/h") - (iceTacho) + (mullvadThing) ) ) ) @@ -47,14 +47,26 @@ ) ) +(deflisten mullvad + :initial "{\"state\":\"init\"}" + `mullvad status -j listen` +) + +(defwidget mullvadThing [] + (box + :class "container" + (button + :height 16 + :width 16 + :class "mullvad-state-${mullvad.state}" + ) + ) +) + (defwidget iceTacho [] (box :class "iceTacho" :tooltip "Tz${iceTachoData.tzn} (BR ${iceTachoData.br})" - (circular-progress - :value { iceTachoData.frac * 60 + 20 } - :thickness 3 - ) (label :text "${iceTachoData.speed} km/h") ) ) diff --git a/modules/desktop-environment/home/eww/configDir/eww.css b/modules/desktop-environment/home/eww/configDir/eww.css index 81a6604..2d36825 100644 --- a/modules/desktop-environment/home/eww/configDir/eww.css +++ b/modules/desktop-environment/home/eww/configDir/eww.css @@ -33,4 +33,20 @@ label { .traveldingsWindow { border-radius: 15px; +} + +.mullvad-state-connected { + background-color: #98971a +} + +.mullvad-state-connecting { + background-color: #d79921 +} + +.mullvad-state-disconnected { + background-color: #cc241d +} + +.mullvad-state-init { + background-color: #458588 } \ No newline at end of file From 4488cbcf1b05590c5877f0407c298a241cc30393 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Thu, 27 Mar 2025 02:56:33 +0100 Subject: [PATCH 10/10] fix quirks.nix --- .../desktop-environment/home/niri/quirks.nix | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/modules/desktop-environment/home/niri/quirks.nix b/modules/desktop-environment/home/niri/quirks.nix index ce67532..9f92af1 100644 --- a/modules/desktop-environment/home/niri/quirks.nix +++ b/modules/desktop-environment/home/niri/quirks.nix @@ -1,16 +1,18 @@ {...}: { - window-rules = [ - # handle steam grabbing focus 1000 times on startup - { - matches = [ - { - app-id = "steam"; - } - ]; - open-focused = false; - } - ]; + programs.niri.settings = { + window-rules = [ + # handle steam grabbing focus 1000 times on startup + { + matches = [ + { + app-id = "steam"; + } + ]; + open-focused = false; + } + ]; - # fix electron apps not doing wayland - environment.ELECTRON_OZONE_PLATFORM_HINT = "auto"; + # fix electron apps not doing wayland + environment.ELECTRON_OZONE_PLATFORM_HINT = "auto"; + }; }