diff --git a/files/workspace-term.sh b/files/workspace-run.sh similarity index 74% rename from files/workspace-term.sh rename to files/workspace-run.sh index 5054850..a7bc1f1 100644 --- a/files/workspace-term.sh +++ b/files/workspace-run.sh @@ -1,7 +1,13 @@ #!/usr/bin/env bash +# Usage: workspace-run.sh [args...] -- dir is appended as last argument +# Examples: +# workspace-run.sh zeditor +# workspace-run.sh sakura --working-directory +cmd=${1:?usage: workspace-run.sh [args...]} +shift + workspace=$(i3-msg -t get_workspaces | jq -r '.[] | select(.focused) | .name') -# Cherche le dossier courant d'un terminal déjà ouvert sur ce bureau terminal_cwd() { local wids wids=$(i3-msg -t get_tree | jq -r " @@ -29,4 +35,4 @@ if [ -z "$dir" ]; then dir=$(grep "^${workspace}=" "$dir_file" 2>/dev/null | cut -d= -f2-) fi -exec sakura --working-directory "${dir:-$HOME}" +exec "$cmd" "$@" "${dir:-$HOME}" diff --git a/home.nix b/home.nix index 362604a..c004f2f 100644 --- a/home.nix +++ b/home.nix @@ -14,8 +14,8 @@ source = ./files/stt-dictate.sh; executable = true; }; - home.file.".local/bin/workspace-term" = { - source = ./files/workspace-term.sh; + home.file.".local/bin/workspace-run" = { + source = ./files/workspace-run.sh; executable = true; }; diff --git a/programs/i3.nix b/programs/i3.nix index 441f0b8..056deed 100644 --- a/programs/i3.nix +++ b/programs/i3.nix @@ -19,7 +19,8 @@ # see https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.keybindings keybindings = pkgs.lib.mkOptionDefault { - "${modifier}+Return" = "exec ~/.local/bin/workspace-term"; + "${modifier}+Return" = "exec ~/.local/bin/workspace-run sakura --working-directory"; + "${modifier}+Shift+Return" = "exec ~/.local/bin/workspace-run zeditor"; ### BÉPO ### "${modifier}+b" = "kill"; @@ -83,6 +84,22 @@ "${modifier}+space" = "exec ~/.local/bin/stt-dictate toggle"; }; + bars = [ + { + statusCommand = "i3status"; + } + { + id = "vmux"; + position = "top"; + statusCommand = "/home/pierre/Code/vibe/vmux/vmux i3bar"; + workspaceButtons = false; + trayOutput = "none"; + colors = { + background = "#0d0d0d"; + }; + } + ]; + startup = [ { command = "nextcloud";