From 73391c83177ad96643aa3df5ace4ca7e424b447e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 24 Mar 2025 11:17:52 +0100 Subject: ... --- accounts/gkleen@sif/niri/default.nix | 28 +++++-------- modules/envfs.nix | 77 ------------------------------------ 2 files changed, 10 insertions(+), 95 deletions(-) delete mode 100644 modules/envfs.nix diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index e4a93a49..302baea9 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix @@ -387,6 +387,8 @@ in { in [ (flag "prefer-no-csd") + (leaf "screenshot-path" "~/screenshots/%Y-%m-%dT%H:%M:%S.png") + (plain "hotkey-overlay" [ (flag "skip-at-startup") ]) @@ -703,27 +705,17 @@ in { wl-copy "$(cut -d ':' -f 1 <<<"$FUZZEL_RES" | tr -d '\n')" && wtype -k XF86Paste ''; })); - "Print".action = spawn (lib.getExe (pkgs.writeShellApplication { - name = "screenshot"; - runtimeInputs = with pkgs; [ grim slurp wl-clipboard-rs coreutils ]; - text = '' - grim -g "$(slurp -b 00000080 -c FFFFFFFF -s 00000000 -w 1)" - \ - | tee "$HOME/screenshots/$(date +"%Y-%m-%dT%H:%M:%S").png" \ - | wl-copy --type image/png - ''; - })); - "Shift+Print".action = spawn (lib.getExe (pkgs.writeShellApplication { - name = "screenshot"; - runtimeInputs = with pkgs; [ grim niri gojq wl-clipboard-rs coreutils ]; - text = '' - grim -o "$(niri msg -j workspaces | jq -r '.[] | select(.is_focused) | .output')" - \ - | tee "$HOME/screenshots/$(date +"%Y-%m-%dT%H:%M:%S").png" \ - | wl-copy --type image/png - ''; - })); + "Print".action = screenshot; + "Control+Print".action = screenshot-window; + # "Shift+Print".action = screenshot-screen; "Mod+B".action = with-select-window-action ".workspace_id == ($active_workspace | tonumber)" "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}"; "Mod+Shift+B".action = with-select-window-action "true" "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}"; + "Mod+Escape" = { + allow-inhibiting = false; + action = toggle-keyboard-shortcuts-inhibit; + }; + "Mod+H".action = focus-column-left; "Mod+T".action = focus-window-down; "Mod+N".action = focus-window-up; diff --git a/modules/envfs.nix b/modules/envfs.nix deleted file mode 100644 index b5b453a5..00000000 --- a/modules/envfs.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ pkgs, config, lib, ... }: - -let - cfg = config.services.envfs; - mounts = { - "/usr/bin" = { - device = "none"; - fsType = "envfs"; - options = [ - "bind-mount=/bin" - "fallback-path=${pkgs.symlinkJoin { - name = "fallback-path"; - inherit (cfg) paths; - }}" - "nofail" - ]; - }; - "/bin" = { - device = "/usr/bin"; - fsType = "none"; - options = [ "bind" "nofail" ]; - }; - }; -in { - disabledModules = [ "tasks/filesystems/envfs.nix" ]; - - options = { - services.envfs = { - enable = lib.mkEnableOption "Envfs filesystem" // { - default = true; - description = '' - Fuse filesystem that returns symlinks to executables based on the PATH - of the requesting process. This is useful to execute shebangs on NixOS - that assume hard coded locations in locations like /bin or /usr/bin - etc. - ''; - }; - - package = lib.mkOption { - type = lib.types.package; - default = pkgs.envfs; - defaultText = lib.literalExpression "pkgs.envfs"; - description = "Which package to use for the envfs."; - }; - - paths = lib.mkOption { - type = lib.types.listOf lib.types.package; - default = [ - (pkgs.runCommand "fallback-path-environment" {} '' - mkdir -p $out - ln -s ${config.environment.usrbinenv} $out/env - ln -s ${config.environment.binsh} $out/sh - '') - ]; - defaultText = lib.literalExpression '' - [ (pkgs.runCommand "fallback-path-environment" {} ''' - mkdir -p $out - ln -s ''${config.environment.usrbinenv} $out/env - ln -s ''${config.environment.binsh} $out/sh - ''') - ] - ''; - description = "Extra packages to join into collection of fallback executables in case not other executable is found"; - }; - }; - }; - - config = lib.mkIf (cfg.enable) { - environment.systemPackages = [ cfg.package ]; - # we also want these mounts in virtual machines. - fileSystems = if config.virtualisation ? qemu then lib.mkVMOverride mounts else mounts; - - # We no longer need those when using envfs - system.activationScripts.usrbinenv = lib.mkForce ""; - system.activationScripts.binsh = lib.mkForce ""; - }; -} -- cgit v1.2.3