Results 1 to 4 of 4

Thread: Help.for create right click service menu desktop!

  1. #1
    Join Date
    Apr 2015
    Location
    The Earth
    Posts
    498

    Default Help.for create right click service menu desktop!

    Hi
    i create this script "*.desktop" and work
    Code:
    [Desktop Entry]
    Type=Service
    MimeType=application/octet-stream;
    X-KDE-ServiceTypes=KonqPopupMenu/Plugin
    Actions=Shred_file
    MimeType=all/allfiles;
    X-KDE-Submenu=Wipe_optoin
    X-KDE-StartupNotify=false
    X-KDE-Priority=TopLevel
    [Desktop Action Shred_file]
    Name=Shred Files 5 times
    Icon=waiting
    
    
    Exec=wipe -rf -v  -p5 %F

    but
    I want add dialog box "yesno" if press "yes" run command if press "no" or close box not run command
    how to add?
    Thanks
    Dual-boot openSUSE and win10
    OpenSUSE Tumbleweed ; Plasma 5.15.x:" LVM encrypted"
    My Partition: GPT and UEFI system
    Hp ProBook 450 G1

  2. #2
    Join Date
    Apr 2015
    Location
    The Earth
    Posts
    498

    Default Re: Help.for create right click service menu desktop!

    No one to help
    Dual-boot openSUSE and win10
    OpenSUSE Tumbleweed ; Plasma 5.15.x:" LVM encrypted"
    My Partition: GPT and UEFI system
    Hp ProBook 450 G1

  3. #3

    Default Re: Help.for create right click service menu desktop!

    For showing a Yes/No dialog, you can use kdialog:
    Code:
    kdialog --yesno "Really?"
    Create a script that calls kdialog and then runs your stuff depending on the return code, and then run that in the Exec line instead of "wipe" directly.

    Something like this should work in your case:
    Code:
    if `kdialog --yesno "Really?"`
     then
      # user selected "Yes"
      wipe -rf -v  -p5 %F
    fi
    You could even wrap this into one line and put it into the Exec directly.
    This should work, but I haven't tried it:
    Code:
    Exec=if `kdialog --yesno "Really?"`; then wipe -rf -v  -p5 %F; fi


    Last edited by wolfi323; 06-Feb-2016 at 10:38.

  4. #4
    Join Date
    Apr 2015
    Location
    The Earth
    Posts
    498

    Default Re: Help.for create right click service menu desktop!

    Quote Originally Posted by wolfi323 View Post
    For showing a Yes/No dialog, you can use kdialog:
    Code:
    kdialog --yesno "Really?"
    Create a script that calls kdialog and then runs your stuff depending on the return code, and then run that in the Exec line instead of "wipe" directly.Something like this should work in your case:
    Code:
    if `kdialog --yesno "Really?"` then  # user selected "Yes"  wipe -rf -v  -p5 %Ffi
    You could even wrap this into one line and put it into the Exec directly.This should work, but I haven't tried it:
    Code:
    Exec=if `kdialog --yesno "Really?"`; then wipe -rf -v  -p5 %F; fi
    Thank you very much. for help me
    Dual-boot openSUSE and win10
    OpenSUSE Tumbleweed ; Plasma 5.15.x:" LVM encrypted"
    My Partition: GPT and UEFI system
    Hp ProBook 450 G1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •