Git Product home page Git Product logo

webscreensaver's Introduction

webscreensaver

A screen hack which uses WebKit and works with XScreensaver or XFCE.

NOTE: If you are using Wayland this is unlikely to work. Wayland does not support XScreensaver.

GNOME Users: There have been reports of this not working with Gnome.

Dependencies

  • Python 3
  • xscreensaver or xfce4-screensaver
  • GTK3
  • WebKit2 gtk

On Ubuntu, try this command:

    sudo apt install python3 python3-gi gir1.2-webkit2-4.0 gir1.2-gtk-3.0

Install (XScreensaver)

Copy webscreensaver into /usr/libexec/xscreensaver (or /usr/lib/screensaver on some systems) and then edit ~/.xscreensaver:

    programs:
                  webscreensaver                  \n\

If you wish to set the url:

    -url <url_to_the_page_you_want>

Otherwise it will choose a random one.

You can persist cookies by specifying a cookie file:

    -cookie-file <path_to_cookie_file>

NOTE: All parameters should be all on the same line as webscreensaver

Install (XFCE)

  1. Copy webscreensaver into /usr/lib/xscreensaver.
  2. Copy webscreensaver.desktop into /usr/share/applications/screensavers.

Sites List

The list of sites chosen can be customised via a configuration file (TOML).

The format of the file is series of sections (one per site) as follows:

    [thisisasite]
    url = "http://abcd.efg"
    inject_css = "body { color: black }"
    remove_tags = ["header", "hullo"]
    remove_ids = ["hellohello", "heyhey"]

The inject_css, remove_tags and remove_ids keys are used to apply customisations to the page after it has loaded. The value can be either a single string or a list of strings.

  • inject_css - the CSS string will be injected into the page.
  • remove_tags - all tags matching the specified tag name will be removed.
  • remove_ids - all tags with the specified IDs will be removed.

Cycling

If you set your screensaver settings to "cycle", you should use -cycle which will pick the next screensaver in the list each time WebScreensaver is run. (Cycling is implemented in XScreensaver by stopping the current screensaver program and starting another one -- even in the case of a single screensaver being selected.)

3rd Party Packages

You can install webscreensaver easily using these packages (unsupported):

webscreensaver's People

Contributors

jboero avatar lmartinking avatar lmk-savvi avatar mindcombatant avatar tom-mi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webscreensaver's Issues

WebGL never enabled?

In the WebScreensaver class, you have:

    def setup_browser(self):
        '''Sets up WebKit in our window'''
        self.browser = WebKit.WebView()

        # Try to enable webgl
        try:
            settings = browser.get_settings()
            settings.set_property('enable-webgl', True)
        except:
            pass

On the fourth last line, settings = browser.get_settings() refers to the identifier browser which is never imported or defined. As a result, you always get an exception which is silently caught. This should probably be settings = self.browser.get_settings() instead.

React-core.min.js throwing an error

/usr/lib/webscreensaver -url https://p.datadoghq.com/sb/<public URL>?tv_mode=true

result:
Console reports:
** Message: console message: https://p.datadoghq.com/static/v/34.261313/js/react-core.min.js @16: uncaught

And the display is just plain ooooogly

Rendering issue when using Raspberry OS 64-bit (aarch64)

Web browser is not rendering correctly on Raspberry OS systems. Chromium browser is working just fine.

  • uname -a: Linux $HOSTNAME 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux
  • .xscreensaver: .xscreensaver

If you would need any other logs, etc. please let me know :)

Error preview (my custom site):
screenshot

Error preview (google.com):
screenshot (1)

webscreensaver xscreensaver combination not working CentOS 9

Hi there,

My plan is to use xscreensaver with webscreensaver to display a website during inactivity in some CentOS 9 clients.
I have installed the following packages:

  • xscreensaver-base-6.05-3.el9.x86_64
  • xscreensaver-extras-6.05-3.el9.x86_64
  • xscreensaver-gl-base-6.05-3.el9.x86_64
  • xscreensaver-gl-extras-6.05-3.el9.x86_64
  • xscreensaver-6.05-3.el9.x86_64
  • gtk3.x86_64
  • gtk3-devel.x86_64

I downloaded the following script to a directory on my system: https://raw.githubusercontent.com/lmartinking/webscreensaver/master/webscreensaver.

After that I tested if I could open websites with webscreensaver and it worked.
The xscreensaver sample screensavers also works, but the combination of the two does not work.
After xscreensaver & I get a black screen, but the webscreensaver command is running.

Could you please help me?

I'm running in a virtual machine, but the dedicated clients aren't working either.

Videos aren't being played

First time I opened something with webscreensaver it said I had no webkit installed, or something like "namespace webkit not available", message was in yellow. Searching a bit, I found I needed this: gir1.2-webkit-3.0. Installed it, worked fine until I tried to play a video. The video works in Chrome and Firefox, but not in the webscreensaver.
All I know for now is that it uses this user-agent, not sure if this can help someone to help me:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/538.15 (KHTML, like Gecko) Version/8.0 Safari/538.15

Also I'm using this HTML+JS https://github.com/archagy/webnuxsaver, should I post this issue there as well?

THANKS!

I have been looking for something to do this for ages, and finally I stumbled across this repo. I am so surprised you don't have more stars! I will probably write a blog post about this over the next week or so to try spread the word about this repo.

Thanks for your good work

very high CPU usage

I'm using webscreensaver with https://github.com/archagy/webnuxsaver to display videos. webnuxsaver is essentially just an html page with a

I'm using a 149MB .mp4 video (i'm not sure if size has anything to do with it). and it's consuming my entire CPU to the point of making my laptop almost unresponsive.

any ideas?

edit: also, this crashes xscreensaver when I try and preview.

A tiny problem...

I tried installing this screensaver on my Ubuntu 15.10 and if I leave my computer idle I get a black screen with a few lines of yellow text. Is there something I'm not doing correctly? I copied the file, edited the programs section and selected webscreensaver as my screensaver in xscreensaver...

Deprecation Warnings

I have webscreensaver installed along with xscreensaver. I am running Debian 11(bullseye). Seeing the following deprecation warnings:

  • /usr/libexec/xscreensaver/websccreensaver:55: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "type" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations self.win = Gtk.Window(Gtk.WindowType.POPUP)
  • /usr/libexec/xscreensaver/websccreensaver:90 DeprecationWarning: WebKit2.Settings.set_enable_accelerated_2d_canvas is deprecated settings.set_enable_accelerated_2d_canvas(True)

I don't know Python well enough to go poking through the code to try and fix this. Any help would be greatly appreciated. Thanks!

Please update instructions to advise which packages to install in Ubuntu

Suggestions for those wanting to install in Ubuntu based upon my semi-n00b experience:

  • Ubuntu 16.04.4 LTS uses xscreensaver 5.34 which is a few years old; good luck on building the newer version. Instead I suggest installing xUbuntu 17.10.1 which comes with xscreensaver 5.36 (not the latest version, but close enough to work)
  • In addition, Ubuntu Desktop 17.10.1 comes with Wayland / gdm -- which throws errors with xscreensaver when it comes to advanced-compositing or screen-locking. Instead, I suggest installing Lubuntu 17.10.1 which comes with lxde which does play nicely with xscreensaver.
  • Here are the things one must install to get webscreensaver to work in Lubuntu 17.10.1:
    $ sudo apt update && sudo apt install -y python2.7 python-gi libwebkitgtk-3.0.0 gir1.2-webkit-3.0 at-spi2-core
    $ xscreensaver
    (click Settings, wait for the list of and then close out of xscreensaver -- this will make sure you have a complete ~/.xscreensaver file)
  • Here's an easy way to see if it's working via the command-line:
    $ /usr/lib/webscreensaver -url https://www.google.com/

Missing from xscreensaver

Hi,

This is awesome if I can get it to work. I have moved webscreensaver into /usr/lib/xscreensaver but i cant see it as an option in the xscreensaver popup, which is what i need to do right? I need to select it and also edit the ~/.xscreensaver file (which doesnt exist). I am on ubuntu mate 16. Please help this would be amazing to geet working!

Thanks Tim

webscreensaver not working with Ubuntu 19.10

System Environment:

Ubuntu 19.10 Eoan Ermine
5.3.0-19-generic
Unity
XScreenSaver 5.42

I can choose webscreensaver from the drop down menu list in xscreensaver-demo and the screen is getting black after 1 minute, but it doesn't appear any url, neither a random one nor a specific.
xscreensaver.txt
Any ideas?

Determine if screensaver is active or not

Thanks a lot for sharing this nice little feature. It works very well for us.
But I realized, that the process keeps running, even when the screensaver is not active.
For us that is a problem, because the screensaver-webpage fetches news by using a JavaScript interval and they should only be pulled when the screensaver is running.
I already tried a JavaScript check like document.hidden without success.
Does someone has any idea on how to check if the screensaver is really visible?
Thanks a lot!

Hangs in Fedora 23

I installed webscreensaver on my Fedora 23 laptop according to the instructions (with the -url parameter). When I launch xscreensaver-demo, the preview is empty and I see about 10 webscreensaver processes started. The XScreensaver window becomes unresponsive and has to be killed.

When run manually from the command line, webscreensaver -url <url> works perfectly displaying the web page in a window.

Can't edit .xscreensaver file. Not showing up in menu

I have been trying to get this to work & I can't figure out why it's not working. I am running a laptop with Proxmox, I installed XFCE4, Installed sudo apt install python3 python3-gi gir1.2-webkit2-4.0 gir1.2-gtk-3.0, Copy webscreensaver into /usr/lib/xscreensaver, Copy webscreensaver.desktop into /usr/share/applications/screensavers it wasn't working so I also copied webscreensaver into /usr/libexec/xscreensaver since that's where all of the screensavers seem to be, edited the webscreensaver.desktop to point to it, but it never shows up in the screensavers list.

I noticed that when I edit ~/.xscreensaver (for me residing in /home/USERNAME/.xscreensaver) any edits I make to it are gone once the screensaver daemon is refreshed or just some time passes. It's not that I can't edit it. It edits just fine & if I close it & reopen it right after my changes are there, but they don't stick. What am I doing wrong?

msft windows?

is there a way to make this work for msft windows?

Webscreensaver no content on blank screen CentOS Stream 8

Hello,

I'm trying to built a kiosk client with a screensaver which shows a website. The screensaver would show basic information and the normal browser shows an interactive menue. I installed webscreensaver to /usr/bin/ so I can launch it via xscreensaver.
When I am entering a low timeout, so i can watch, that the xscreensaver should do something, it shows only a black (blank) screen and not the infopage.
If I wait for timeout I can see cal with ps auxl: kiosk 5815 11.7 7.8 86250048 88068 tty2 SNl+ 17:32 0:00 python3 /usr/bin/webscreensaver -url https://liveuamap.com/de

But the screen is still empty (blank/black).

Do you have an idea for this problem?

Regards,
nurbecause

Works from command line; empty white screen when used within xscreensaver

Hi there,

Brand-new install of Linux Mint 18.3 x64. Installed via apt the xscreensaver package -- which installed xscreensaver 5.34.

I'm able to get webscreensaver to work from the command line:

webscreensaver -url https://www.google.com

Results in a window that shows the Google home page

Configured a programs entry in ~/.xscreensaver:

programs:                                                                              \
                 webscreensaver -url https://www.google.com   \n\

Webscreensaver is in the list of screensavers in xscreensaver. Other xscreensaver screensavers do work. But the preview in the xscreensaver GUI for webscreensaver shows a white screen.

Xscreensaver does seem to execute webscreensaver: if I put in an invalid parameter in the ~/.xscreensaver file, such as:

programs:                                                                             \
                 webscreensaver -foo -url https://www.google.com   \n\

The resulting preview ends up being a black screen with yellow text telling me that -foo is an invalid parameter.

Help?

No licence

@tom-mi I haven't formally defined a licence for this project. I got an email from someone who wanted to make a debian package however they need an official licence. I want to run this past you since you've made nontrivial contributions.

Would you be OK with GPLv2 or 3?

could not execute webscreensaver: No such file or directory -> Solution

I had to add "/usr/lib/xscreensaver" to the PATH variable in "/etc/environment".
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/xscreensaver"
Log out and log in.
After that everything worked fine.

Maybe you could add with to your README.

Kind regards,
K1LLUM1N471

Ideas for further development.

I think a url "hack" config file would be a nice addition. something like -config-file: and then urls set up in the same parsing as in the random hacks routine. I keep forgetting to bash on this so I figured I'd drop it as an idea.

I also think a switch for xscreensaver(no idea how this works) to make it read the url list sequentially instead of the current random would be useful. As above. Time and brainpower not in abundance right now. I blame astronomy.

Problem

What am i doing wrong?

 msev  ~  xscreensaver-demo
Traceback (most recent call last):
File "/usr/lib/xscreensaver/webscreensaver", line 27, in
import gi
ImportError: No module named gi
Traceback (most recent call last):
File "/usr/lib/xscreensaver/webscreensaver", line 27, in
import gi
ImportError: No module named gi

BadDrawable (invalid Pixmap or Window parameter)

i was not able to get it run properly and below was the error received. please help, thanks~

** (webscreensaver:13487): WARNING **: The program 'webscreensaver' received an X Window System error.
This probably reflects a bug in the Adobe Flash plugin.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
(Details: serial 370 error_code 9 request_code 139 minor_code 4)

Could we get a redo on this to use something besides the deprecated and unstable webkit?

I haven't gotten web video to run in about a year and recently switched to 18.04 xubuntu only to find that midori is no longer in repo. I haven't been able to solve dependencies to get back to where I was. I really liked being able to get a web page and had actually hacked a bunch of url's into the code. Breaking the url list out to a config file would be terrific too, as would a swtich to allow sequential display of sites.
I had video from the ISS hdev experiment and several websites and webcams running randomly while I worked and really miss them. I've fiddled a bit but I'm not very good with this style of code.
(or any really/getting better with arduino and a bit of c)

@lmartinking please heeaalp!

ubuntu 20.04 - not installed

Cool program, runs well from terminal.
Does not work with xscreensaver 5.42, xscreensaver-demo shows
Not installed
Tried to run the script itself and via python3, from
"$HOME/python/webscreensaver/webscreensaver"
and /usr/lib/xscreensaver
Doesn't it need to use the whole screen instead of a window?

described files / directions do not exist

Hey there, have a few challenges:

  1. /usr/lib/xscreensaver does not exist

I found the /usr/libexec/xscreensaver directory and copied the webscreensaver file inside.

  1. In the direction /usr/libexec/xscreensaver is no .xscreensaver file. I found it at the home directory, added the webscreensaver \n
    However, I can't choose webscreensaver at the xscreensaver GUI (also after running the python file)

  2. Where exactly should I add the URL I wan't
    -url <url_to_the_page_you_want>?

It would be very well, if you could help me, because a webpage as a screensaver is amazing! Thank you in advance

systemwide config

hello,
is it possible to edit webscreensaver file directly for system-wide setting or is there any other way?
thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.