mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 13:19:09 +02:00
chore: change to native nix scripts
This commit is contained in:
parent
80c08a6d19
commit
7ad9d84109
42 changed files with 2071 additions and 2102 deletions
|
|
@ -1,6 +1,30 @@
|
|||
{ self, name, writeShellApplication, emacs30-pgtk, sway, jq }:
|
||||
{ name, writeShellApplication, emacs30-pgtk, sway, jq, ... }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ emacs30-pgtk sway jq ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
text = ''
|
||||
wait=0
|
||||
while :; do
|
||||
case ''${1:-} in
|
||||
-w | --wait)
|
||||
wait=1
|
||||
;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep kittyterm || true)
|
||||
if [ "$STR" == "" ]; then
|
||||
swaymsg '[title="kittyterm"]' scratchpad show
|
||||
emacsclient -c -a "" "$@"
|
||||
swaymsg '[title="kittyterm"]' scratchpad show
|
||||
else
|
||||
if [[ $wait -eq 0 ]]; then
|
||||
emacsclient -n -c -a "" "$@"
|
||||
else
|
||||
emacsclient -c -a "" "$@"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue