Code Monkey home page Code Monkey logo

xcowsay's Introduction

xcowsay

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:

  1. Colorful text output (CSI codes)
  2. Refreshing and animations
  3. Multiple fonts

Colors

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 term

or 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

Requirements

  1. Cargo (Rust)
  2. libx11-dev

And one of the screensavers:

  • XScreenSaver
  • xfce4-screensaver

Installation & configuration

Compile xcowsay

To compile xcowsay run:

cargo build --release

Install xcowsay for XScreenSaver

  1. Add module to XScreenSaver configuration file. Edit ~/.xscreensaver file and add programs: xcowsay (or modify programs section if exists). For more info about installing own module see: [http://www.dis.uniroma1.it/~liberato/screensaver/install.html].
  2. Copy xcowsay program to XScreenSaver binaries
  3. 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

Install xcowsay for xfce4-screensaver

  1. Copy xcowsay program to xfce4-screensaver binaries
  2. 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

Configuration

Following params can be configured in screensaver settings GUI:

  • -d delay - delay to next command execution in seconds
  • -c command - command to be executed
  • -r randomize - randomize starting position of the output
  • -f font - (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-*-*-*-*-*-*-*. Use xlsfonts command 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)

Install special cows

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

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"'

Development

Style:

  1. Use rustfmt code style and clippy.
  2. Add blank line in the end of files.

TODO list:

xcowsay's People

Contributors

tuczi avatar

Stargazers

anna avatar Yuto Nakagawa avatar SV Lentink avatar Amadeusz Leonardo Juskowiak avatar

Watchers

James Cloos avatar  avatar

Forkers

cheese1

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.