Skip to content
YACReader
Help and support for Linux users.

"Startup" script for YACReader Library

  • avggeek
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 8 months ago #1043 by avggeek
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:
Code:
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:
Code:
@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

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #1045 by carmat06
Replied by carmat06 on topic "Startup" script for YACReader Library
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.

Please Log in or Create an account to join the conversation.

  • avggeek
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 7 months ago #1065 by avggeek
Replied by avggeek on topic "Startup" script for YACReader Library

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

to
Code:
WMGR="muffin"
Hope that helps!

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago - 11 years 6 months ago #1155 by carmat06
Replied by carmat06 on topic "Startup" script for YACReader Library
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.
Last edit: 11 years 6 months ago by carmat06.

Please Log in or Create an account to join the conversation.

  • avggeek
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 6 months ago #1166 by avggeek
Replied by avggeek on topic "Startup" script for YACReader Library

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.

More
10 years 8 months ago #1985 by to0nman
Replied by to0nman on topic "Startup" script for YACReader Library
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?)

Please Log in or Create an account to join the conversation.

  • avggeek
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 8 months ago #2012 by avggeek
Replied by avggeek on topic "Startup" script for YACReader Library
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.

Please Log in or Create an account to join the conversation.

Moderators: Luis Ángel
Powered by Kunena Forum

Thanks for downloading YACReader!

Your download is starting.

YACReader for iOS and Android

Connect to YACReaderLibrary to browse, read remotely and import comics. Your reading progress is synchronized across devices.

Download on the App Store Get it on Google Play Available at Amazon Appstore

Discover all the features on the iOS and Android pages, and learn how to use them in the iOS and Android user guides.

Support YACReader

YACReader for desktop and server is free to use, but it is not free to develop: maintaining this website, developer programs, code signing certificates, test devices and, of course, all the time it takes. Less than 0.01% of downloads end in a donation, so any amount counts.

By supporting the project you help keep it regularly updated and, most importantly, alive. Thanks!