Posted: . At: 12:09 PM. This was 8 years ago. Post ID: 9388
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

Useful Linux ideas and tips. Print graphical notifications from a shell script.

To print a graphical notification from a shell script, insert this code.

notify-send "Match Found!"

This will pop up a notification on your desktop, this will alert you to the fact that your shell script has done something.

Make your computer talk. This will speak whatever you type as text.

jason@jason-desktop:~$ espeak "I am sorry Dave, I am afraid I cannot do that."

Play Youtube videos the slimline way. The mpv media player can play Youtube links directly. Just give mpv the Youtube URL and it will open.

mpv https://www.youtube.com/watch?v=hctYB7Lpppo

Find all non-free Linux packages that are installed on your Linux system.

vrms() {
    dpkg-query -W -f '${Section}/${Package}\n' \
        | grep -E '^(contrib|multiverse|non-free|partner|restricted)/' \
        | sort
}

This works very well indeed.

jason@jason-desktop:~$ vrms 
contrib/fonts/ttf-mscorefonts-installer
contrib/games/chocolate-heretic
contrib/games/chocolate-hexen
contrib/games/chocolate-strife
contrib/games/game-data-packager
contrib/otherosfs/winetricks
non-free/games/doom-wad-shareware
non-free/utils/unrar

This script will play a Youtube video URL that is in the clipboard.

#!/bin/bash
 
notify-send -u low -t 1 'Loading...'
mpv $(xclip -selection clipboard -o)
 
[ "$?" ] || notify-send 'Error Found...'

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.