Used gnome-schedule to create a script to set my headset as the fallback audio device because it keeps unsetting it when the headset gets disconnected or pc goes into sleep mode.
Anyway, crontab is this:
SHELL=/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/home/dmitry/bin
* * * * * headsetfix
/home/dmitry/bin/headsetfix is
#!/bin/sh
pacmd set-default-sink alsa_output.usb-Logitech_Inc_Logitech_USB_Headset_H540_00000000-00-H540.analog-stereo
pacmd set-default-source alsa_input.usb-Logitech_Inc_Logitech_USB_Headset_H540_00000000-00-H540.analog-stereo
It runs fine from the terminal. I've made sure it's chmodded to be executable, and "which headsetfix", run from cron, outputs "/home/dmitry/bin/headsetfix" so not sure what the problem is.
sudo cron -e
? orcron -e
? – Braiam Nov 08 '13 at 02:10* * * * * sh headsetfix
– jobin Nov 08 '13 at 04:01`dmitry@dmibuntu:~$ sh /usr/local/bin/headsetfix Welcome to PulseAudio! Use "help" for usage information.
– Dmiters Nov 08 '13 at 04:26