Hello all,
I’m trying to add a login script in KDE.
The command I want is : pactl set-sink-volume @DEFAULT_SINK@ 40%
I always want to have this volume at startup.
In terminal, this works.
So I tried to add this as a login script and logout script, just to be sure.
A file : ResetVolume.sh that contains :
Is there something I’m missing here ? This worked in MX Linux.
Should I change something in the Properties of this script at the “Program” or “Arguments” ?
In the General tab I see “Open with” Kate ? maybe that’s the problem ?
Thank you all for the answers
Let me just say, WOW ! I was not expecting so many answers and so fast. I’ve been told that SUSE English forums have very slow activity.
So with that being said, I will try all the solutions presented and get back with a feedback.
fyi, the moment I add I login script in KDE, this file is created ResetVolume.sh.desktop :
I don’t understand this one, I did not create the .desktop file in autostart if that’s the one you are referring to.
I created ResetVolume.sh and it works if I test it in konsole.
@nrickert I tried to copy ResetVolume.sh in $HOME/.config/plasma-workspace/env
I got the same results
karl@erlangen:~> journalctl --user -b -u "app-org.opensuse.opensuse_welcome*"
Sep 12 08:50:23 erlangen systemd[1083]: Starting Welcome...
Sep 12 08:50:23 erlangen systemd[1083]: Started Welcome.
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: QWebEngineUrlScheme::registerScheme: Scheme "qrc" already registered
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: checking if autostart is enabled
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: file exists
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: there is a file to disable, so it's disabled
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: Checking if we are live
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: file does not exist
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: We aren't live
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: qml: false
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: qml: KDE Gear, FreeRDP update in Tumbleweed https://news.opensuse.org/2023/09/07/kde-gear-freerdp-up-in-tw/
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: Property 'animations'' of object 'QQuickSequentialAnimation' has no notify signal and is not constant, value updates in HTML will be broken!
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: Property 'animations'' of object 'QQuickSequentialAnimation' has no notify signal and is not constant, value updates in HTML will be broken!
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: Checking if we are live
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: file does not exist
Sep 12 08:50:23 erlangen opensuse-welcome[3758]: We aren't live
Sep 12 08:59:57 erlangen opensuse-welcome[3758]: checking if autostart is enabled
Sep 12 08:59:57 erlangen opensuse-welcome[3758]: file exists
Sep 12 08:59:57 erlangen opensuse-welcome[3758]: there is a file to disable, so it's disabled
Sep 12 08:59:57 erlangen opensuse-welcome[3758]: enable autostart called
Sep 12 08:59:57 erlangen opensuse-welcome[3758]: file exists
Sep 12 08:59:57 erlangen opensuse-welcome[3758]: there was a file, so we removed it
Sep 12 09:00:00 erlangen systemd[1083]: app-org.opensuse.opensuse_welcome@autostart.service: Consumed 1.686s CPU time.
karl@erlangen:~>
#!/bin/bash
/usr/bin/logger "my script has been run AAAAAAAA"
pactl set-sink-volume @DEFAULT_SINK@ 40% 20%
/usr/bin/logger "my script has been run BBBBBBBB"
This is what I got :
sep 12 15:50:13 DELL kded5[2142]: Delayed initialization.
sep 12 15:50:13 DELL systemd[2005]: Starting ResetVolume.sh…
sep 12 15:50:13 DELL systemd[2005]: Starting Double Commander…
sep 12 15:50:13 DELL flow[2370]: my script has been run AAAAAAAA
sep 12 15:50:13 DELL systemd[2005]: Starting Firefox…
*
*
*
*
sep 12 15:50:14 DELL ResetVolume.sh[2373]: Failed to get sink information: No such entity
sep 12 15:50:14 DELL flow[2437]: my script has been run BBBBBBBB
Good. So on the modern KDE all session management is performed using systemd. Could you please reboot, log in and immediately capture (as your own user, not as root) and post
journalctl --user -b --no-pager --full
This should show when your script and PA have been started.
You do not really need to reboot, it is just to reduce the amount of output (so it captures just one session).