From b09de32f9b39c82a27c27e49023b2dd72b86fbe1 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Tue, 20 Oct 2020 13:52:00 +0200 Subject: [PATCH] [Bin] Update autostart script --- org/config/bin.org | 66 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/org/config/bin.org b/org/config/bin.org index 0d59b9e..3f9a8a8 100644 --- a/org/config/bin.org +++ b/org/config/bin.org @@ -94,18 +94,19 @@ ~set-screens~ is a custom script declared [[*set-screens][below]]. #+NAME: autostart-table - | Command | Arguments | Run once? | - |----------------------------+-----------------------------------------------------------------+-----------| - | ~pumopm~ | | yes | - | ~xfce-polkit~ | | yes | - | ~xss-lock~ | ~lock~ | yes | - | ~picom~ | ~--experimental-backends~ | yes | - | ~xidlehook~ | ~--not-when-audio --not-when-fullscreen --timer 3600 i3lock ''~ | yes | - | ~nm-applet~ | | yes | - | ~numlockx~ | ~on~ | yes | - | ~nitrogen~ | ~--restore~ | no | - | ~mpc~ | ~stop~ | no | - | ~emacsclient~ | ~-c -e \"(delete-frame)\"~ | no | + | Command | Arguments | Run once? | + |---------------+---------------------------------------------------------------+-----------| + | ~set-screens~ | | | + | ~pumopm~ | | yes | + | ~xfce-polkit~ | | yes | + | ~xss-lock~ | ~lock~ | yes | + | ~picom~ | ~--experimental-backends~ | yes | + | ~xidlehook~ | ~--not-when-audio --not-when-fullscreen --timer 3600 lock ''~ | yes | + | ~nm-applet~ | | yes | + | ~numlockx~ | ~on~ | yes | + | ~nitrogen~ | ~--restore~ | no | + | ~mpc~ | ~stop~ | no | + | ~emacsclient~ | ~-c -e "(delete-frame)"~ | no | #+NAME: autostart-gen #+BEGIN_SRC emacs-lisp :var table=autostart-table :cache yes @@ -115,13 +116,52 @@ ($once? (string= "yes" (nth 2 $start-command)))) (if $once? (concat (format "if ! test (pgrep %s 2&> /dev/null)\n\t" $command) - (s-collapse-whitespace (format "%s %s &" $command $arguments)) + (s-collapse-whitespace (format "%s %s & && disown" $command $arguments)) "\nend\n") (format "%s %s &\n" $command $arguments)))) table "\n") #+END_SRC + #+RESULTS[1c3a021a0c8c01b8edbf6c40eccc5ee1d3c8762d]: autostart-gen + #+begin_example + set-screens & + + if ! test (pgrep pumopm 2&> /dev/null) + pumopm & && disown + end + + if ! test (pgrep xfce-polkit 2&> /dev/null) + xfce-polkit & && disown + end + + if ! test (pgrep xss-lock 2&> /dev/null) + xss-lock lock & && disown + end + + if ! test (pgrep picom 2&> /dev/null) + picom --experimental-backends & && disown + end + + if ! test (pgrep xidlehook 2&> /dev/null) + xidlehook --not-when-audio --not-when-fullscreen --timer 3600 lock '' & && disown + end + + if ! test (pgrep nm-applet 2&> /dev/null) + nm-applet & && disown + end + + if ! test (pgrep numlockx 2&> /dev/null) + numlockx on & && disown + end + + nitrogen --restore & + + mpc stop & + + emacsclient -c -e "(delete-frame)" & + #+end_example + #+BEGIN_SRC fish :noweb yes set -l PATH $PATH /usr/lib/xfce-polkit