[Bin] KDEConnect in autostart, proper bash for default audio sink
This commit is contained in:
parent
61c123799b
commit
7bdab40832
@ -29,9 +29,10 @@ 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 |
|
||||||
|
| ~xrdb~ | ~-merge "$HOME"/.Xresources~ | no |
|
||||||
| ~picom~ | ~--experimental-backends~ | yes |
|
| ~picom~ | ~--experimental-backends~ | yes |
|
||||||
| ~set-screens~ | | no |
|
| ~set-screens~ | | no |
|
||||||
| ~numlockx~ | ~on~ | yes |
|
| ~numlockx~ | ~on~ | yes |
|
||||||
@ -40,7 +41,7 @@ of said command running.
|
|||||||
| ~nm-applet~ | | yes |
|
| ~nm-applet~ | | yes |
|
||||||
| ~xwallpaper~ | ~--zoom "$(cat "$HOME"/.cache/wallpaper)"~ | no |
|
| ~xwallpaper~ | ~--zoom "$(cat "$HOME"/.cache/wallpaper)"~ | no |
|
||||||
| ~xss-lock~ | ~plock~ | yes |
|
| ~xss-lock~ | ~plock~ | yes |
|
||||||
| ~xrdb~ | ~-merge "$HOME"/.Xresources~ | no |
|
| ~/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