You are not logged in.
I have this shell script from where I want to run kodi from instead of /usr/bin/kodi
#!/bin/bash
systemctl --user stop pulseaudio.socket
systemctl --user stop pulseaudio.service
KODI_AE_SINK=ALSA kodi
systemctl --user start pulseaudio.socket
systemctl --user start pulseaudio.serviceSo can I use symbolic link to change it?
sudo ln -s /usr/bin/kodi /usr/local/kodi.sh
Also will it interfere with my lircrc command which runs kodi using this command
begin
remote = mceusb
button = KEY_HOME
prog = irexec
config = [[ ! $(pidof kodi-x11) ]] && /usr/bin/kodi &
endLet me know your thoughts/feedbacks/suggestions etc.
Thanks for your time and patience.
OZooHA
Last edited by ozooha (2021-01-06 17:44:14)
Offline
With the script as posted you'd break the existing script and run an infinite loop of yourself. I'd say make a /home/user/bin that you prepend in the path for "replacements" or copy/link the script into /usr/local/bin (/usr/local/bin usually prepends and takes priority over /usr/bin paths if the PATH variable is setup as such) and use the full /usr/bin/kodi path inside your script
You can also keep general pulse state alive while still getting the direct ALSA guarantees if you just use pasuspender,
KODI_AE_SINK=ALSA pasuspender /usr/bin/kodi(...and I personally would just use pulse anyway but I assume you have your reasons)
Last edited by V1del (2021-01-06 17:55:59)
Offline
With the script as posted you'd break the existing script and run an infinite loop of yourself. I'd say make a /home/user/bin that you prepend in the path for "replacements" or copy/link the script into /usr/local/bin (/usr/local/bin usually prepends and takes priority over /usr/bin paths if the PATH variable is setup as such) and use the full /usr/bin/kodi path inside your script
You can also keep general pulse state alive while still getting the direct ALSA guarantees if you just use pasuspender,
KODI_AE_SINK=ALSA pasuspender /usr/bin/kodi(...and I personally would just use pulse anyway but I assume you have your reasons)
I don't quite get what you meant here
copy/link the script into /usr/local/bin (/usr/local/bin usually prepends and takes priority over /usr/bin paths if the PATH variable is setup as such) and use the full /usr/bin/kodi path inside your script
I have modified the script to use
KODI_AE_SINK=ALSA pasuspender /usr/bin/kodibut how do I change the lircrc part of the code to reflect that as in config?
Did you mean I need to do a symbolic link to ?
sudo ln -s /usr/bin/kodi /usr/local/bin/kodi.sh
Thanks.
OZooHA
Offline
No stop with the idea of a symbolic link, /usr/bin/kodi is kodi's own setup script if you replace/change that to a symlink you will have broken the kodi startup (... in kodi's case not that big of an issue as the actual binaries are in /usr/lib/kodi-x11 etc)
Just place your script into /usr/local/bin/kodi and you can call kodi from your shell, but the original /usr/bin/kodi remains intact (... check your PATH with
echo $PATHon default setups /usr/local/bin should preceed /usr/bin and thus have priority for PATH lookups.
Place it there, run
type -a kodiyou should see your own script come before the package provided /usr/bin/kodi without completely replacing it.
Offline
No stop with the idea of a symbolic link, /usr/bin/kodi is kodi's own setup script if you replace/change that to a symlink you will have broken the kodi startup (... in kodi's case not that big of an issue as the actual binaries are in /usr/lib/kodi-x11 etc)
Just place your script into /usr/local/bin/kodi and you can call kodi from your shell, but the original /usr/bin/kodi remains intact (... check your PATH with
echo $PATHon default setups /usr/local/bin should preceed /usr/bin and thus have priority for PATH lookups.
Place it there, run
type -a kodiyou should see your own script come before the package provided /usr/bin/kodi without completely replacing it.
/usr/local/bin should preceed /usr/bin and thus have priority for PATH lookups.
has precedence over /usr/bin/ from the PATH.
/usr/lib/ccache/bin/:/opt/miniconda3/condabin:/usr/local/bin:/usr/local/sbin:/usr/bin:I have placed the script in /usr/local/bin/ as /usr/local/bin/kodi
however when I run type -a kodi
I get this and nothing happens
⚡ type -a kodi
kodi is /usr/local/bin/kodi
kodi is /usr/bin/kodiWhat requires to be correct since i misunderstood you.
Thanks
OZooHA
Offline
ok if i type kodi at the prompt it does evoke the /usr/local/bin/kodi
So yeah this works.
Thanks
OZooHA
Offline