Compare commits

...

3 Commits

Author SHA1 Message Date
Lucien Cartier-Tilet dbafe01b1d
[Emacs] Remove mediawiki, too buggy
continuous-integration/drone/push Build is passing Details
2022-05-22 14:13:32 +02:00
Lucien Cartier-Tilet 342b1ea1df
[Fish] rsync abbreviation 2022-05-22 14:12:53 +02:00
Lucien Cartier-Tilet 6feecc1fdc
[Bin, Fish] Better handling of unknown executables
Only execute stuff if it is in PATH.
2022-05-22 14:11:58 +02:00
3 changed files with 67 additions and 83 deletions

View File

@ -48,81 +48,85 @@ of said command running.
#+header: :wrap "src bash :exports code"
#+BEGIN_SRC emacs-lisp :var table=autostart-table :cache yes
(mapconcat (lambda (start-command)
(let* ((command (replace-regexp-in-string (regexp-quote "~") "" (nth 0 start-command)))
(arguments (replace-regexp-in-string (regexp-quote "~") "" (nth 1 start-command)))
(oncep (string= "yes" (nth 2 start-command)))
(full-command (replace-regexp-in-string " +"
" "
(format "%s %s &" command arguments))))
(if oncep
(format
(concat "if pgrep -x %s ; then\n"
" echo \"%s already running\"\n"
"else\n"
" %s\n"
" disown\n"
"fi")
command
command
full-command)
full-command)))
(let* ((command (replace-regexp-in-string "~" "" (nth 0 start-command)))
(arguments (replace-regexp-in-string "~" "" (nth 1 start-command)))
(oncep (string= "yes" (nth 2 start-command)))
(full-command (replace-regexp-in-string
" +"
" "
(format "%s %s &" command arguments))))
(concat (format "which %s && %s"
command
(if (not oncep)
full-command
(format (concat "if pgrep -x %s ; then\n"
" echo %s already running\n"
"else\n"
" %s\n"
" disown\n"
"fi")
command
command
command
full-command))))))
table
"\n")
#+END_SRC
#+RESULTS[97a97fceb694333615e59599d7c2d7fac52c5e8d]: autostart-gen
#+RESULTS[64fcf7c33f989171bc7582495cd508959f4030c3]: autostart-gen
#+begin_src bash :exports code
pactl load-module module-switch-on-connect &
mpc stop &
xrdb -merge "$HOME"/.Xresources &
if pgrep -x picom ; then
echo "picom already running"
which pactl && pactl load-module module-switch-on-connect &
which mpc && mpc stop &
which xrdb && xrdb -merge "$HOME"/.Xresources &
which picom && if pgrep -x picom ; then
echo picom already running
else
picom --experimental-backends &
picom
disown
fi
set-screens &
if pgrep -x numlockx ; then
echo "numlockx already running"
which set-screens && set-screens &
which numlockx && if pgrep -x numlockx ; then
echo numlockx already running
else
numlockx on &
numlockx
disown
fi
if pgrep -x pumopm ; then
echo "pumopm already running"
which pumopm && if pgrep -x pumopm ; then
echo pumopm already running
else
pumopm &
pumopm
disown
fi
if pgrep -x xfce-polkit ; then
echo "xfce-polkit already running"
which xfce-polkit && if pgrep -x xfce-polkit ; then
echo xfce-polkit already running
else
xfce-polkit &
xfce-polkit
disown
fi
if pgrep -x nm-applet ; then
echo "nm-applet already running"
which nm-applet && if pgrep -x nm-applet ; then
echo nm-applet already running
else
nm-applet &
nm-applet
disown
fi
xwallpaper --zoom "$(cat "$HOME"/.cache/wallpaper)" &
if pgrep -x xss-lock ; then
echo "xss-lock already running"
which xwallpaper && xwallpaper --zoom "$(cat "$HOME"/.cache/wallpaper)" &
which xss-lock && if pgrep -x xss-lock ; then
echo xss-lock already running
else
xss-lock plock &
xss-lock
disown
fi
if pgrep -x /usr/lib/kdeconnectd ; then
echo "/usr/lib/kdeconnectd already running"
which /usr/lib/kdeconnectd && if pgrep -x /usr/lib/kdeconnectd ; then
echo /usr/lib/kdeconnectd already running
else
/usr/lib/kdeconnectd &
/usr/lib/kdeconnectd
disown
fi
if pgrep -x dunst ; then
echo "dunst already running"
which dunst && if pgrep -x dunst ; then
echo dunst already running
else
dunst &
dunst
disown
fi
#+end_src

View File

@ -7995,27 +7995,6 @@ standard keybindings.
(add-to-list 'global-mode-string '("" mode-line-keycast " ")))
#+end_src
*** Mediawiki front-end
:PROPERTIES:
:CUSTOM_ID: Packages-Configuration-Misc-Mediawiki-front-end-szfhri000dj0
:END:
#+begin_src emacs-lisp
(use-package mediawiki
:defer t
:straight (:build t)
:config
(setq mediawiki-site-alist `(("WikiPhundrak"
"https://wiki.phundrak.com/"
"phundrak"
,(funcall
(plist-get (car (auth-source-search
:max 1
:host "wiki.phundrak.com"))
:secret))
nil
"Main Page"))))
#+end_src
*** SICP
:PROPERTIES:
:CUSTOM_ID: Packages-Configuration-Misc-SICP-96u6ukz0l4j0

View File

@ -62,7 +62,7 @@ Now, there is only one function I modify when it comes to the appearance of fish
when Im the one using it: the ~fish_greeting~ function. I use it to display the output of [[https://labs.phundrak.com/phundrak/pumo-system-info][a utility I wrote]].
#+BEGIN_SRC fish
function fish_greeting
which pumo-system-info 2&> /dev/null && pumo-system-info || df -H | grep -v Filesystem | sort -rk 5
which pumo-system-info 2&> /dev/null && pumo-system-info
end
#+END_SRC
@ -554,19 +554,20 @@ of a directory. Notice also the =--preserve-root= which will prevent me from
accidentally removing the root folder. I added the same option to =chgrp=,
=chmod=, and =chown=.
#+NAME: sec-abbr
| abbreviation | command |
|--------------+--------------------------|
| cp | cp -i |
| ln | ln -i |
| lns | ln -si |
| mv | mv -i |
| rm | rm -Iv |
| rmd | rm --preserve-root -Irv |
| rmdf | rm --preserve-root -Irfv |
| rmf | rm --preserve-root -Ifv |
| chgrp | chgrp --preserve-root -v |
| chmod | chmod --preserve-root -v |
| chown | chown --preserve-root -v |
| abbreviation | command |
|--------------+---------------------------|
| cp | cp -i |
| rsync | rsync -ruvtEhl --progress |
| ln | ln -i |
| lns | ln -si |
| mv | mv -i |
| rm | rm -Iv |
| rmd | rm --preserve-root -Irv |
| rmdf | rm --preserve-root -Irfv |
| rmf | rm --preserve-root -Ifv |
| chgrp | chgrp --preserve-root -v |
| chmod | chmod --preserve-root -v |
| chown | chown --preserve-root -v |
Here is the corresponding fish configuration:
#+BEGIN_SRC fish