Sunday, November 30, 2014

Keep terminal open after running a command in terminal from shurtcut

You may need to keep terminal open after running a command in order to see the results, but when launched from a shortcut it closes unless you specify otherwise

First you need gnome-terminal and a profile with the setting to remain open after command: Edit, Profiles, create and select profile, edit, title and command, when command exits: hold terminal open.

The convenient way is to create a new profile called 'new1'.

The command to run by shortcut should be:

gnome-terminal --window-with-profile=new1 -e "whatever"

See temperature with a shortcut

Add this command to shortcuts:

gnome-terminal --window-with-profile=new1 -e "sensors" 

(first you need gnome-terminal with a new profile called 'new1' and the setting to remain open after command: Edit, Profiles, create and select profile, edit, title and command, when command exits: hold terminal open)

Friday, November 28, 2014

Command to extract audio from video without conversion

ffmpeg -i video.mp4 -vn -acodec copy audio.m4a
Even better is to replace ffmpeg with avconv and then use a line that doesn't need inserting the actual name of the files:
avconv -i %f -map 0:1 -c:a copy %f.m4a 

%f stays for any selected files. Multiple file can be selected and processed at the same time. 

`-map 0:1 -c:a copy` is the command to extract without processing. 
`.m4a` is a variable to be used if the video contains aac audio. Change accordingly. Use mediainfo to find out.

Without`-map 0:1 -c:a copy`, a simple line like
avconv -i %f %f.m4a  
will convert to whatever variable format. But then it is recommendable to use more complex commands.

An updated better form (input extension is removed from output name):

bash -c 'avconv -i "$0" -map 0:1 -c:a copy "${0%%.*}".m4a' %f

For mp3:

avconv -i %f -c:a libmp3lame -ac 2 -b:a 190k %f.mp3

Thursday, November 27, 2014

Multi-thread downloaders for Linux

uGet works with multi thread if aria2 plugin is enabled

REXloader boasts download speed to maximum, only that it dosplays it in Mbps instead od KBps. 8Mbps=1MBps=1024KBps

sudo add-apt-repository ppa:ra9oaj/spolab&&sudo apt-get update&&sudo apt-get install rexloader 

Wednesday, November 26, 2014

Install VLC from PPA

The stable VLC in *ubuntu 14.04 is version 2.1. To get the 2.2 version:


sudo add-apt-repository ppa:mc3man/trusty-media&&sudo apt-get update&&sudo apt-get install vlc

VLC nightly here:
sudo add-apt-repository ppa:videolan/master-daily&&sudo apt-get update&&sudo apt-get install vlc

Wednesday, November 19, 2014

Synapse in 14.04

sudo apt-add-repository ppa:synapse-core/testing&&sudo apt-get update&&sudo apt-get install synapse

Sunday, November 16, 2014

Command to change the default browser

Open the Terminal and run:

sudo update-alternatives --config  x-www-browser

Then you will see something like this:

There are 3 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).

  Selection    Path                           Priority   Status
* 0            /usr/bin/google-chrome-stable   200       auto mode
  1            /usr/bin/epiphany-browser       85        manual mode
  2            /usr/bin/firefox                40        manual mode
  3            /usr/bin/google-chrome-stable   200       manual mode
Press enter to keep the current choice[*], or type selection number:

Push the number key you like and then Enter.

Tuesday, November 11, 2014

Thunar actions - add a command that works in Terminal

Some actions that work in Terminal do not work as such in Thunar actions and do not work in a Thunar action that invokes a Terminal window with that initial command.

The first does not work because Thunar actions seem to call the command with bash and makes the use of terminal superfluous.

The second does not work when the selection is a directory because the current directory is then one level up. So you need to first cd into the target before running the command.


So, if the <command> works in a terminal window opened in a target directory, in order to make that work as a Thunar custom action for the same directory, adapt the command as follows:

cd %f && <command>

Monday, November 10, 2014

Thunar actions: save selected pdf's pages as images

Name: To PNG
Command: pdftoppm %f -png %f.png
File pattern: *.pdf
Appears if selection contains: Image Files
It should work for other files than pngs.