summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2022-04-23 01:25:46 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2022-04-23 01:25:46 +0200
commit575db6052aa15cf135d1bea9efd04d4edef1b062 (patch)
tree2005b91d281d02b0aa757116cdd123b9093820f6 /.local/bin
parentncmpc keys update and more (diff)
downloaddotfiles-bsd-575db6052aa15cf135d1bea9efd04d4edef1b062.tar.gz
dotfiles-bsd-575db6052aa15cf135d1bea9efd04d4edef1b062.tar.bz2
dotfiles-bsd-575db6052aa15cf135d1bea9efd04d4edef1b062.tar.xz
dotfiles-bsd-575db6052aa15cf135d1bea9efd04d4edef1b062.tar.zst
dotfiles-bsd-575db6052aa15cf135d1bea9efd04d4edef1b062.zip
udpate
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/dmlog6
-rwxr-xr-x.local/bin/editorcmd2
-rwxr-xr-x.local/bin/idea3
-rwxr-xr-x.local/bin/startemacs6
-rwxr-xr-x.local/bin/stopemacs3
5 files changed, 16 insertions, 4 deletions
diff --git a/.local/bin/dmlog b/.local/bin/dmlog
index 51edb8a..cc0f736 100755
--- a/.local/bin/dmlog
+++ b/.local/bin/dmlog
@@ -7,7 +7,8 @@ use constant {
ACPI_PATH => '/usr/sbin/acpiconf',
KILL_PATH => '/usr/bin/killall',
SHUTDOWN_PATH => '/sbin/shutdown',
- NOTIF_PATH => '/usr/local/bin/notify-send'
+ NOTIF_PATH => '/usr/local/bin/notify-send',
+ EMACS_PATH => '/usr/local/bin/emacsclient'
};
use constant LIST => [
'Lock screen',
@@ -58,16 +59,19 @@ sub action
}
elsif ($var eq ${+LIST}[2]) {
if (confirm($var) == 1) {
+ system(EMACS_PATH, '-e', '(save-buffers-kill-terminal)');
exec(KILL_PATH, 'dwm');
}
}
elsif ($var eq ${+LIST}[3]) {
if (confirm($var) == 1) {
+ system(EMACS_PATH, '-e', '(save-buffers-kill-terminal)');
exec(SHUTDOWN_PATH, '-r', 'now');
}
}
elsif ($var eq ${+LIST}[4]) {
if (confirm($var) == 1) {
+ system(EMACS_PATH, '-e', '(save-buffers-kill-terminal)');
system(
NOTIF_PATH,
'-u',
diff --git a/.local/bin/editorcmd b/.local/bin/editorcmd
index d7dd47b..f79baea 100755
--- a/.local/bin/editorcmd
+++ b/.local/bin/editorcmd
@@ -1,3 +1,3 @@
#!/usr/local/bin/dash
-exec emacsclient -t -a /usr/local/bin/nvim "$@"
+exec bsdsetsid emacsclient -c -a /usr/local/bin/nvim "$@"
diff --git a/.local/bin/idea b/.local/bin/idea
index d79983e..7fdd039 100755
--- a/.local/bin/idea
+++ b/.local/bin/idea
@@ -6,8 +6,7 @@ nl='
'
date=$(date)
-gsed -i '15i '"\\${nl}\\${nl}"'## '"\\${date}"' '"\\${nl}\\${nl}\\${1}" "$HOME"/dev/web/jozan_gemini/thoughts.gmi
-
+sed -i '' -e '15i '"\\${nl}\\${nl}"'## '"\\${date}"' '"\\${nl}\\${nl}\\${1}" "$HOME"/dev/web/jozan_gemini/thoughts.gmi
git -C "$HOME"/dev/web/jozan_gemini add -u
git -C "$HOME"/dev/web/jozan_gemini commit -m "Thought: ${date}"
git -C "$HOME"/dev/web/jozan_gemini push
diff --git a/.local/bin/startemacs b/.local/bin/startemacs
new file mode 100755
index 0000000..4a61641
--- /dev/null
+++ b/.local/bin/startemacs
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+
+if ! pgrep emacs; then
+ bsdsetsid emacs --daemon >/dev/null 2>&1
+fi
diff --git a/.local/bin/stopemacs b/.local/bin/stopemacs
new file mode 100755
index 0000000..d661941
--- /dev/null
+++ b/.local/bin/stopemacs
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+emacsclient -e '(save-buffers-kill-terminal)'