diff --git a/flake.nix b/flake.nix index e5c7897..8f30908 100644 --- a/flake.nix +++ b/flake.nix @@ -54,8 +54,18 @@ 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/modules/desktop-environment/default.nix b/modules/desktop-environment/default.nix index bfd7fde..ef44236 100644 --- a/modules/desktop-environment/default.nix +++ b/modules/desktop-environment/default.nix @@ -2,6 +2,7 @@ imports = [ ./audio.nix ./eduroam.nix + ./xdg-portals.nix ./home ./media ./dm.nix diff --git a/modules/desktop-environment/home/default.nix b/modules/desktop-environment/home/default.nix index 690a915..06847ca 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 = {pkgs, ...}: { + home-manager.users.jade = {...}: { imports = [ ./notifications.nix ./terminal.nix @@ -17,10 +17,6 @@ services.network-manager-applet.enable = true; xsession.enable = true; - home.packages = [ - pkgs.fluent-reader - ]; - services.gpg-agent = { enable = true; enableNushellIntegration = true; diff --git a/modules/desktop-environment/home/eww/configDir/bottomBar/bottomBar.yuck b/modules/desktop-environment/home/eww/configDir/bottomBar/bottomBar.yuck index d955d31..fd0bcbe 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") - (mullvadThing) + (iceTacho) ) ) ) @@ -47,26 +47,14 @@ ) ) -(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 2d36825..81a6604 100644 --- a/modules/desktop-environment/home/eww/configDir/eww.css +++ b/modules/desktop-environment/home/eww/configDir/eww.css @@ -33,20 +33,4 @@ 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 diff --git a/modules/desktop-environment/home/niri/binds.nix b/modules/desktop-environment/home/niri/binds.nix index df6fbc2..f0d3f62 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+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; + "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; # column editing stuffs "Mod+BracketLeft".action.consume-or-expel-window-left = []; diff --git a/modules/desktop-environment/home/niri/default.nix b/modules/desktop-environment/home/niri/default.nix index f038aee..8b80d13 100644 --- a/modules/desktop-environment/home/niri/default.nix +++ b/modules/desktop-environment/home/niri/default.nix @@ -5,8 +5,6 @@ ./input.nix ./binds.nix ./style.nix - ./privacy.nix - ./quirks.nix ]; programs.niri.settings = { outputs."eDP-1" = { @@ -14,7 +12,9 @@ }; spawn-at-startup = [ - {command = ["eww" "open-many" "topBar" "bottomBar"];} + { + command = ["eww" "open-many" "topBar" "bottomBar"]; + } { command = [ "${pkgs.swaybg}/bin/swaybg" @@ -25,5 +25,20 @@ ]; } ]; + + 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/privacy.nix b/modules/desktop-environment/home/niri/privacy.nix deleted file mode 100644 index 1d4fbee..0000000 --- a/modules/desktop-environment/home/niri/privacy.nix +++ /dev/null @@ -1,21 +0,0 @@ -{...}: { - 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"; - } - ]; - }; -} diff --git a/modules/desktop-environment/home/niri/quirks.nix b/modules/desktop-environment/home/niri/quirks.nix deleted file mode 100644 index 9f92af1..0000000 --- a/modules/desktop-environment/home/niri/quirks.nix +++ /dev/null @@ -1,18 +0,0 @@ -{...}: { - 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"; - }; -} diff --git a/modules/desktop-environment/xdg-portals.nix b/modules/desktop-environment/xdg-portals.nix new file mode 100644 index 0000000..a15033a --- /dev/null +++ b/modules/desktop-environment/xdg-portals.nix @@ -0,0 +1,17 @@ +{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 + ]; + }; +} diff --git a/modules/shell/nu/aliases.nu b/modules/shell/nu/aliases.nu index 3643f48..3d6bfab 100644 --- a/modules/shell/nu/aliases.nu +++ b/modules/shell/nu/aliases.nu @@ -16,8 +16,6 @@ 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; diff --git a/programs/flip-bool/src/main.rs b/programs/flip-bool/src/main.rs index 8062888..0b99ab8 100644 --- a/programs/flip-bool/src/main.rs +++ b/programs/flip-bool/src/main.rs @@ -1,4 +1,7 @@ -#![feature(pattern, iter_array_chunks, round_char_boundary, iter_collect_into)] +#![feature(iter_array_chunks)] +#![feature(round_char_boundary)] +#![feature(iter_collect_into)] +#![feature(pattern)] use std::{ io::{Read, Write}, @@ -14,16 +17,17 @@ const BOOLS: &[[&str; 2]] = &[ ["no", "yes"], ]; -fn main() -> std::io::Result<()> { +fn main() { let mut input = String::new(); let mut stdin = std::io::stdin(); let mut stdout = std::io::stdout(); - stdin.read_to_string(&mut input)?; + stdin.read_to_string(&mut input).unwrap(); let bool_locs = find_bools(&input); - - stdout.write_all(replace_bools(&mut input, bool_locs).as_bytes()) + stdout + .write_all(replace_bools(&mut input, bool_locs).as_bytes()) + .unwrap(); } type BoolLocs = [[Vec; 2]; BOOL_COUNT]; @@ -92,12 +96,14 @@ fn find_bools(input: &str) -> [[Vec; 2]; BOOL_COUNT] { && char_guard( input[it.1.floor_char_boundary(it.0 - 1)..it.0] .chars() - .last()?, + .last() + .unwrap(), ) && char_guard( input[(last_idx)..(input.ceil_char_boundary(last_idx + 1))] .chars() - .last()?, + .last() + .unwrap(), )) .then_some(it.0) })