brunobraga / termsaver Goto Github PK
View Code? Open in Web Editor NEWSimple text-based Terminal Screensaver
Home Page: https://github.com/brunobraga/termsaver
License: Apache License 2.0
Simple text-based Terminal Screensaver
Home Page: https://github.com/brunobraga/termsaver
License: Apache License 2.0
When I run the matrix screensaver on the RPi I do not see any of the japanese characters :(
Hi team,
Regarding to the clock, could you please make it be colored?
That's great if the clock is able to be colorized/glowed.
System: macOS 10.15
Command: pip3 install termsaver
Expected result: cool screensavers
Actual result:
Installer falls over while trying thank me
Downloading https://files.pythonhosted.org/packages/9a/b0/4428c151d94b5358dd92b92c045cd40b448ff65a37b994ecb7252ad559f8/termsaver-0.4.tar.gz (46kB)
|████████████████████████████████| 51kB 1.1MB/s
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/c7/vx918ndx0v3g_j49c1tf4_8w0000gn/T/pip-install-x0k8wubc/termsaver/setup.py", line 103
"""
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("""
Thank you for trying termsaver.
""")?
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/c7/vx918ndx0v3g_j49c1tf4_8w0000gn/T/pip-install-x0k8wubc/termsaver/
The clock says Friday, 11st March 2016.
Is this a bug on the system clock termsaver uses, or something in termsaver? 'st' works fine for 1st, 21st, 31st, but 11st just sounds weird.
https://github.com/chubin/wttr.in
Small script that generates weather forecasts on a set location, might be useful to integrate as an additional screensaver option in termsaver?
By running:
$ termsaver quotes4all -v
When it comes time for the loop to reconnect to the internet, it throws the following error:
termsaver.quotes4all: Connecting to http://quotes4all.net/rss/360010110/quotes.xml ... (this could take a while)
Oops! Error while trying to fetch from http://quotes4all.net/rss/360010110/quotes.xml. Could not fetch URL, because [Errno 54] Connection reset by peer
Exception: (UrlException) Could not fetch URL, because [Errno 54] Connection reset by peer
Traceback (most recent call last):
File "/usr/local/bin/termsaver", line 159, in
parse_args(sys.argv[1:])
File "/usr/local/bin/termsaver", line 143, in parse_args
screen().autorun(args[1:])
File "/Library/Python/2.7/site-packages/termsaverlib/screen/base/init.py", line 237, in autorun
self._run_cycle()
File "/Library/Python/2.7/site-packages/termsaverlib/screen/base/rssfeed.py", line 238, in _run_cycle
self.doc_xml_string(self.fetch(self.url))
File "/Library/Python/2.7/site-packages/termsaverlib/screen/helper/urlfetcher.py", line 167, in fetch
_("Could not fetch URL, because %s") % e.reason)
UrlException: Could not fetch URL, because [Errno 54] Connection reset by peer
The figlet application is a complete ascii text formatter with a huge diversity in fonts and sizes, a perfect match to termsaver.
Currently available there are the figlet and pyfiglet, which is the python implementation of the original application.
Still considering which way to go:
Fond this while implementing figlet plugin:
Crash Report:
Oops! Something went terribly wrong.
Error details: empty range for randrange() (0,-154, -154)
===================================
Exception: (ValueError) empty range for randrange() (0,-154, -154)
Traceback (most recent call last):
File "./termsaver", line 159, in <module>
parse_args(sys.argv[1:])
File "./termsaver", line 143, in parse_args
screen().autorun(args[1:])
File "/home/bruno/git/termsaver/termsaverlib/screen/base/__init__.py", line 237, in autorun
self._run_cycle()
File "/home/bruno/git/termsaver/termsaverlib/screen/figlet_stat.py", line 127, in _run_cycle
self.randomize_text_horizontally(figlet_text))
File "/home/bruno/git/termsaver/termsaverlib/screen/helper/position.py", line 154, in randomize_text_horizontally
self.pos_x = random.randint(0, self.screen_width - len(text))
File "/usr/lib/python2.7/random.py", line 241, in randint
return self.randrange(a, b+1)
File "/usr/lib/python2.7/random.py", line 217, in randrange
raise ValueError, "empty range for randrange() (%d,%d, %d)" % (istart, istop, width)
ValueError: empty range for randrange() (0,-154, -154)
===================================
As of this moment, the script is not working properly. Searching for alternatives.
Since asciiartfarts
is dead since 2014 could we have a randomization option to start farts display at different offset each time?
Would be cool if possible to password-protect, similar to xscreensaver-command -lock.
Perhaps integrate with vlock?
termsaver.asciiartfarts: Connecting to http://www.asciiartfarts.com/random.cgi ... (this could take a while)
Traceback (most recent call last):
File "/usr/lib/python3.10/urllib/request.py", line 1348, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/lib/python3.10/http/client.py", line 1282, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output
self.send(msg)
File "/usr/lib/python3.10/http/client.py", line 975, in send
self.connect()
File "/usr/lib/python3.10/http/client.py", line 941, in connect
self.sock = self._create_connection(
File "/usr/lib/python3.10/socket.py", line 824, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/termsaver/termsaverlib/screen/helper/urlfetcher.py", line 172, in fetch
resp = urlopen(req)
File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.10/urllib/request.py", line 519, in open
response = self._open(req, data)
File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/usr/lib/python3.10/urllib/request.py", line 1377, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.10/urllib/request.py", line 1351, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/termsaver", line 8, in
sys.exit(entryPoint())
File "/usr/local/lib/python3.10/dist-packages/termsaver/init.py", line 129, in entryPoint
screen(parser=parser)._parse_args()
File "/usr/local/lib/python3.10/dist-packages/termsaver/termsaverlib/screen/asciiartfarts.py", line 110, in _parse_args
self.autorun()
File "/usr/local/lib/python3.10/dist-packages/termsaver/termsaverlib/screen/base/init.py", line 239, in autorun
self._run_cycle()
File "/usr/local/lib/python3.10/dist-packages/termsaver/termsaverlib/screen/asciiartfarts.py", line 99, in _run_cycle
new_text = self.process_data(self.fetch(self.url)).decode("utf-8")
File "/usr/local/lib/python3.10/dist-packages/termsaver/termsaverlib/screen/helper/urlfetcher.py", line 177, in fetch
raise exception.UrlException(uri,
termsaver.termsaverlib.exception.UrlException: Could not fetch URL, because [Errno -3] Temporary failure in name resolution
In TermSaver v.0.3, if you run termsaver programmer
without a path, part of the error message states:
If you have access to subversion, you may download it at:
svn co https://code.djangoproject.com/svn/django/trunk/ django-trunk
However, Django no longer uses subversion, so the it should be updated to read:
If you have access to git, you may download it at:
git clone https://github.com/django/django.git
Cheers and thanks for the awesome tools,
Zzyzx
Running is, you will see bad ascii image formatting on first and last lines:
Eg:
/^\
/ \
_______/_/_\ \_______
\ ____ ____\ \___ /
\ \ / / \ \ / /
\ / / \ / /
/ / / / WHAT'S WRONG WITH THIS WEIRD STAR
/ / \ / / \ WHY DOES IT LOOK SO WEIRD
/ /_\ \_____/_/_\ \
/_____\ \___________\
\ \ / /
jgs \ ` /
\_/
After having downloaded the source files and running "sudo python setup.py install" it returns a SyntaxError: Missing parentheses in call to 'print' in setup.py, Line 100.
I am running the latest release of Arch Linux and Python.
It would be kinda nice to have the terminal cursor hidden when termsaver is running and back to normal on exit.
I am currently running this:
$ setterm --cursor off && termsaver clock && setterm --cursor on
But if there's any way to make this an option or a default it would be great.
Thanks :)
Greetings,
Not sure what is causing this. I'm running Raspbian on a Raspberry Pi 3, if it makes any difference. Running Python 2.7.9.
Oops! Something went terribly wrong.
Error details: float division by zero
===================================
Exception: (ZeroDivisionError) float division by zero
Traceback (most recent call last):
File "/usr/bin/termsaver", line 161, in <module>
parse_args(sys.argv[1:])
File "/usr/bin/termsaver", line 143, in parse_args
screen().autorun(args[1:])
File "/usr/share/termsaver/termsaverlib/screen/base/__init__.py", line 238, in autorun
self._run_cycle()
File "/usr/share/termsaver/termsaverlib/screen/sysmon.py", line 168, in _run_cycle
self.update_stats()
File "/usr/share/termsaver/termsaverlib/screen/sysmon.py", line 274, in update_stats
cpu = 100 - (dt[len(dt) - 1] * 100.00 / sum(dt))
ZeroDivisionError: float division by zero
===================================
You are more than welcome to report this at:
http://github.com/brunobraga/termsaver
If you have any questions or there's anything I can do to help you test further, please let me know.
Cheers,
Zzyzx
Produces: the result:
termsaver -hv
Oops! Invalid use of option. It seems you chose an invalid option.. See --help for details.
It would be nice to have this with termsaver:
crtl-c doenst work in start wars screensaver. Couldn't even disconnect with the usual telnet sequence. Hat to sigkill termserver.
Hello, I am having trouble installing termsaver. Currently on macos, getting this error:
$ pip install termsaver
Collecting termsaver
Downloading termsaver-0.4.tar.gz (46 kB)
|████████████████████████████████| 46 kB 3.1 MB/s
ERROR: Command errored out with exit status 1:
command: /Users/kylepollina/d3/app/smart-search/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qr/b30k7lmx2fsf4cdzr371yn_w0000gp/T/pip-install-3l5etrka/termsaver/setup.py'"'"'; __file__='"'"'/private/var/folders/qr/b30k7lmx2fsf4cdzr371yn_w0000gp/T/pip-install-3l5etrka/termsaver/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/qr/b30k7lmx2fsf4cdzr371yn_w0000gp/T/pip-pip-egg-info-m3ppf9mu
cwd: /private/var/folders/qr/b30k7lmx2fsf4cdzr371yn_w0000gp/T/pip-install-3l5etrka/termsaver/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/qr/b30k7lmx2fsf4cdzr371yn_w0000gp/T/pip-install-3l5etrka/termsaver/setup.py", line 101
print """
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(""")?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I think something is wrong with the current setup file on pypi?
Hi, I gather that pynput requires X windows in order to function properly.
I am using termsaver via ssh consoles. Do you know if there is any way to bypass the X requirement? I am researching that now.
I am trying to get the screensaver to exit on (any) keypress.
Thanks a bunch for any input! :)
I am trying to integrate termsaver
in nnn as the default termsaver. I am facing 2 problems:
nnn
disables ^C
at start. Would it be possible to support an additional keybind to exit termsaver
? Perhaps ^Q
?
termsaver
clears the terminal on exit. However, I need to restore the nnn
window.
Hello, today I tried to install your app to Ubuntu Server 20.04, I have last version of pip installed here, how you're saying in README.md, i ran sudo pip install termsaver
. And got that output:
Collecting termsaver
Using cached termsaver-0.4.tar.gz (46 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-zk6wuiq_/termsaver_62fe2076d8a1406e9920047884ff730c/setup.py", line 101
print """
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I'm not Python developer, (more i know in golang), but how i can undersatnd, it have Syntax Error. And pip i ssaying, that note: This is an issue with the package mentioned above, not pip.
.
So, if you can, please, explain to me, that i did wrong, or fix that error.
Thank you for putting your time in this post.
Another great addition would be the ability to quit termsaver with any input, like cmatrix -s
, instead of necessarily having to SIGINT out of it.
What is the simplest way to add a screen saver to my local termsaver?
I've seen the figlet plugin and it is a little bulky. I wrote a screen but I'm having difficulty getting termsaver to pick it up. Here is my plugin.
import time
import sys
from termsaverlib.screen.base import ScreenBase
from termsaverlib.screen.helper.typing import TypingHelperBase
from termsaverlib.screen.helper.position import PositionHelperBase
from termsaverlib import common, exception, constants
from termsaverlib.i18n import _
class LocalQuotesScreen(ScreenBase, TypingHelperBase, PositionHelperBase):
sleep_between_items = 0
char_delay = 0.15
line_delay = 1.5
data = None
def __init__(self):
ScreenBase.__init__(self, "quotes", "display quotes from local file", {
'opts': ':p:',
'long_opts': ['path='],
})
def _usage_options_example(self):
print _(""" """)
def _parse_args(self, prepared_args):
for option, arg in prepared_args[0]:
if option in ("-p", "--path"):
self._read_file_into_data(arg)
def _read_file_into_data(self, path):
with open(path, 'r') as content_file:
self.data = content_file.read().split("\n\n")
def _run_cycle(self):
self.clear_screen()
for item in self.data:
self.get_terminal_size()
item = self.center_text_vertically(item)
item = self.center_text_horizontally(item)
##
lines = item.split('\n')
for index, line in enumerate(lines):
for char in line:
sys.stdout.write(char)
if char != ' ':
time.sleep(self.char_delay)
sys.stdout.flush()
sys.stdout.write('\n')
if not line.isspace():
time.sleep(self.line_delay)
##
time.sleep(self.sleep_between_items)
self.clear_screen()
Although set as "all" in debian packaging, I received a message about problems when running the debian package in older Ubuntu versions (Ubuntu 10 uses python 2.6). Since there are no fancy stuff done in the code, it should be, for maximum reach of users, accepted under python 2.4.
Due to the randrange() changes introduced in Python 3.12 get_char_list() in matrix.py gets a TypeError.
Following Note Describes Why
Remove randrange() functionality deprecated since Python 3.10. Formerly, randrange(10.0) losslessly converted to randrange(10). Now, it raises a [TypeError](https://docs.python.org/3/library/exceptions.html#TypeError). Also, the exception raised for non-integer values such as randrange(10.5) or randrange('10') has been changed from [ValueError](https://docs.python.org/3/library/exceptions.html#ValueError) to [TypeError](https://docs.python.org/3/library/exceptions.html#TypeError). This also prevents bugs where randrange(1e25) would silently select from a larger range than randrange(10**25).
We just wrap the float type in a python integer parse statement
To be able to release on apt-get stream, we need to provide a deb package and submit it to debian.
What's would be the clean way to execute this screensaver after x seconds of idle time in terminal? Thanks.
OS: Fedora 30
Desktop env: Gnome
I ran the sysmon (both sudo and reg. level), and I got this error message from the verbose output:
Exception: (IOError)
Traceback (most recent call last):
File "/usr/local/bin/termsaver", line 161, in
parse_args(sys.argv[1:])
File "/usr/local/bin/termsaver", line 143, in parse_args
screen().autorun(args[1:])
File "/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/termsaverlib/screen/base/init.py", line 238, in autorun
self._run_cycle()
File "/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/termsaverlib/screen/sysmon.py", line 168, in _run_cycle
self.update_stats()
File "/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/termsaverlib/screen/sysmon.py", line 249, in update_stats
for line in open('/proc/meminfo'):
IOError: [Errno 2] No such file or directory: '/proc/meminfo'
Is there a Way, maybe in the near future to run asciiquarium as an screensaver.
Thanks,
I am trying to install termsaver on my raspberry pi 4 running ubuntu server 21.04.
I tried sudo apt update
and sudo apt install termsaver
, but it says no such package.
I tried to add ppa:bruno-braga/termsaver
but it doesn't work.
I also tried to pip install but theres an error.
Is there a way to do it?
Hi!
When I try to install using sudo python /home/dexter/termsaver/setup.py install
, it says the following:
Traceback (most recent call last):
File "/home/dexter/termsaver/setup.py", line 56, in
'termsaver.mo')]) for lang in os.listdir('locale')]
FileNotFoundError: [Errno 2] No such file or directory: 'locale'
I'm on Fedora 36.
The plugin system needs to be adjusted to align with new changes and updates to how plugins can be handled in Python 3.
When installing on a raspberry pi running Raspberry Pi OS Lite (64 bit) [Debian Bullseye] the following occurs.
pi@raspberrypi:~ $ sudo apt-get install termsaver
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package termsaver
pi@raspberrypi:~ $
I really think RFC and Programmer modules would be more comfortable if they were slower, but I think it would not be much harder to implement a speed setting.
As of now, the scroll speed is way too fast for an idle screen who would stay in sight while working on another screen, and is very distractive.
Using text stdout alone, find a way to output a matrix look-alike screensaver.
Source: http://www.asciimation.co.nz/
hi - SW is busted pls can you remove and update for debian / pi ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.