Welcome to the forum, Guest

TOPIC: "Startup" script for YACReader Library

"Startup" script for YACReader Library 9 years 2 months ago #1043

avggeek

Offline

Fresh Boarder

Posts: 6

Karma: -1

Hello,

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:
sudo apt-get install xvfb wmctrl x11vnc

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:
@reboot /path/to/script/yaclaunch.sh >/dev/null 2>&1

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
Attachments:
The administrator has disabled public write access.

"Startup" script for YACReader Library 9 years 2 months ago #1045

carmat06

Offline

Fresh Boarder

Posts: 17

Karma: 0

Thanks for posting this, I have been wanting something like this.

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.
The administrator has disabled public write access.

"Startup" script for YACReader Library 9 years 2 months ago #1065

avggeek

Offline

Fresh Boarder

Posts: 6

Karma: -1

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
WMGR="xfwm4"

to
WMGR="muffin"
Hope that helps!
The administrator has disabled public write access.

"Startup" script for YACReader Library 9 years 1 month ago #1155

carmat06

Offline

Fresh Boarder

Posts: 17

Karma: 0

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:
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.
Last Edit: 9 years 1 month ago by carmat06.
The administrator has disabled public write access.

"Startup" script for YACReader Library 9 years 1 month ago #1166

avggeek

Offline

Fresh Boarder

Posts: 6

Karma: -1

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:
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?
The administrator has disabled public write access.

"Startup" script for YACReader Library 8 years 3 months ago #1985

to0nman

Offline

Fresh Boarder

Posts: 7

Karma: 0

I gave up trying to compile the experimental --no-gui stuff and just ran it this way on Ubuntu 14.04 LTS

Works great, thanks!

Can you see any issues with running this using lightdm as the window manager?
(is lightdm more resource intensive?)
The administrator has disabled public write access.

"Startup" script for YACReader Library 8 years 3 months ago #2012

avggeek

Offline

Fresh Boarder

Posts: 6

Karma: -1

Hi there! I don't think there should be an issue with using lightdm - the script does not launch anything other than the base window manager so if your system has sufficient memory to run a full desktop environment, this shouldn't be a problem. I use xfce simply because I didn't like Gnome3.
The administrator has disabled public write access.
Powered by Kunena Forum