Announcement

Collapse
No announcement yet.

Service Menus with Dolphin

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Service Menu - Icon theme icon replacer

    A point&right click icon replacer.



    More: http://www.kubuntuforums.net/showthr...332#post289332


    The desktop part

    ~/.kde/share/kde4/services/ServiceMenus/replaceicon.desktop /1/, /2/:
    Code:
    [Desktop Entry]
    Type=Service
    X-KDE-ServiceTypes=KonqPopupMenu/Plugin
    MimeType=image/png;
    Actions=replaceIconThemeIcon;
    
    [Desktop Action replaceIconThemeIcon]
    Name=Replace Icon Theme Icon
    Icon=tools-wizard.png
    Exec=perl ~/.bin/iconreplacer.pl %f

    The Perl script part

    ~/.bin/iconreplacer.pl:
    Code:
    #!/usr/bin/perl
    
    # argument: icon name with the path
    # action: ask the new picture and replace the same context/name icons 
    # with the correct resolution picture
    
    use strict;
    use warnings;
    
    # Modules
    use Image::Magick;
    
    my $showText = "Give the new picture";
    my @RESOLUTIONS = ("8x8","16x16","22x22","32x32","48x48","64x64","128x128","256x256","512x512");
    
    my @KONQUERORS = `"qdbus" "org.kde.konqueror*"`;
    chomp (@KONQUERORS);
    my @DOLPHINS = `"qdbus" "org.kde.dolphin*"`;
    chomp (@DOLPHINS);
    
    my ($newIcon, $resolution, $konqueror, $dolphin);
    #my (@writeLog);
    
    # split argument
    my @themePath = split('/', $ARGV[0]);
    
    my $fileName = pop(@themePath);
    my $iconContext = pop(@themePath);
    pop(@themePath);
    
    # get the new picture
    my $newPicture = `"kdialog" "--title" "$showText" "--getopenfilename" "." "*.png *.jpg *.gif"`;
    chomp ($newPicture);
    
    # write the new icons
    foreach $resolution (@RESOLUTIONS) {
       my $fileCandidate = join("/", @themePath) . "/" . $resolution . "/" . $iconContext . "/" . $fileName;
       if (-e $fileCandidate) {
          chomp($fileCandidate);
          $newIcon = Image::Magick->new;
          $newIcon->Read($newPicture);
          $newIcon->Resize(geometry=>$resolution);
          $newIcon->Write($fileCandidate);
    #      push(@writeLog, $fileCandidate);
       } 
    }
    
    #my @KDIALOGCALL = ("kdialog", "--msgbox", "@writeLog \n \n replaced with \n \n $newPicture");
    #system @KDIALOGCALL;
    
    # refresh the konquerors and dolphins
    foreach $konqueror (@KONQUERORS) { system ("qdbus $konqueror /konqueror/MainWindow_1 activateAction reload 2>/dev/null"); }
    
    foreach $dolphin (@DOLPHINS) { system ("qdbus $dolphin /dolphin/Dolphin_1 activateAction reload 2>/dev/null"); }
    Notes

    - Working at here. May or may not work at there
    - Needs package: perlmagick
    - More notifications: uncomment the lines 22, 44, 48, 49.




    Links

    1. http://www.freedesktop.org/wiki/Spec...top-entry-spec
    2. http://techbase.kde.org/Development/..._Service_Menus
    Last edited by OneLine; Feb 26, 2012, 11:20 AM.
    Have you tried ?

    - How to Ask a Question on the Internet and Get It Answered
    - How To Ask Questions The Smart Way

    Comment


      #32
      Face detection with the thumbnailer

      The FFMpegThumbs-MattePaint /1,2 / can use the KDE service menus to add/remove the thumbnails. There is a simple way to detect the faces from the pictures /3/ with the Perl Image::ObjectDetect /4/ module.




      A script to detect the faces from the video thumbnails and reject/approve the thumbnail.



      Note!
      This is working only with the 'large' /5/ thumbnails (=> 96 pixels).
      A workaround is to link the normal & large thumbnail directories.

      Code:
      #!/usr/bin/perl
      
      use strict;
      use warnings;
      
      use Getopt::Long;
      use Pod::Usage;
      use URI::Escape;
      use Digest::MD5 qw(md5_hex);
      use Image::ObjectDetect;
      
      my $name;
      my $member;
      
      # using libkface-data
      my $cascade  = '/usr/share/kde4/apps/libkface/haarcascades/haarcascade_frontalface_alt.xml';
      my $detector = Image::ObjectDetect->new($cascade);
      
      $ARGV[0] =~ s' /' //'g;
      my @fileNames = split(' /', $ARGV[0]);
      
      foreach $name (@fileNames) {
         my $fullName = "file://" . $name;
         my $escapedName = uri_escape("$fullName", "^A-Za-z0-9\-\._~/:()&'");
         my $thumbName = md5_hex("$escapedName") . ".png";
         
         my $picFile  = ("$ENV{ HOME }/.thumbnails/large/$thumbName");
      
      #  search faces - try max 10 times
         for ( my $i = 1; $i <= 10; $i++ ) {
      
            my @faces = $detector->detect($picFile);
            last if ( scalar @faces > 0 );
      
      #     remove old thumbnails
            unlink("$ENV{ HOME }/.thumbnails/large/$thumbName");
      
      #     refresh/reload the filemanager window
            my @konquerors = `"qdbus" "org.kde.konqueror*"`;
            chomp (@konquerors);
            foreach $member (@konquerors) { system ("qdbus $member /konqueror/MainWindow_1 activateAction reload 2>/dev/null"); }
      
            my @dolphins = `"qdbus" "org.kde.dolphin*"`;
            chomp (@dolphins);
            foreach $member (@dolphins) { system ("qdbus $member /dolphin/Dolphin_1 activateAction reload 2>/dev/null"); }
      
      #     wait new thumbnail
            open( DUMP , ">/dev/null" );
            until ( -e "$ENV{ HOME }/.thumbnails/large/$thumbName" ) { 
               print DUMP "waiting thumbnail \n"; 
            }
            close (DUMP);
         }
      }


      Direct: http://youtu.be/di6MdAQbfew


      Links

      1. http://kde-apps.org/content/show.php...content=153902
      2. https://www.kubuntuforums.net/showth...l=1#post345474
      3. http://code-and-hacks.peculier.com/p...econgition-in/
      4. http://search.cpan.org/~jiro/Image-O...bjectDetect.pm
      5. http://specifications.freedesktop.or...ec-latest.html


      PPA packages: https://launchpad.net/~samrog131/+ar...series_filter=
      Last edited by Rog132; Feb 19, 2014, 02:28 PM.
      A good place to start: Topic: Top 20 Kubuntu FAQs & Answers
      Searching FAQ's: Google Search 'FAQ from Kubuntuforums'

      Comment


        #33
        KF5 Service Menus

        (using Kubuntu 15.04 alpha2)


        KDE4 has

        Code:
        madprophet@Velvet:~$ kde4-config --path services
        /home/madprophet/.kde/share/kde4/services/:/usr/share/kde4/services/

        KF5 has

        Code:
        madprophet@Velvet:~$ kf5-config --path services
        /home/madprophet/.local/share/kservices5/:/usr/share/kservices5/

        The Kubuntu 15.04 is a hybrid system. There are KDE4 applications and there are new KF5 applications. The KDE4 parts are looking the service menus from:

        ~/.kde/share/kde4/services/ServiceMenus/
        and
        /usr/share/kde4/services/ServiceMenus/

        The new KF5 service menus are at:

        ~/.local/share/kservices5/ServiceMenus/
        and
        /usr/share/kservices5/ServiceMenus/


        To get the KF5 service menus to the KDE4 applications the KF5 service menu directory can be linked to the KDE4 directory.



        ..and there are the KF5 service menus with the Dolphin (KDE4).

        Last edited by Rog132; Feb 20, 2015, 12:28 PM.
        A good place to start: Topic: Top 20 Kubuntu FAQs & Answers
        Searching FAQ's: Google Search 'FAQ from Kubuntuforums'

        Comment


          #34
          Plasmafication

          Linking: https://www.kubuntuforums.net/showth...l=1#post369248

          The service menu desktop - plasmafication.desktop:
          Code:
          [Desktop Entry]
          Type=Service
          X-KDE-ServiceTypes=KonqPopupMenu/Plugin
          MimeType=image/*;
          Actions=plasmaficationImage;removePlasmoid;
          X-KDE-Submenu=Plasmafication tools
          Icon=plasma
          
          [Desktop Action plasmaficationImage]
          Name=Plasmafication of Image
          Icon=preferences-desktop-plasma
          Exec=plasmafication.pl %f
          
          [Desktop Action removePlasmoid]
          Name=Remove plasmoid
          Icon=plasma
          Exec=plasmafication-remover.pl


          Few short scripts to make and remove the image plasmoids.

          plasmafication.pl :

          Installs a picture plasmoid so it can be added to the plasma 5 desktop.
          Code:
          #!/usr/bin/perl
          
          # argument: a picture with full path
          #
          # actions:
          # write icon picture to the ~/.local/share/icons/Plasmafication/
          # write metadata.desktop to the /tmp/...
          # write main.qml to the /tmp/...
          # execute the plasmapkg2 to install the plasmoid
          #
          # using:
          # perlmagick
          # kde-baseapps-bin (kdialog)
          
          use strict;
          use warnings;
          
          # modules
          use File::Basename;
          use Image::Magick;
          use File::Path qw(make_path);
          
          # replace whitespace with undescore
          my $image = $ARGV[0];
          my $imageName = fileparse($image,'\..*');
          my $spacelessName = $imageName;
          $spacelessName =~ s' '_'g;
          
          
          # icon
          my $newIcon;
          my $iconResolution = "128x128";
          my $iconPlace = "$ENV{ HOME }/.local/share/icons/Plasmafication";
          mkdir $iconPlace;
          my $iconOut = "$iconPlace/plasmafication.$spacelessName.png";
          
          $newIcon = Image::Magick->new;
          $newIcon->Read($image);
          $newIcon->Resize(geometry=>$iconResolution);
          $newIcon = $newIcon->Montage(geometry=>$iconResolution, background=>'transparent');
          $newIcon->Write($iconOut);
          
          
          # desktop
          my $temporary = "/tmp/plasmafication.$spacelessName";
          make_path("$temporary/plasmafication.$spacelessName/contents/ui");
          open(OUT, ">$temporary/plasmafication.$spacelessName/metadata.desktop");
          
          print OUT '[Desktop Entry]',"\n";
          print OUT 'Name=Picture Plasmoid',"\n";
          print OUT 'Comment=Show ',"$imageName","\n";
          print OUT 'Encoding=UTF-8',"\n";
          print OUT 'Icon=',"$ENV{ HOME }/.local/share/icons/Plasmafication/plasmafication.$spacelessName","\n";
          print OUT 'ServiceTypes=Plasma/Applet',"\n";
          print OUT 'Type=Service',"\n";
          print OUT 'X-KDE-PluginInfo-Name=','plasmafication',"\.","$spacelessName","\n";
          print OUT 'X-Plasma-API=declarativeappletscript',"\n";
          print OUT 'X-Plasma-MainScript=ui/main.qml',"\n";
          
          
          # main.qml
          open(OUT, ">$temporary/plasmafication.$spacelessName/contents/ui/main.qml");
          
          print OUT 'import QtQuick 2.0',"\n";
          print OUT "\n";
          print OUT 'Rectangle {',"\n";
          print OUT '    width: 300',"\n";
          print OUT '    height: 300',"\n";
          print OUT "\n";
          print OUT '    Image {',"\n";
          print OUT '        anchors.fill: parent',"\n";
          print OUT '        fillMode: Image.PreserveAspectFit',"\n";
          print OUT '        smooth: true',"\n";
          print OUT '        source:', "\"","$image","\"","\n";
          print OUT '    }',"\n";
          print OUT '}',"\n";
          
          
          # execute plasmapkg2 --install
          system ("plasmapkg2", "--install", "$temporary/plasmafication.$spacelessName");
          plasmafication-remover.pl - removes the picture plasmoid:
          Code:
          #!/usr/bin/perl
          
          # no arguments
          #
          # actions:
          # show file picker (kdialog) to pick the removed plasmoid
          # remove picked plasmoid
          # remove icon
          #
          # using:
          # kde-baseapps-bin (kdialog)
          
          use strict;
          use warnings;
          
          # modules
          use File::Basename;
          
          # picker
          my $iconPlace = "$ENV{ HOME }/.local/share/icons/Plasmafication";
          my $image = `"kdialog" '--getopenfilename' '$iconPlace' '*.png'`;
          chomp ($image);
          my $imageName = fileparse($image,'.png');
          
          # execute plasmapkg2 --remove
          system ("plasmapkg2", "--remove", "$imageName");
          
          # remove icon
          unlink($image);
          Have you tried ?

          - How to Ask a Question on the Internet and Get It Answered
          - How To Ask Questions The Smart Way

          Comment


            #35
            Using embedded mp4 cover art with the KDE thumbnailer

            Linking to http://askubuntu.com/questions/67956...d-use-built-in

            Earlier: https://www.kubuntuforums.net/showth...l=1#post380103


            With the KDE4:

            Making: ~/.kde/share/kde4/services/ServiceMenus/mattepaint-mp4.desktop
            Code:
            [Desktop Entry]
            Type=Service
            Icon=kdenlive-add-clip
            X-KDE-ServiceTypes=KonqPopupMenu/Plugin
            MimeType=video/mp4;
            Actions=useMp4Image;pickMp4Image
            #X-KDE-Priority=TopLevel
            X-KDE-Submenu=Video Thumbnail Fixer
            Encoding=UTF-8
            InitialPreference=69
            
            [Desktop Action useMp4Image]
            Name=Use a picture from the Mp4 attachments
            Icon=mail-attachment
            Exec=mp4-image-to-thumbnaill.pl "%U"
            
            [Desktop Action pickMp4Image]
            Name=Pick a picture from the Mp4 attachments
            Icon=project-open
            Exec=mp4-pick-image-to-thumbnail.pl "%U"



            Writing Perl scripts:

            /usr/local/bin/mp4-image-to-thumbnail.pl
            Code:
            #!/usr/bin/perl
            
            use strict;
            use warnings;
            
            # perl modules
            use URI::Escape;
            use Digest::MD5 qw(md5_hex);
            use File::Copy;
            use Time::HiRes qw(usleep nanosleep);
            
            my @pictureSuffix = ( '*.png','*.jpg');
            
            my @kdeLocalprefix = ("kde4-config", '--localprefix');
            chomp(my $kdeHome = `@kdeLocalprefix`) or die "Can't find the kde home";
            
            my $ffmpegthumbsDir = $kdeHome . "share/apps/ffmpegthumbs-mattepaint/";
            my $attachmentsToThumbnail = $ffmpegthumbsDir . "cleanOne";
            my $createMissingdir = $ffmpegthumbsDir;
            my $parsleyDir = $createMissingdir . "AtomicParsley/";
            
            mkdir $createMissingdir;
            mkdir $parsleyDir;
            
            $ARGV[0] =~ s' /' //'g;
            my @fileNames = split(' /', $ARGV[0]);
            
            # extract attached cover to the ../ffmpegthumbs-mattepaint/cleanOne
            foreach my $name (@fileNames) {
               my $fullName = "file://" . $name;
               my $escapedName = uri_escape("$fullName", "^A-Za-z0-9\-\._~/:()&'");
               my $thumbName = md5_hex("$escapedName") . ".png";
              
               my @extractCall = ( "AtomicParsley", "$name", "-e", "$parsleyDir");
               system (@extractCall) == 0 or die "Can't execute the AtomicParsley";
               
               chdir $parsleyDir;
               my @globFiles = glob ("@pictureSuffix");
               print scalar @globFiles;
               if (scalar @globFiles == 0) { next; }
               copy ("$globFiles[0]", "$attachmentsToThumbnail") or die "Can't copy";
               unlink @globFiles;
            
            # remove old thumbnails
               unlink("$ENV{ HOME }/.thumbnails/large/$thumbName");
               unlink("$ENV{ HOME }/.thumbnails/normal/$thumbName");
            
            #  refresh/reload the filemanager window
               my @konquerors = `"qdbus" "org.kde.konqueror*"`;
               chomp (@konquerors);
               foreach my $member (@konquerors) { system ("qdbus $member /konqueror/MainWindow_1 activateAction reload 2>/dev/null"); }
            
               my @dolphins = `"qdbus" "org.kde.dolphin*"`;
               chomp (@dolphins);
               foreach my $member (@dolphins) { system ("qdbus $member /dolphin/Dolphin_1 activateAction reload 2>/dev/null"); }
            
            #  wait new thumbnail
               open( DUMP , ">/dev/null" );
               until ( -e "$ENV{ HOME }/.thumbnails/large/$thumbName" || -e  "$ENV{ HOME }/.thumbnails/normal/$thumbName" ) { 
                  print DUMP "waiting thumbnail \n"; 
               }
               close (DUMP);
               usleep(5000);
            }
            and

            /usr/local/bin/mp4-pick-image-to-thumbnail.pl
            Code:
            #!/usr/bin/perl
            
            use strict;
            use warnings;
            
            # perl modules
            use URI::Escape;
            use Digest::MD5 qw(md5_hex);
            use File::Copy;
            use Time::HiRes qw(usleep nanosleep);
            
            my @pictureSuffix = ( '*.png','*.jpg');
            
            my @kdeLocalprefix = ("kde4-config", '--localprefix');
            chomp(my $kdeHome = `@kdeLocalprefix`) or die "Can't find the kde home";
            
            my $ffmpegthumbsDir = $kdeHome . "share/apps/ffmpegthumbs-mattepaint/";
            my $attachmentsToThumbnail = $ffmpegthumbsDir . "cleanOne";
            my $createMissingdir = $ffmpegthumbsDir;
            my $parsleyDir = $createMissingdir . "AtomicParsley/";
            
            mkdir $createMissingdir;
            mkdir $parsleyDir;
            
            $ARGV[0] =~ s' /' //'g;
            my @fileNames = split(' /', $ARGV[0]);
            
            # extract attached cover to the ../ffmpegthumbs-mattepaint/cleanOne
            foreach my $name (@fileNames) {
               my $fullName = "file://" . $name;
               my $escapedName = uri_escape("$fullName", "^A-Za-z0-9\-\._~/:()&'");
               my $thumbName = md5_hex("$escapedName") . ".png";
              
               my @extractCall = ( "AtomicParsley", "$name", "-e", "$parsleyDir");
               system (@extractCall) == 0 or die "Can't execute the AtomicParsley";
               
               chdir $parsleyDir;
               my @globFiles = glob ("@pictureSuffix");
               if (scalar @globFiles == 0) { next; }
               if (scalar @globFiles > 1 ){
                  my $pickThumbnail = `"kdialog" "--getopenfilename" "$parsleyDir"`;
                  chomp ($pickThumbnail);
                  copy ("$pickThumbnail", "$attachmentsToThumbnail") or die "Can't copy";
               } else {
                  copy ("$globFiles[0]", "$attachmentsToThumbnail") or die "Can't copy";
               }   
               unlink @globFiles;
            
            # remove old thumbnails
               unlink("$ENV{ HOME }/.thumbnails/large/$thumbName");
               unlink("$ENV{ HOME }/.thumbnails/normal/$thumbName");
               
            #  refresh/reload the filemanager window
               my @konquerors = `"qdbus" "org.kde.konqueror*"`;
               chomp (@konquerors);
               foreach my $member (@konquerors) { system ("qdbus $member /konqueror/MainWindow_1 activateAction reload 2>/dev/null"); }
            
               my @dolphins = `"qdbus" "org.kde.dolphin*"`;
               chomp (@dolphins);
               foreach my $member (@dolphins) { system ("qdbus $member /dolphin/Dolphin_1 activateAction reload 2>/dev/null"); }
            
            #  wait new thumbnail
               open( DUMP , ">/dev/null" );
               until ( -e "$ENV{ HOME }/.thumbnails/large/$thumbName" || -e  "$ENV{ HOME }/.thumbnails/normal/$thumbName" ) { 
                  print DUMP "waiting thumbnail \n"; 
               }
               close (DUMP);
               usleep(5000);
            }
            Checking that the scripts are executable.

            Testing.



            Seems to work - at here.
            Last edited by Rog131; Oct 06, 2015, 08:52 AM.
            Before you edit, BACKUP !

            Why there are dead links ?
            1. Thread: Please explain how to access old kubuntu forum posts
            2. Thread: Lost Information

            Comment


              #36
              GHNS wrong paths

              The Dolphin is using ruby script to install and deinstall Service Menus. Looking Dolphin 16.08.2 /usr/bin/servicemenuinstallation
              and /usr/bin/servicemenudeinstallation and finding that they are still using KDE4 paths. Filing a bug report: Bug 371907 - Dolphin, KDE Framework, service menu installation and deinstallation ruby scripts are using KDE4 paths - https://bugs.kde.org/show_bug.cgi?id=371907
              Before you edit, BACKUP !

              Why there are dead links ?
              1. Thread: Please explain how to access old kubuntu forum posts
              2. Thread: Lost Information

              Comment


                #37
                Originally posted by Rog131 View Post
                The Dolphin is using ruby script to install and deinstall Service Menus. Looking Dolphin 16.08.2 /usr/bin/servicemenuinstallation
                and /usr/bin/servicemenudeinstallation and finding that they are still using KDE4 paths. Filing a bug report: Bug 371907 - Dolphin, KDE Framework, service menu installation and deinstallation ruby scripts are using KDE4 paths - https://bugs.kde.org/show_bug.cgi?id=371907
                added my as well stating it was the same on Kubuntu-16.04 and Neon dev/stable as well ,,,,,,,,shouldn't be that hard to confirm ,,,,it's a script.

                VINNY
                i7 4core HT 8MB L3 2.9GHz
                16GB RAM
                Nvidia GTX 860M 4GB RAM 1152 cuda cores

                Comment


                  #38
                  The Dolphin service menu GHNS is not using KDE Store

                  Bug 376922 - Don't show new Service Menus in KDE Store - https://bugs.kde.org/show_bug.cgi?id=376922
                  Before you edit, BACKUP !

                  Why there are dead links ?
                  1. Thread: Please explain how to access old kubuntu forum posts
                  2. Thread: Lost Information

                  Comment


                    #39
                    Both Bugs 371907 and Bug 376922 fixed with the https://cgit.kde.org/dolphin.git/com...10e40880bc3a1a

                    => KDE Applications 17.04 / Dolphin 17.04 or later
                    Before you edit, BACKUP !

                    Why there are dead links ?
                    1. Thread: Please explain how to access old kubuntu forum posts
                    2. Thread: Lost Information

                    Comment


                      #40
                      Originally posted by Rog131 View Post
                      Both Bugs 371907 and Bug 376922 fixed with the https://cgit.kde.org/dolphin.git/com...10e40880bc3a1a

                      => KDE Applications 17.04 / Dolphin 17.04 or later
                      Hmmmm. Backportable, maybe...
                      On #kubuntu-devel & #kubuntu on libera.chat - IRC Nick: RikMills - Launchpad ID: click

                      Comment


                        #41
                        Only text file editing needed - 1,2,3 done

                        Originally posted by acheron View Post
                        Hmmmm. Backportable, maybe...
                        Meanwhile - it is fixable for the users:

                        1)

                        Code:
                        $ locate servicemenu.knsrc
                        =>
                        Code:
                        kdesudo kate /etc/xdg/servicemenu.knsrc
                        change:
                        Code:
                        ProvidersUrl=http://download.kde.org/khotnewstuff/servicemenu-providers.xml
                        to
                        Code:
                         
                        ProvidersUrl=http://download.kde.org/ocs/providers.xml
                        Categories=Dolphin Service Menus
                        2)

                        Code:
                        $ locate servicemenudeinstallation
                        change:
                        Code:
                        FileUtils.rm(`kde4-config --localprefix`.strip! + "share/kde4/services/ServiceMenus/" + File.basename(archive))
                        to:
                        Code:
                        FileUtils.rm(`qtpaths --writable-path GenericDataLocation`.strip! + "/kservices5/ServiceMenus/" + File.basename(archive))
                        and

                        3)

                        Code:
                        $ locate servicemenuinstallation
                        change:
                        Code:
                        $servicedir = `kde4-config --localprefix`.strip! + "share/kde4/services/ServiceMenus/"
                        to:
                        Code:
                        $servicedir = `qtpaths --writable-path GenericDataLocation`.strip! + "/kservices5/ServiceMenus/"
                        Last edited by Rog131; Mar 14, 2017, 11:52 AM.
                        Before you edit, BACKUP !

                        Why there are dead links ?
                        1. Thread: Please explain how to access old kubuntu forum posts
                        2. Thread: Lost Information

                        Comment


                          #42
                          Service Menus with Dolphin

                          Thanks, Rog131! Worked perfectly!
                          Last edited by GreyGeek; Mar 16, 2017, 10:03 PM.
                          "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                          – John F. Kennedy, February 26, 1962.

                          Comment


                            #43
                            Now in zesty for testing.

                            https://launchpad.net/ubuntu/+source....12.3-0ubuntu2
                            On #kubuntu-devel & #kubuntu on libera.chat - IRC Nick: RikMills - Launchpad ID: click

                            Comment


                              #44
                              sudoedit with the Kate

                              Linking: https://www.kubuntuforums.net/showth...l=1#post399157

                              AskUbuntu: Proper way to let user enter password for a bash script using only the GUI (with the terminal hidden): http://askubuntu.com/questions/31439...y-the-gui-with

                              =>

                              Writing files:

                              /usr/local/bin/sudoeditkate.sh
                              Code:
                              #!/bin/sh 
                              
                              export EDITOR=/usr/bin/kate
                              export SUDO_ASKPASS=/usr/local/bin/sudoeditpass.sh
                              sudoedit -A "$1"
                              /usr/local/bin/sudoeditpass.sh
                              Code:
                              #!/bin/sh
                              kdialog --password 'sudoedit needs user (sudo) password to execute the kate'
                              $Home/.local/share/kservices5/ServiceMenus/rootkate.desktop
                              Code:
                              [Desktop Entry]
                              Type=Service
                              Icon=kate
                              X-KDE-ServiceTypes=KonqPopupMenu/Plugin
                              MimeType=all/allfiles;
                              Actions=sudoeditKate;
                              X-KDE-Priority=TopLevel
                              #X-KDE-Submenu=
                              Encoding=UTF-8
                              
                              [Desktop Action sudoeditKate]
                              Name=sudoedit kate
                              Icon=kate
                              Exec=sudoeditkate.sh "%U"
                              Testing...



                              ...Seems to work
                              Last edited by Rog131; Apr 08, 2017, 01:32 PM.
                              Before you edit, BACKUP !

                              Why there are dead links ?
                              1. Thread: Please explain how to access old kubuntu forum posts
                              2. Thread: Lost Information

                              Comment


                                #45
                                Originally posted by GreyGeek View Post
                                Thanks, Rog131! Worked perfectly!
                                Until I checked today.
                                Seems some update in the last three weeks reversed the changes.
                                Re-doing them, they still work (on fully updated Neon User Edition).

                                PS - I checked the kservice5 Dolphin service menu changes and they had been reverted as well. Changed them back to Rog's solution.
                                "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                                – John F. Kennedy, February 26, 1962.

                                Comment

                                Working...
                                X