From 1c58ccb7855719483490abe1982afa12b0488f24 Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Fri, 15 May 2026 22:36:21 -0400 Subject: refactor and battery notifier --- scripts/open-emacs-project | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100755 scripts/open-emacs-project (limited to 'scripts/open-emacs-project') diff --git a/scripts/open-emacs-project b/scripts/open-emacs-project deleted file mode 100755 index 48360b1..0000000 --- a/scripts/open-emacs-project +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -find_dirs() { - echo $(emacsclient -e "(proj--get-paths)" | sed -ze 's/(\(.*\))/\1/') | xargs -n1 -} - -emacs_attached() { - [ "$(emacsclient -e '(- (length (frame-list)) 1)')" = 0 ] && return 1 || return 0 -} - -switch_to() { - if emacs_attached; then - emacsclient -e "(proj-set \"$1\")" - else - emacsclient -ce "(proj-set \"$1\")" - fi -} - -# get selected -selected=$(find_dirs | swenu -coil 15) -[ -z "$selected" ] && exit 1; -selected="${selected/\~/$HOME}" - -# set emacs project -switch_to "$selected" - -# focus emacs -swaymsg [con_id="$(swaymsg -t get_tree | jq -r '.nodes[1].nodes[].nodes[] | .. | (.id|tostring) + " " + .app_id?' | grep emacs | awk '{print $1}')"] focus -- cgit v1.2.3