Search

Loading...

Wednesday, October 26, 2016

KDE: add bulk rename in Dolphin

The best bulk rename tool is the one from Thunar, so it's a good idea to just install Thunar

sudo apt install thunar -y

Then run that plugin from Dolphin

kate ~/.local/share/kservices5/bulk-rename-thunar.desktop

paste this:

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/all;
Actions=BulkRename;
X-KDE-StartupNotify=false
X-KDE-Priority=TopLevel

[Desktop Action BulkRename]
Name=Bulk Rename
Exec=thunar -B %U
Icon=dialog-information

Tuesday, October 25, 2016

KDE: Add context menu actions to Dolphin (like extract audio)

To extract m4a audio from mp4:

kate ~.local/share/kservices5/extract-m4a.desktop

Paste:

[Desktop Entry]

Actions=Extract
Icon=dialog-information
MimeType=video/mp4
ServiceTypes=KonqPopupMenu/Plugin
Type=Service
X-KDE-Priority=TopLevel

    
[Desktop Action Extract]
Exec= bash -c 'avconv -i "$0" -map 0:1 -c:a copy "${0%%.*}".m4a' %f
Icon=dialog-information
Name=Extract audio (m4a)
 
Do the same for flv. For wemb replace m4a with ogg.

Before all, check with mediainfo for the correct audio stream inside the video.

Thursday, October 20, 2016

Fix installation problems with aptitude

sudo apt-get install aptitude

sudo aptitude --full-resolver -f install

Thursday, October 13, 2016

Create pdf from multiple images

Put all png files in a directory, open terminal there and run

convert png.* out.pdf

Replace extension accordingly/

To add all images from that directory into one pdf use

convert *.* out.pdf

Download Google Books

git clone https://github.com/tokland/pysheng
cd pysheng
sudo python setup.py install
It is installed by default in the home directory. But then it can be moved anywhere and launched by executing /pysheng/bin/pysheng-gui. Path to that could be added into a launcher (desktop file) put in ~/.local/share/applications

Each page is downloaded as a separate png file. To create one pdf book out of it, see HERE.

Thursday, September 15, 2016

Scan with Canon Printer pixma mg2450

The system app for scanning will not work for this scanner, but the driver installs its own app, runnable with the command:

scangearmp

So, to get a launcher fot it:
 
sudo gedit /usr/share/applications/scan.desktop

and pasting this:
 
[Desktop Entry]
Categories=Graphics;Scanning;
Exec=scangearmp
Icon=scanner
Name=Scan with Canon Pixma mg2450
Type=Application
 
possibly making it executable

sudo chmod +x /usr/share/applications/scan.desktop

Thursday, June 23, 2016

Pearl Audio Converter in Nautilus

sudo apt-get install pacpl

Create a file to ./local/share/nautilus/scripts with the below content


gedit ./local/share/nautilus/scripts/pearl-audio-convert

then paste:



#!/usr/bin/perl
#
# Copywrite (C) Philip Lyons 2013-2014 (vorzox@gmail.com)
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

use strict;
use warnings;
use File::Spec::Functions qw(rel2abs);

my $debug = 0;
my $input = '';

my $name = "Perl Audio Converter";

my $formats = "FALSE 3G2 FALSE 3GP FALSE 8SVX FALSE AAC FALSE AC3 FALSE ADTS FALSE AIF FALSE AIFF FALSE AL FALSE AMB FALSE AMR FALSE APE FALSE AU FALSE AVR FALSE BONK FALSE CAF FALSE CDR FALSE CVU FALSE DAT FALSE DTS FALSE DVMS FALSE F32 FALSE F64 FALSE FAP FALSE FLA FALSE FLAC FALSE FSSD FALSE GSRT FALSE HCOM FALSE IMA FALSE IRCAM FALSE LA FALSE M4A FALSE MAT FALSE MAT4 FALSE MAT5 FALSE MAUD FALSE MMF FALSE MP2 FALSE MP3 FALSE MP3HD FALSE MP4 FALSE MPC FALSE MPP FALSE NIST FALSE OFF FALSE OFR FALSE OFS FALSE OGA FALSE OGG FALSE OPUS FALSE PAF FALSE PRC FALSE PVF FALSE RA FALSE RAW FALSE RF64 FALSE RM FALSE SD2 FALSE SF FALSE SHN FALSE SMP FALSE SND FALSE SOU FALSE SPX FALSE TTA FALSE TXW FALSE VMS FALSE VOC FALSE W64 FALSE WAV FALSE WMA FALSE WV";

# main sub
sub process_files {

  # sort through input files and discard those with unsupported formats (excluding directories)
  foreach (@ARGV) {

          chomp($_);

          $_ = rel2abs($_);

          my $input_ext = `echo \"$_\" | awk -F"." '{print \$NF}'`;
          print "\"$_\" has the ext $input_ext\n" if $debug == 1;
         
          if (-f $_ and not `pacpl --formats | grep $input_ext`)
          {
             print "$_ has unrecognized extension, skipping...\n" if $debug == 1;
            `notify-send \"$name\" \"Unable to convert $_ (unsupported format)\"`;
             next;
          }
          else
          {            
             $input = "$input \"$_\"";
          }
  }      
 
  # invoke pacpl and start conversion process
  if ($input) {

      my $out_format = `zenity --title \"$name\" --width 250 --height 300 --list --radiolist --column 'Select' --column 'Output Format' $formats`;
   
      chomp($out_format);
     
      print  "pacpl --to $out_format $input --gui --gnome\n" if $debug == 1;
      system("pacpl --to $out_format $input --gui --gnome");
  }
 
}

# start main
process_files();