Difference between revisions of "Talk:PulseAudio/Examples"

From ArchWiki
Jump to navigation Jump to search
(Argument against using systemd-unit file to start HDMI-Toggle-Script)
(Can't udev rule directly run a script?: Udev rule can actually run a script)
Line 8: Line 8:
  
 
::But this is not really a long running task, so why not directly call it with "/bin/bash /usr/local/bin/hdmi_sound_toggle.sh" -- [[User:Blomblom|Blomblom]] ([[User talk:Blomblom|talk]]) 07:18, 25 May 2018 (UTC)
 
::But this is not really a long running task, so why not directly call it with "/bin/bash /usr/local/bin/hdmi_sound_toggle.sh" -- [[User:Blomblom|Blomblom]] ([[User talk:Blomblom|talk]]) 07:18, 25 May 2018 (UTC)
 +
 +
::: You can call it with /usr/local/bin/hdmi_sound_toggle.sh directly, the problem here is that PATH is empty, it should be set to /usr/bin or give /usr/bin/pactl explicitly

Revision as of 07:54, 16 March 2019

Can't udev rule directly run a script?

PulseAudio/Examples#Automatically switch audio to HDMI states that

Note: udev rule can't directly run a script, a workaround is to use a .service to run this script

Aren't there some examples for scripts in udev? Regid (talk) 18:53, 17 July 2017 (UTC)

The warning in Udev#Writing_udev_rules mentions that udev can't run long-running tasks. Otherwise, it doesn't matter what it runs. -- Lahwaacz (talk) 19:25, 29 July 2017 (UTC)
But this is not really a long running task, so why not directly call it with "/bin/bash /usr/local/bin/hdmi_sound_toggle.sh" -- Blomblom (talk) 07:18, 25 May 2018 (UTC)
You can call it with /usr/local/bin/hdmi_sound_toggle.sh directly, the problem here is that PATH is empty, it should be set to /usr/bin or give /usr/bin/pactl explicitly