fortune | cowsay as screensaver in XScreenSaver and xfce4-screensaver!
xcowsay allows you to run ANY Linux command and display the output as your screensaver. Command will be refreshed (rerun) by xcowsay automatically.
It supports:
- Colorful text output (CSI codes)
- Refreshing and animations
- Multiple fonts
xcowsay respects CSI (ANSI escape sequences) so your output can be colored! Try setup below command in settings:
fortune -a | fmt -80 -s | $(shuf -n 1 -e cowsay cowthink) -$(shuf -n 1 -e b d g p s t w y) -f $(shuf -n 1 -e $(cowsay -l | tail -n +2)) -n | toilet -F gay -f termor use lolcat animation:
fortune -a | fmt -80 -s | $(shuf -n 1 -e cowsay cowthink) -$(shuf -n 1 -e b d g p s t w y) -f $(shuf -n 1 -e $(cowsay -l | tail -n +2)) -n | lolcat -fas 50- Cargo (Rust)
- libx11-dev
And one of the screensavers:
- XScreenSaver
- xfce4-screensaver
To compile xcowsay run:
cargo build --release- Add module to XScreenSaver configuration file. Edit
~/.xscreensaverfile and addprograms: xcowsay(or modifyprogramssection if exists). For more info about installing own module see: [http://www.dis.uniroma1.it/~liberato/screensaver/install.html]. - Copy xcowsay program to XScreenSaver binaries
- Copy xcowsay.xml file to XScreenSaver configuration directory
E.g.
cp target/release/xcowsay /usr/lib/xscreensaver
cp xscreen-config/xcowsay.xml /usr/share/xscreensaver/config
Make sure that files have proper permissions set for read and execution
- Copy xcowsay program to xfce4-screensaver binaries
- Copy xcowsay.desktop file to xfce4-screensaver configuration directory E.g. for Xubuntu:
cp target/release/xcowsay /usr/libexec/xfce4-screensaver/xcowsay
cp xscreen-config/xcowsay.desktop /usr/share/applications/screensavers/xcowsay.desktop
Make sure that files has proper permissions set for read and execution
Following params can be configured in screensaver settings GUI:
-ddelay - delay to next command execution in seconds-ccommand - command to be executed-rrandomize - randomize starting position of the output-ffont - (advenced) font to be used to display the output of the command. Use X logical font description (XLFD) format to specify the font e.g.-*-fixed-*-r-*-*-14-*-*-*-*-*-*-*. Usexlsfontscommand to list avaliable fonts
xfce4-screensaver settings GUI is not supported yet. As a workaround you can edit xcowsay.desktop file and add your parameters to Exec section.
Other options:
-D- debug mode. It runs xcowsay in separate window instead of root window (screensaver)
This step is optional.
You can install additional cows for cowsay eg. colorful christmas tree. To do that just copy them to cowsay cows directory:
cp cows/* /usr/share/cowsay/cows
Debug mode runs xcowsay in separate window instead of root window (screensaver). To enable it use -D switch.
E.g.: cargo run -- -D -d 5 -c 'echo "Hello \e[31;42mXCowsay\e[0;32m (debug mode)\e[0m"'
Style:
- Use
rustfmtcode style andclippy. - Add blank line in the end of files.
- add proper configuration layer for xfce4-screensaver - check out https://git.xfce.org/apps/xfce4-screensaver/tree/savers/floaters.c