[Bin] KDEConnect in autostart, proper bash for default audio sink
This commit is contained in:
parent
61c123799b
commit
7bdab40832
@ -28,19 +28,20 @@ of said command running.
|
|||||||
|
|
||||||
~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? |
|
||||||
|-------------+------------------------------------------+-----------|
|
|----------------------+------------------------------------------+-----------|
|
||||||
| ~pactl~ | ~load-module module-switch-on-connect~ | |
|
| ~pactl~ | ~load-module module-switch-on-connect~ | |
|
||||||
| ~mpc~ | ~stop~ | no |
|
| ~mpc~ | ~stop~ | no |
|
||||||
| ~picom~ | ~--experimental-backends~ | yes |
|
| ~xrdb~ | ~-merge "$HOME"/.Xresources~ | no |
|
||||||
| ~set-screens~ | | no |
|
| ~picom~ | ~--experimental-backends~ | yes |
|
||||||
| ~numlockx~ | ~on~ | yes |
|
| ~set-screens~ | | no |
|
||||||
| ~pumopm~ | | yes |
|
| ~numlockx~ | ~on~ | yes |
|
||||||
| ~xfce-polkit~ | | yes |
|
| ~pumopm~ | | yes |
|
||||||
| ~nm-applet~ | | yes |
|
| ~xfce-polkit~ | | yes |
|
||||||
| ~xwallpaper~ | ~--zoom "$(cat "$HOME"/.cache/wallpaper)"~ | no |
|
| ~nm-applet~ | | yes |
|
||||||
| ~xss-lock~ | ~plock~ | yes |
|
| ~xwallpaper~ | ~--zoom "$(cat "$HOME"/.cache/wallpaper)"~ | no |
|
||||||
| ~xrdb~ | ~-merge "$HOME"/.Xresources~ | no |
|
| ~xss-lock~ | ~plock~ | yes |
|
||||||
|
| ~/usr/lib/kdeconnectd~ | | yes |
|
||||||
|
|
||||||
#+NAME: autostart-gen
|
#+NAME: autostart-gen
|
||||||
#+header: :wrap "src bash :exports code"
|
#+header: :wrap "src bash :exports code"
|
||||||
@ -67,10 +68,11 @@ of said command running.
|
|||||||
"\n")
|
"\n")
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+RESULTS[337fc252540623d17d47dc7e0661840db2a4eab5]: autostart-gen
|
#+RESULTS[7f5adf8d562e118b8e468d7c62c94a8708d32d9e]: autostart-gen
|
||||||
#+begin_src bash :exports code
|
#+begin_src bash :exports code
|
||||||
pactl load-module module-switch-on-connect &
|
pactl load-module module-switch-on-connect &
|
||||||
mpc stop &
|
mpc stop &
|
||||||
|
xrdb -merge "$HOME"/.Xresources &
|
||||||
if pgrep -x picom ; then
|
if pgrep -x picom ; then
|
||||||
echo "picom already running"
|
echo "picom already running"
|
||||||
else
|
else
|
||||||
@ -109,17 +111,24 @@ else
|
|||||||
xss-lock plock &
|
xss-lock plock &
|
||||||
disown
|
disown
|
||||||
fi
|
fi
|
||||||
xrdb -merge "$HOME"/.Xresources &
|
if pgrep -x /usr/lib/kdeconnectd ; then
|
||||||
|
echo "/usr/lib/kdeconnectd already running"
|
||||||
|
else
|
||||||
|
/usr/lib/kdeconnectd &
|
||||||
|
disown
|
||||||
|
fi
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
I also have an external sound card, a Scarlet 2i2 G3, that I would like to use
|
I also have an external sound card, a Scarlet 2i2 G3, that I would
|
||||||
as my default audio output. However, it might not be always connected, hence the
|
like to use as my default audio output. However, it might not be
|
||||||
following code:
|
always connected, hence the following code:
|
||||||
# #+NAME: default-soundcard
|
#+NAME: default-soundcard
|
||||||
# #+BEGIN_SRC fish
|
#+BEGIN_SRC bash
|
||||||
# # set SOUNDCARD "alsa_output.usb-Focusrite_Scarlett_2i2_USB_Y8KJ6NH094EF1C-00.analog-stereo"
|
SOUNDCARD=$(pactl list short sinks | grep "Focusrite")
|
||||||
# # pactl list short sinks | grep $SOUNDCARD 2&> /dev/null && pactl set-default-sink $SOUNDCARD
|
if [[ -n $SOUNDCARD ]]; then
|
||||||
# #+END_SRC
|
pactl set-default-sink "$(echo "$SOUNDCARD" | awk '{print $2}')"
|
||||||
|
fi
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
* Screen utilities
|
* Screen utilities
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
Loading…
Reference in New Issue
Block a user