Expanding on Linux

in #linux7 years ago (edited)

In my post “Every Tiny Rebellion Counts” (https://steemit.com/technology/@patranella/every-tiny-rebellion-counts), I discussed how you can take more control of your computer with a stripped-down Linux (Debian) installation; this follow-up gives a brief expansion to allow you to get a little more out of your setup.

More useful programs:
Catfish = file searches
Orage = calendar
Gucharmap = character map
Gthumb = thumbnailer for files
Lxpolkit = policy kit authentication agent
Lxdm = display manager for login screen
Pulseaudio-module-bluetooth = Bluetooth sound server
Bluez-firmware = firmware for Bluetooth devices
Pulseaudio-equalizer = an audio equalizer
Paman = Pulseaudio manager
Paprefs = Pulseaudio preferences
Pasystray = a tray icon for audio
Pavumeter = Pulseaudio volume meter
Ffmpegthumbnailer = video thumbnailer

To install them:
sudo apt-get install catfish orage gucharmap gthumb lxpolkit lxdm pulseaudio-module-bluetooth bluez-firmware pulseaudio-equalizer paman paprefs pasystray pavumeter ffmpegthumbnailer

To compile from source, you will need to install the following:
sudo apt-get install build-essential checkinstall libgtk2.0-dev libmenu-cache-dev mono-complete intltool

Use the Keyboard for Volume Control:
You can set your Keybindings to raise, lower, and mute your sound using your keyboard. I would list the full text to insert into your rc.xml file, but Steemit removes tags. So I will give you the base commands below, you should be able to deduce how to format it by the other entries in your rc.xml file. The Action Name = Execute, and the commands for each are as follows:

Raise Volume: pactl -- set-sink-volume 0 +5%
Lower Volume: pactl -- set-sink-volume 0 -5%
Toggle Volume (Mute, Unmute): pactl set-sink-mute 0 toggle

Take a Screenshot:
We can set it up to where your “Print Screen” button takes a screenshot and places it in a folder. You will also be able to take a screenshot of a selected window by pressing the “Control Key” + “Print Screen”. In the information below, I am going to be storing my screenshots in a “Screenshots” folder inside my “Pictures” folder.

First, create two script files. In the first script file (we’ll call it “screenshot.sh”), place the line…
scrot -ze 'mv $f ~/Pictures/Screenshots/'

In the second script file (“screenshotfocus.sh”), place the line…
scrot -zue 'mv $f ~/Pictures/Screenshots/'

We then have to set up a Keybinding to make the screenshots work with the press of a button… again, I would list the full text to insert into your rc.xml file, but Steemit removes tags; so I will give you the information you need, and allow you to use the other formatting in your rc.xml file be you guide on where to place the information.

Key Names:
“Print” for Print Screen
“C-Print” for Control + Print Screen

Commands: (Replace “Path” and “Folder” with the Folder/Subfolder where your Script Files are)
~/Path/Folder/screenshotfocus.sh

To get Conky to display the Weather:
One: The first thing you need to do is go to (https://www.wunderground.com/)and get a Weather API for your location.

Two: Create a script file (we’ll call it weather.sh), and place the following information in it:
I apologize, but I have to use an image of the text otherwise Steemit will not allow it to show up due to the markup in the text.

conkytext.png

Three: You can place the following line in your .conkyrc (Be sure to replace [API], [State], [City], [Path/Folder], and your Icon location and size with your specific information. In the information below, the Icon location is listed as “5,35” and the size is listed as “64x64”:
I apologize, but I have to use an image of the text otherwise Steemit will not allow it to show up due to the markup in the text.

weathertext.png

Media Players:
CMUS is a command line music player, and MPlayer is a command line video player. If you prefer to use a simple, gui player that allows you to simply open files directly, I would suggest VLC.

To install:
sudo apt-get install cmus mplayer (optionally you could add “vlc” to the install.)

For additional codecs:
sudo apt-get install libavcodec-extra ffmpeg vorbis-tools

For the Non-Free ability to read copy-protected DVD's you need to add: w32codecs libdvdcss libdvdcss2 and libdvdread4

You can enable the multimedia sources list... or you can do this manually:
see: https://wiki.debian.org/CDDVD
see: https://wiki.debian.org/MultimediaCodecs

The Manuals for CMUS and MPlayer will explain how to use them, but for simplicity purposes, I will place some highlights below:

CMUS:
To add your music library to CMUS, in the text box type (without quotes) “:add [path to music]”

Common Keyboard Commands:
v = stop playback
b = next track
z = previous track
c = pause/resume playback
s = toggle shuffle
x = restart track
m = to toggle between play artist, album, or all
Shift+m = switch between "all from library" and "playlist"
i = jump to view the current track -and- toggle show hidden
– = reduce the volume by 10%
"+" = increase the volume by 10% (ignore the quotes, they were used so Steemit would show it properly)
Shift+c = toggle continuous play
g = jump to top of list
Shift_g = jump to bottom of list
u = refresh files
q = Close Cmus

MPlayer:
The syntax to use in order to play videos is as follows:

Video Files:
mplayer ~/Folder/"Folder Name With Spaces"/File.mp4
mplayer ~/Folder/"File Name With Spaces.mp4"

Launch Videos Full Screen:
mplayer -fs ~/Folder/"Filename.mp4"

DVD Files:
DVD: mplayer dvd://[title]
ISO: mplayer dvd://1 -dvd-device /path/disk_image.iso
Folder: mplayer dvd://1 -dvd-device /path/DVD_Directory

Basic Keyboard Commands:
p or SPACE = Pause (pressing again unpauses).
q or ESC = Stop playing and quit.
"/" and * = Decrease/increase volume. (ignore the quotes, they were used so Steemit would show it properly)
m = Mute sound.
f = Toggle fullscreen (also see -fs).

Show Song Information and Art in Conky:
You can use CMUS and display the artist, song, artwork, etc. in Conky. Below is a list of commands you can put into Conky to give you the various bits of information you want to display.

Display Song Title:
cmus-remote -Q | grep 'tag title '| cut -c11-

Display Artist:
cmus-remote -Q | grep 'tag artist '| cut -c12-

Display Album:
cmus-remote -Q | grep 'tag album '| cut -c11-

Display Genre:
cmus-remote -Q | grep 'tag genre '| cut -c11-

Display Duration:
cmus-remote -Q | grep 'duration ' | awk '{print strftime("%M:%S", $2, 1)}'

Display Position (Elapsed Time):
cmus-remote -Q | grep 'position ' | awk '{print strftime("%M:%S", $2, 1)}'

Display Path without file name:
This will be used to get the album art.
cmus-remote -Q | grep "file" | sed "s/file //" | rev | cut -d"/" -f2- | rev

To write path to file:
Choose a folder to input the file name into a file.
cmus-remote -Q | grep "file" | sed "s/file //" | rev | cut -d"/" -f2- | rev >~/tmp/album

To get Album Art path:
echo "$(cat ~/tmp/album)"/*older.jpg >~/tmp/art

I used "*" so it would use "Folder.jpg" and "folder.jpg"… these are generally the image files for the album/song that is playing.

To display Album Art in Conky:
It would be best to write a script (we’ll call it album.sh) and place in the following information:

cmus-remote -Q | grep "file" | sed "s/file //" | rev | cut -d"/" -f2- | rev >/tmp/album
echo "$(cat /tmp/album)"/*older.jpg >/tmp/art
ln -sf "$(cat /tmp/art)" /tmp/album.jpg

In Conky, place the following information: (As a reminder, replace /Path/Folder with the actually path to your script file. Furthermore, the “0,160 -s 140x140” portion of the below text is the location and size of the image that will be displayed in Conky. You will need to adjust these numbers to your needs.).

"Backslash" (Use an actual backslash. I had to write the word instead of the symbol so Steemit would show it properly)
${if_running cmus}
${execi 5 sh ~/Path/Folder/album.sh}
${image /tmp/album.jpg -n -p 0,160 -s 140x140}

${color purple}${execi 5 cmus-remote -Q | grep 'tag title '| cut -c11-}
${execi 5 cmus-remote -Q | grep 'tag artist '| cut -c12-}
${execi 5 cmus-remote -Q | grep 'tag album '| cut -c11-}${color}
${color4}Duration: ${color0}${exec cmus-remote -Q | grep 'duration ' | awk '{print strftime("%M:%S", $2, 1)}'} ${color4}Elasped: ${color0}${exec cmus-remote -Q | grep 'position ' | awk '{print strftime("%M:%S", $2, 1)}'}${color}
#${execbar echo $(cmus-remote -Q | grep 'duration ' | awk '{print $2}') $(cmus-remote -Q | grep 'position ' | awk '{print $2}') | awk '{print $2/$1*100}'}
${endif}
"Backslash" (Use an actual backslash. I had to write the word instead of the symbol so Steemit would show it properly)

Well, hopefully you find the above information useful, and it helps you further your enjoyment of your Linux experience.

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63179.13
ETH 2573.33
USDT 1.00
SBD 2.72