From 90532b966248c57d84c77301dd59ad2c54f943e3 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Fri, 21 Oct 2022 08:38:19 +0200 Subject: [PATCH] fixing i3 and make sure select browser is not starting by accident --- nixos/modules/programs/browser.nix | 1 + nixos/system/desktop/home-manager/i3.nix | 40 ++++++++++++------------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/nixos/modules/programs/browser.nix b/nixos/modules/programs/browser.nix index e7e2958..d8728e9 100644 --- a/nixos/modules/programs/browser.nix +++ b/nixos/modules/programs/browser.nix @@ -161,6 +161,7 @@ let case $BROWSER in ${lib.concatStringsSep "\n" (flip map browserExecutableList (bin: "${bin.name}) export BIN=${bin}/bin/${bin.name} ;;"))} + *) exit 0 ;; esac $BIN "$@" ''; diff --git a/nixos/system/desktop/home-manager/i3.nix b/nixos/system/desktop/home-manager/i3.nix index 5cacb34..376b7e1 100644 --- a/nixos/system/desktop/home-manager/i3.nix +++ b/nixos/system/desktop/home-manager/i3.nix @@ -11,6 +11,15 @@ let background = theme.base03; }; + # switch to named workspaces + i3-wk-switch = pkgs.i3-wk-switch.overrideAttrs (old: { + src = pkgs.fetchFromGitHub { + owner = "tmfink"; + repo = "i3-wk-switch"; + rev = "5f43bb8cbe7938eff476fc534b61c8fb6a700c8f"; + sha256 = "sha256-DOBPI/wO+S8a6EzWJeVGODXeSixFl7SHTtHAq5DG8GU="; + }; + }); backgroundCommand = pkgs.writers.writeDash "background" '' ${pkgs.xorg.xrandr}/bin/xrandr | grep " connected" | \ @@ -208,16 +217,16 @@ in "${cfg.config.modifier}+Shift+minus" = "move scratchpad"; "${cfg.config.modifier}+minus" = "scratchpad show"; - "${cfg.config.modifier}+1" = "exec --no-startup-id ${pkgs.i3-wk-switch}/bin/i3-wk-switch 1"; - "${cfg.config.modifier}+2" = "exec --no-startup-id ${pkgs.i3-wk-switch}/bin/i3-wk-switch 2"; - "${cfg.config.modifier}+3" = "exec --no-startup-id ${pkgs.i3-wk-switch}/bin/i3-wk-switch 3"; - "${cfg.config.modifier}+4" = "exec --no-startup-id ${pkgs.i3-wk-switch}/bin/i3-wk-switch 4"; - "${cfg.config.modifier}+5" = "exec --no-startup-id ${pkgs.i3-wk-switch}/bin/i3-wk-switch 5"; - "${cfg.config.modifier}+6" = "exec --no-startup-id ${pkgs.i3-wk-switch}/bin/i3-wk-switch 6"; - "${cfg.config.modifier}+7" = "exec --no-startup-id ${pkgs.i3-wk-switch}/bin/i3-wk-switch 7"; - "${cfg.config.modifier}+8" = "exec --no-startup-id ${pkgs.i3-wk-switch}/bin/i3-wk-switch 8"; - "${cfg.config.modifier}+9" = "exec --no-startup-id ${pkgs.i3-wk-switch}/bin/i3-wk-switch 9"; - "${cfg.config.modifier}+0" = "exec --no-startup-id ${pkgs.i3-wk-switch}/bin/i3-wk-switch 10"; + "${cfg.config.modifier}+1" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 1"; + "${cfg.config.modifier}+2" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 2"; + "${cfg.config.modifier}+3" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 3"; + "${cfg.config.modifier}+4" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 4"; + "${cfg.config.modifier}+5" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 5"; + "${cfg.config.modifier}+6" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 6"; + "${cfg.config.modifier}+7" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 7"; + "${cfg.config.modifier}+8" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 8"; + "${cfg.config.modifier}+9" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 9"; + "${cfg.config.modifier}+0" = "exec --no-startup-id ${i3-wk-switch}/bin/i3-wk-switch 10"; "${cfg.config.modifier}+Shift+1" = "move container to workspace number 1"; "${cfg.config.modifier}+Shift+2" = "move container to workspace number 2"; @@ -239,15 +248,6 @@ in "${cfg.config.modifier}+grave" = let - i3-wk-switch-pr = pkgs.i3-wk-switch.overrideAttrs (old: { - src = pkgs.fetchFromGitHub { - owner = "tmfink"; - repo = "i3-wk-switch"; - rev = "bef4d50cec9c731259001a10cc03a8e972e72d9d"; - sha256 = "sha256-jxd7jxQK0ESVrZ8a1o0IBetWHKh73GD7ch1xAMUDAPE="; - }; - - }); script = pkgs.writers.writeBash "select-workspace" '' set -e set -o pipefail @@ -256,7 +256,7 @@ in ${pkgs.rofi}/bin/rofi -dmenu -p 'Select Workspace' | \ while read line do - ${pkgs.i3}/bin/i3-msg workspace "$line" + ${i3-wk-switch}/bin/i3-wk-switch "$line" done ''; in