feat: généraliser workspace-run pour ouvrir terminal ou éditeur dans le dossier du workspace
- Remplace workspace-term.sh par workspace-run.sh (commande en paramètre) - mod+Return → sakura, mod+Shift+Return → zeditor Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Usage: workspace-run.sh <command> [args...] -- dir is appended as last argument
|
||||||
|
# Examples:
|
||||||
|
# workspace-run.sh zeditor
|
||||||
|
# workspace-run.sh sakura --working-directory
|
||||||
|
cmd=${1:?usage: workspace-run.sh <command> [args...]}
|
||||||
|
shift
|
||||||
|
|
||||||
workspace=$(i3-msg -t get_workspaces | jq -r '.[] | select(.focused) | .name')
|
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() {
|
terminal_cwd() {
|
||||||
local wids
|
local wids
|
||||||
wids=$(i3-msg -t get_tree | jq -r "
|
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-)
|
dir=$(grep "^${workspace}=" "$dir_file" 2>/dev/null | cut -d= -f2-)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec sakura --working-directory "${dir:-$HOME}"
|
exec "$cmd" "$@" "${dir:-$HOME}"
|
||||||
4
home.nix
4
home.nix
@@ -14,8 +14,8 @@
|
|||||||
source = ./files/stt-dictate.sh;
|
source = ./files/stt-dictate.sh;
|
||||||
executable = true;
|
executable = true;
|
||||||
};
|
};
|
||||||
home.file.".local/bin/workspace-term" = {
|
home.file.".local/bin/workspace-run" = {
|
||||||
source = ./files/workspace-term.sh;
|
source = ./files/workspace-run.sh;
|
||||||
executable = true;
|
executable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,8 @@
|
|||||||
|
|
||||||
# see https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.keybindings
|
# see https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.keybindings
|
||||||
keybindings = pkgs.lib.mkOptionDefault {
|
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 ###
|
### BÉPO ###
|
||||||
"${modifier}+b" = "kill";
|
"${modifier}+b" = "kill";
|
||||||
@@ -83,6 +84,22 @@
|
|||||||
"${modifier}+space" = "exec ~/.local/bin/stt-dictate toggle";
|
"${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 = [
|
startup = [
|
||||||
{
|
{
|
||||||
command = "nextcloud";
|
command = "nextcloud";
|
||||||
|
|||||||
Reference in New Issue
Block a user