More > JRiver Media Center 24 for Linux

MC24 wont run on startup in Debian stretch

<< < (2/4) > >>

Awesome Donkey:

--- Quote from: bob on May 21, 2018, 08:58:47 am ---Agreed. I'll remove them.
--- End quote ---

Actually, if indeed adding a Media Center 24.desktop file to ~/.config/autostart/ works for all desktop environments, X and Wayland (with XWayland), you might be able to add support for startup options on Linux. Just would need a normal entry (like geier22 posted above) and one for /MediaServer. Of course, if a Media Center 24.desktop already existed in that folder, it'd have to be overridden (or removed) when changing that option. Adding a startup delay (for the sleep variable) might be useful too on Linux.

This would need to be tested, obviously, but in theory it *should* work and it shouldn't require root/sudo to add a .desktop file to that directory - not sure if you'd have to set specific permissions for the file though so it could be edited/removed within MC if desired.

I'll test this right now and see if it works.

bob:

--- Quote from: Awesome Donkey on May 21, 2018, 09:10:27 am ---Actually, if indeed adding a Media Center 24.desktop file to ~/.config/autostart/ works for all desktop environments, X and Wayland (with XWayland), you might be able to add support for startup options on Linux. Just would need a normal entry (like geier22 posted above) and one for /MediaServer. Of course, if a Media Center 24.desktop already existed in that folder, it'd have to be overridden (or removed) when changing that option. Adding a startup delay (for the sleep variable) might be useful too on Linux.

This would need to be tested, obviously, but in theory it *should* work and it shouldn't require root/sudo to add a .desktop file to that directory - not sure if you'd have to set specific permissions for the file though so it could be edited/removed within MC if desired.

I'll test this right now and see if it works.

--- End quote ---
Ok, interesting...

bob:

--- Quote from: geier22 on May 21, 2018, 08:52:39 am ---You can create a desktop file and copy it to the folder.
~ / .config / autostart /
That should work in all surfaces.
The delay can be a bit shorter. In any case, the desktop should be fully charged first.
For Xfce ~/.config/autostart/Mediacenter 24.desktop:

--- Code: ---[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Mediacenter 24
Comment=
Exec=sh -c "sleep 20; /usr/bin/mediacenter24"
StartupNotify=false
Terminal=false
Hidden=false
--- End code ---

--- End quote ---
Instead of a delay, we could add a test here for X startup (like look for /tmp/.X0-lock existence).
Would also need a test for desktop startup which I assume will be more complex since there is more than one possibility.

Awesome Donkey:
I named it Media Center 24.desktop and used this to autostart normal MC on boot...


--- Code: ---[Desktop Entry]
Type=Application
Name=Media Center 24
Comment=JRiver Media Center 24
Exec=/usr/bin/mediacenter24 %F
Terminal=false
StartupWMClass=Media_Center_24
StartupNotify=true
Hidden=false
--- End code ---

It works. I tested this too for Media Server...


--- Code: ---[Desktop Entry]
Type=Application
Name=Media Center 24
Comment=JRiver Media Center 24
Exec=/usr/bin/mediacenter24 %F /MediaServer
Terminal=false
StartupWMClass=Media_Center_24
StartupNotify=true
Hidden=false
--- End code ---

Seems to work too, but it starts MC and minimizes it immediately. Though, honestly, this would be less than ideal since Media Server starts MC in the system tray on Windows and the menu bar on Mac. Of course, it's probably not easy to do on Linux due to differences in desktop environments.

I also tested using sleep like geier22 posted above...


--- Code: ---[Desktop Entry]
Type=Application
Name=Media Center 24
Comment=JRiver Media Center 24
Exec=sh -c "sleep 10; /usr/bin/mediacenter24"
Terminal=false
StartupWMClass=Media_Center_24
StartupNotify=true
Hidden=false
--- End code ---

This works, so startup delay could be used... now, let's test this with Media Server...


--- Code: ---[Desktop Entry]
Type=Application
Name=Media Center 24
Comment=JRiver Media Center 24
Exec=sh -c "sleep 10; /usr/bin/mediacenter24 /MediaServer"
Terminal=false
StartupWMClass=Media_Center_24
StartupNotify=true
Hidden=false
--- End code ---

Seems to work too. Now, we can consolidate this to two entries instead of four; Media Center and Media Server. Here's what I'd recommend to use for Media Center (sleep is optional. sleep 0 = no delay)...


--- Code: ---[Desktop Entry]
Type=Application
Name=Media Center 24
Comment=JRiver Media Center 24
Exec=sh -c "sleep 0; /usr/bin/mediacenter24"
Terminal=false
StartupWMClass=Media_Center_24
StartupNotify=true
Hidden=false
--- End code ---

And here's what I'd recommend to use for Media Server (again sleep is optional. sleep 0 = no delay)...


--- Code: ---[Desktop Entry]
Type=Application
Name=Media Center 24
Comment=JRiver Media Center 24
Exec=sh -c "sleep 0; /usr/bin/mediacenter24 /MediaServer"
Terminal=false
StartupWMClass=Media_Center_24
StartupNotify=true
Hidden=false
--- End code ---

Tada! I'll test these under Ubuntu, Linux Mint, Arch Linux, etc. It *should* work fine with all of them though.

Awesome Donkey:

--- Quote from: bob on May 21, 2018, 09:26:18 am ---Instead of a delay, we could add a test here for X startup (like look for /tmp/.X0-lock existence).
Would also need a test for desktop startup which I assume will be more complex since there is more than one possibility.

--- End quote ---

Whichever's easier. :P

BTW, it works in Ubuntu, Linux Mint, Arch Linux, etc. Each with different desktop environments so it *should* work for everything. Also it doesn't require any special read/write permissions so it should work fine without needing sudo or chmod (or +x). Don't got any Raspberry Pis around so I can't test it on ARM/Raspbian but it should work there too.

IMO, using a slight delay as a default (e.g. sleep 5) would probably be a good idea otherwise MC pops up immediately when the DE is loading.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version