This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Autostart Startup Logout Scripts

Tags: None
(comma "," separated)
FlowXP
Registered Member
Posts
27
Karma
0

Autostart Startup Logout Scripts

Sat Apr 16, 2022 5:31 am
Hello to all!!
I have an HDMI monitor attached to my laptop and also headphones. I switch the audio output between these two a lot.
On every distro I used this little script to reset the volume to 40% on all sources on every startup and it does the job just fine :
volume.sh
Code: Select all
#!/bin/bash

#pacmd list-sinks | awk '/index/ || /name:/ || /alsa.card_name/ || /device.description/'
#pactl set-sink-volume alsa_output.pci-0000_00_03.0.hdmi-stereo 30%

pactl set-sink-volume 1 40%
pactl set-sink-volume 2 40%
pactl set-sink-volume 3 40%

The script works fine except un autostart.
I added to Autostart and sometimes it does work sometime it dosen't.
Ok, maybe the script starts before the OS detects all sources...I added sleep 2 , and sleep 5 ... and sleep 10 with the same results.
So I moved the sh on "Logout Scripts" ... same results

Can you give me some pointers please ?! :'(


finally on KDE Neon !!
FlowXP
Registered Member
Posts
27
Karma
0
found out the solution.
At logout I found that I had 5 sinks , instead of 2, no ideea why. So just to be sure >:( :

pactl set-sink-volume 1 40%
pactl set-sink-volume 2 40%
pactl set-sink-volume 3 40%
pactl set-sink-volume 4 40%
pactl set-sink-volume 5 40%
pactl set-sink-volume 6 40%
pactl set-sink-volume 7 40%
pactl set-sink-volume 8 40%
pactl set-sink-volume 9 40%


finally on KDE Neon !!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]