Last active
February 21, 2020 22:58
-
-
Save cirrusUK/6832961e7b16badddbceea01f655bfad to your computer and use it in GitHub Desktop.
scripts using osd_cat, (xosd) some i put in crontab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#Read Arch Linux RSS news; | |
import feedparser | |
from subprocess import call | |
import re | |
import textwrap | |
d = feedparser.parse("https://www.archlinux.org/feeds/news/") | |
for f in range(0,1): | |
print(d.entries[f].title) | |
xy = d.entries[f].title |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export DISPLAY=":0" | |
export XDG_RUNTIME_DIR=/run/user/$(id -u) | |
/path/to/anews.py | osd_cat -p bottom -A centre -f '-*-pragmatapro-*-*-*-*-29-*-*-*-*-*-*-*' -corange |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RECUPD="$(cat /sys/devices/platform/smapi/BAT0/remaining_running_time)" | |
echo -n "Battery Minutes Remaining" "$RECUPD" | osd_cat -A left -p top -f '-*-pragmatapro-*-*-*-*-24-*-*-*-*-*-*-*' -cgreen -o 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export DISPLAY=":0" | |
export XDG_RUNTIME_DIR=/run/user/$(id -u) | |
UPD="$(checkupdates)" | |
echo -n "Pending Updates" "$UPD" | osd_cat -A center -p middle -f '-*-pragmatapro-*-*-*-*-20-*-*-*-*-*-*-*' -cgreen -l 25 -s 2 -o -55 | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export DISPLAY=":0" | |
export XDG_RUNTIME_DIR=/run/user/$(id -u) | |
FACT=$(wget randomfunfacts.com -O - 2>/dev/null | grep \<strong\> | sed "s;^.*<i>\(.*\)</i>.*$;\1;") | |
echo -n "Factoid : " "$FACT" | osd_cat -A center -p top -f '-*-pragmatapro-*-*-*-*-24-*-*-*-*-*-*-*' -cgreen -o 30 -s 2 -l 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export DISPLAY=":0" | |
export XDG_RUNTIME_DIR=/run/user/$(id -u) | |
fortune -s | osd_cat -A center -o 25 -p top -f '-*-pragmatapro-*-*-*-*-24-*-*-*-*-*-*-*' -cgreen -s5 | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export DISPLAY=":0" | |
export XDG_RUNTIME_DIR=/run/user/$(id -u) | |
NP="$(mpc current -h 192.168.1.33)" | |
echo -n "MPD Now Playing :" "$NP" | osd_cat -p bottom -A center -f '-*-pragmatapro-*-*-*-*-24-*-*-*-*-*-*-*' -cgreen -s5 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export DISPLAY=":0" | |
export XDG_RUNTIME_DIR=/run/user/$(id -u) | |
MPVNP=$(ponymix list --short | awk -F '\t' '/sink-input/ && $4 == "mpv Media Player" {print $3}' ) | |
echo -n "Now Playing: " "$MPVNP" | osd_cat -A center -p bottom -f '-*-roboto-*-*-*-*-34-*-*-*-*-*-*-*' -c '#ffafff' -s 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#export DISPLAY=":0,0" | |
export XDG_RUNTIME_DIR=/run/user/$(id -u) | |
RECUPD="$(tac /var/log/pacman.log | sed -n '/full system upgrade/q;s/.*\[ALPM\] upgraded //p')" | |
echo -n "Recent Updates" "$RECUPD" | osd_cat -o 35 -A right -p top -f '-*-pragmatapro-*-*-*-*-14-*-*-*-*-*-*-*' -cgreen -l 30 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
##################### | |
# Config | |
CHANNEL='Master' | |
FONT='10x20' | |
#################### | |
# Code | |
action=$1; shift | |
# Unmute the volume and increase/decrease it | |
# Arg 1: volume change to set (1+ or 1-) | |
set_volume() { | |
amixer sset $CHANNEL unmute &> /dev/null & | |
volume=$(amixer sset $CHANNEL $1 unmute | \ | |
grep "Left: Playback" | \ | |
grep -o "\[[0-9]*%\]" | \ | |
tr '[%]' ' ') | |
} | |
# Get the current volume % | |
# No args | |
get_volume() { | |
volume=$(amixer sget $CHANNEL | \ | |
grep "Left: Playback" | \ | |
grep -o "\[[0-9]*%\]" | \ | |
tr '[%]' ' ') | |
} | |
# Toggle Master volume mute on/off | |
# No args | |
mute_volume() { | |
status=$(amixer sset $CHANNEL toggle | \ | |
grep "Left: Playback" | \ | |
grep -o "\[on\]\|\[off\]" | \ | |
tr '[]' ' ') | |
} | |
# Use xosd to show a volume guage on the screen | |
# Arg 1: Current volume as percent of full volume | |
# Arg 2: (optional) Text to show above bar | |
show_volume() { | |
killall -9 -q osd_cat &>/dev/null | |
osd_cat --font="$FONT" --shadow=1 --color=green --pos=middle --align=center --delay=2 --text "$( [ "z$1" = "z" ] && echo Volume: $2% || echo $1 )" --barmode=percentage --percentage=$1 | |
} | |
case "$action" in | |
show) | |
get_volume | |
show_volume $volume | |
;; | |
incr) | |
delta=1+ | |
set_volume $delta | |
show_volume $volume | |
;; | |
decr) | |
delta=1- | |
set_volume $delta | |
show_volume $volume | |
;; | |
mute) | |
mute_volume | |
case "$status" in | |
off) | |
show_volume 0 "Muted" | |
;; | |
on) | |
get_volume | |
show_volume $volume | |
;; | |
esac | |
;; | |
*) | |
echo "Usage: $0 {incr|decr|mute|show}" | |
;; | |
esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export DISPLAY=":0" | |
export XDG_RUNTIME_DIR=/run/user/$(id -u) | |
ansiweather -a false -l glasgow -u metric | rev | cut -c48- | rev | osd_cat -o 55 -A centre -p top -f '-*-pragmatapro-*-*-*-*-24-*-*-*-*-*-*-*' -cgreen -s 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment