- Posts: 6
- Thank you received: 0
"Startup" script for YACReader Library
- avggeek
- Topic Author
- Offline
- New Member
-
I originally created an issue about this on the Bitbucket repo for YACReader, but Luis suggested that I also post on the forums where there is likely to be more traffic.
Since I manage my ebook collection on a headless Ubuntu machine running Calibre, I wanted a similar solution for my comics collection in YACReader. After a lot of searching, I eventually got around to writing a shell script that allows YACReader Library to be started automatically without any input from me.
Warnings and dependencies:
1. The script has only been tested on Ubuntu 14.04. Given it's minimal dependencies (See #2), it will likely run as-is on other Debian derivatives such as Mint, Xubuntu etc. but other distros such as CentOS will likely require tweaking. OSX support will require someone smarter than me at the wheel.
2. The script requires Xvfb, wmctrl, VNC and some flavor of window manager to be installed. Command to install Xvfb/wmctrl/VNC on Ubuntu 14.04 is:
3. The default Window Manager the script looks for is xfwm4 (XFCE4). Try "metacity" if you are using GNOME by default.
Script to launch YACReader Library "headless" - yaclaunch.txt (Rename to yaclaunch.sh)
Make the script executable and then add the following line to your crontab to have YACReader launch on startup:
Finally, here's a separate script to kill the YACReader Library session - killyac.txt (Rename to killyac.sh)
The script is mostly shellcheck compliant (with 1 exception), but at the same time it's not extensively tested. If you spot something you can comment on this thread (which I will try and check regularly) or even better, send me a patch file on Bitbucket: bitbucket.org/avggeek/unixscripts
Please Log in or Create an account to join the conversation.
- carmat06
- Offline
- New Member
-
- Posts: 17
- Thank you received: 0
I have a few quick questions:
Should I change the user variable to an existing user on my system, or leave it as yac?
I am running linux mint, can I run the script without installing xfrce4 or any additional window mangers? I'd like to run it under the default cinnamon desktop manager, but I'm not sure what to put in the script for that.
Please Log in or Create an account to join the conversation.
- avggeek
- Topic Author
- Offline
- New Member
-
- Posts: 6
- Thank you received: 0
carmat06 wrote: Should I change the user variable to an existing user on my system, or leave it as yac?
Sorry I didn't reply earlier - I thought I had enabled email notifications for replies but never got anything.
Yes - you should change the user variable to something other than yac. It should be run as the user who has write access to the folder where your YACReader Library is stored. You should also add the cron job under the same User ID. As mentioned in the script, just make sure that there is no other program running under the same user that uses Xvfb (XBMC is an example that comes to mind) as the script kills all Xvfb sessions on startup.
carmat06 wrote: I'd like to run it under the default cinnamon desktop manager, but I'm not sure what to put in the script for that.
I've not used Cinnamon or Mint, so this is based off what I can lookup but you can try changing the line
to
Please Log in or Create an account to join the conversation.
- carmat06
- Offline
- New Member
-
- Posts: 17
- Thank you received: 0
When I run the script I get an error:
However, everything works regardless. Is this an error I need concern myself with?
Thanks again avggeek for putting this together.
Please Log in or Create an account to join the conversation.
- avggeek
- Topic Author
- Offline
- New Member
-
- Posts: 6
- Thank you received: 0
carmat06 wrote: For anyone else wanting to use this, I ended up using WMGR="cinnamon" on Linux Mint 17.1 and it worked great.
When I run the script I get an error:Code:Cannot get client list properties. (_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
However, everything works regardless. Is this an error I need concern myself with?
Thanks again avggeek for putting this together.
carmat06 - is that error appearing when you run the yaclaunch script? If so, that may be because the script initially tries to kill any running YACReader sessions. Since you have specified "cinnamon" as the WMGR, that makes wmctrl try to kill any windows belonging to the desktop manager (Cinnamon) and not the Window Manager (muffin). It's possible that the desktop manager does not report any windows underneath it and hence the error appears, else it could be that there are no windows running for the user you have specified and hence the error.
Can you try running the killyac script and seeing if that works?
Please Log in or Create an account to join the conversation.
- to0nman
- Offline
- New Member
-
- Posts: 7
- Thank you received: 0
Works great, thanks!
Can you see any issues with running this using lightdm as the window manager?
(is lightdm more resource intensive?)
Please Log in or Create an account to join the conversation.
- avggeek
- Topic Author
- Offline
- New Member
-
- Posts: 6
- Thank you received: 0
Please Log in or Create an account to join the conversation.