You are not logged in.

#1 2021-08-15 19:03:48

mightywonton
Member
Registered: 2021-06-18
Posts: 1

Changing Default Sink for audio via Cron

Hello,

I am using cronie 1.5.7-2, pipewire 0.3.33, and 5.13.10-zen1-1-zen

I am having an issue with my audio sink defaults on my Arctic Wireless Pro headset; when I try to set them via

Gnome Sound GUI,

pavucontrol 

or

pactl

I am able to change them and they stay but when I reboot they do not save.

I am trying to set a crontab that changes the sink for me @reboot. The script runs and the sink definitely changes, but the cron does not.

crontab -e

is set to: 

 * * * * * /home/username/.customsh/change-sink.sh

I confirmed I can run the .sh via

bash -c

and

sh -c

and both from the absolute path and relative path.

(Keeping it on the * * * * * for troubleshooting; I will change to @reboot when I know it works.)

My script (change-sink.sh) is:

#!/bin/bash 

pactl set-default-sink alsa_output.usb-SteelSeries_Arctis_Pro_Wireless-00.stereo-game

Then,

systemctl status cronie.service

states it is

active (running)

and the following below:

Aug 15 14:51:01 archbox crond[306328]: pam_unix(crond:session): session opened for user username(uid=1000) by (uid=0)
Aug 15 14:51:01 archbox CROND[306331]: (username) CMD (/home/username/.customsh/change-sink.sh)
Aug 15 14:51:01 archbox CROND[306328]: (username) CMDOUT (Connection failure: Connection refused)
Aug 15 14:51:01 archbox CROND[306328]: (username) CMDOUT (pa_context_connect() failed: Connection refused)
Aug 15 14:51:01 archbox CROND[306328]: (username) CMDEND (/home/username/.customsh/change-sink.sh)
Aug 15 14:51:01 archbox CROND[306328]: pam_unix(crond:session): session closed for user username

What could I be missing? Pointers?

Thank you.

Last edited by mightywonton (2021-08-15 20:32:26)

Offline

#2 2021-08-15 20:41:32

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Changing Default Sink for audio via Cron


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB