[Bin] Update autostart script

This commit is contained in:
Lucien Cartier-Tilet 2020-10-20 13:52:00 +02:00
parent 942738cbb7
commit b09de32f9b
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -94,18 +94,19 @@
~set-screens~ is a custom script declared [[*set-screens][below]]. ~set-screens~ is a custom script declared [[*set-screens][below]].
#+NAME: autostart-table #+NAME: autostart-table
| Command | Arguments | Run once? | | Command | Arguments | Run once? |
|----------------------------+-----------------------------------------------------------------+-----------| |---------------+---------------------------------------------------------------+-----------|
| ~pumopm~ | | yes | | ~set-screens~ | | |
| ~xfce-polkit~ | | yes | | ~pumopm~ | | yes |
| ~xss-lock~ | ~lock~ | yes | | ~xfce-polkit~ | | yes |
| ~picom~ | ~--experimental-backends~ | yes | | ~xss-lock~ | ~lock~ | yes |
| ~xidlehook~ | ~--not-when-audio --not-when-fullscreen --timer 3600 i3lock ''~ | yes | | ~picom~ | ~--experimental-backends~ | yes |
| ~nm-applet~ | | yes | | ~xidlehook~ | ~--not-when-audio --not-when-fullscreen --timer 3600 lock ''~ | yes |
| ~numlockx~ | ~on~ | yes | | ~nm-applet~ | | yes |
| ~nitrogen~ | ~--restore~ | no | | ~numlockx~ | ~on~ | yes |
| ~mpc~ | ~stop~ | no | | ~nitrogen~ | ~--restore~ | no |
| ~emacsclient~ | ~-c -e \"(delete-frame)\"~ | no | | ~mpc~ | ~stop~ | no |
| ~emacsclient~ | ~-c -e "(delete-frame)"~ | no |
#+NAME: autostart-gen #+NAME: autostart-gen
#+BEGIN_SRC emacs-lisp :var table=autostart-table :cache yes #+BEGIN_SRC emacs-lisp :var table=autostart-table :cache yes
@ -115,13 +116,52 @@
($once? (string= "yes" (nth 2 $start-command)))) ($once? (string= "yes" (nth 2 $start-command))))
(if $once? (if $once?
(concat (format "if ! test (pgrep %s 2&> /dev/null)\n\t" $command) (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") "\nend\n")
(format "%s %s &\n" $command $arguments)))) (format "%s %s &\n" $command $arguments))))
table table
"\n") "\n")
#+END_SRC #+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 #+BEGIN_SRC fish :noweb yes
set -l PATH $PATH /usr/lib/xfce-polkit set -l PATH $PATH /usr/lib/xfce-polkit