mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 21:29:12 +02:00
feat: switch to niri+noctalia
This commit is contained in:
parent
a343de7a90
commit
694dd794f7
38 changed files with 3922 additions and 2066 deletions
|
|
@ -2,5 +2,38 @@
|
|||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ kitty element-desktop vesktop spotify-player jq ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
text = ''
|
||||
while :; do
|
||||
case ''${1:-} in
|
||||
-k | --kitty)
|
||||
cmd=(sh -c 'kitty --app-id kittyterm -T kittyterm -o confirm_os_window_close=0 zellij --config ${self}/files/zellij/config-kittyterm.kdl attach --create kittyterm' '&')
|
||||
searchapp="kittyterm"
|
||||
;;
|
||||
-e | --element)
|
||||
cmd=(element-desktop)
|
||||
searchapp="Element"
|
||||
;;
|
||||
-d | --vesktop)
|
||||
cmd=(vesktop)
|
||||
searchapp="vesktop"
|
||||
;;
|
||||
-s | --spotifyplayer)
|
||||
cmd=(sh -c 'kitty --add-id spotifytui -T spotifytui -o confirm_os_window_close=0 spotify_player' '&')
|
||||
searchapp="spotifytui"
|
||||
;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
WIN_INFO=$(niri msg -j windows | jq --arg search "$searchapp" '.[] | select (.app_id | test($search)) | { id, is_focused, workspace_id }')
|
||||
ID=$(echo "$WIN_INFO" | jq -r '.id // empty')
|
||||
|
||||
if [ -z "$ID" ]; then
|
||||
niri msg action spawn -- "''${cmd[@]}"
|
||||
else
|
||||
niri msg action close-window --id "$ID"
|
||||
fi
|
||||
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue