Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 11 Dec 2018, 21:17
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
The "Zip" Family
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [10 Posts]  
Author Message
Smithy


Joined: 12 Dec 2011
Posts: 963

PostPosted: Tue 12 Jun 2018, 05:56    Post subject:  The "Zip" Family  

The zip entry in rox sourceforge.net does not seem to discriminate between zip files and tries to open a qtractor .qtz file with xarchive.
I managed to change it so that the qtz files, when clicked on, open with usr/bin/qtractor,
but then any .pets, .zips. gzips etc also try to open in qtractor, which of course are doomed to fail.

Is there a way to make a .qtz file association only, just for qtractor archive files?
A bit hard to explain, but I hope someone gets it without going off on
tangents.
Note: The right click asociation is fine, I managed to get an open with qtractor ok.
file association(1).png
 Description   
 Filesize   96.57 KB
 Viewed   198 Time(s)

file association(1).png

file association.png
 Description   
 Filesize   70.08 KB
 Viewed   199 Time(s)

file association.png

Back to top
View user's profile Send private message 
mjmikulcik

Joined: 09 Jun 2017
Posts: 32

PostPosted: Tue 12 Jun 2018, 16:24    Post subject:  

What sounds to me is that the .qtz mime type is somehow the same as .zip or included in the xarchive. Maybe you need to make its own mime type. See http://puppylinux.org/wikka/HowToAddMIMEType Then specify the set run action.

First though, make sure there is no file in /root/Choices/MIME-types for the .qtz file.
Back to top
View user's profile Send private message 
Smithy


Joined: 12 Dec 2011
Posts: 963

PostPosted: Tue 12 Jun 2018, 19:53    Post subject:  

Thanks for your reply mjmikulcik, I've been to dark city's page so many times and it never seems to sink in.
I'm thinking of trying to make those .qtz files when clicked on, trigger an .sh file with qtractor "$1" in it, a lot simpler, but how to link the .sh to .qtz..
Back to top
View user's profile Send private message 
mjmikulcik

Joined: 09 Jun 2017
Posts: 32

PostPosted: Wed 13 Jun 2018, 01:53    Post subject:  

I just realized the problem... i think. The .qtz file happens to end in a "tz" which happens to be an extension for a compressed file. The mime type looks for anything ending in tz and labels it a zip and when you go to set run action for .qtz it sets it for all zip type applications. This is not what we want. Instead, we need to edit the mime type to allow for .qtz files and set the run action on them.

Could you a upload a small .qtz for me to experiment with? I'm not 100% sure of the solution but i think we can get there. Also, I'm unfamiliar with the dark city page you mentioned
Back to top
View user's profile Send private message 
Smithy


Joined: 12 Dec 2011
Posts: 963

PostPosted: Wed 13 Jun 2018, 03:51    Post subject:  

Yes here's a .qtz file, just a default setup one. (Has to be renamed).
Dark City is a forum member who authored the pages you linked to.
Thanks for having a go mjmikulcik!
Default.gz
Description 
gz

 Download 
Filename  Default.gz 
Filesize  1.21 KB 
Downloaded  25 Time(s) 
Back to top
View user's profile Send private message 
ITSMERSH


Joined: 02 May 2018
Posts: 571

PostPosted: Wed 13 Jun 2018, 04:32    Post subject:  

Hey Smithy.

I have a workaround.

When clicking a file by pressing the shift key, the file is interpret as text file and therefor sent to /usr/local/bin/defaulthandler (in fact it's sent to another script, which calls or is sym-linked to defaulthandler).

In /usr/local/bin/defaulthandler I'd added some modifications for files like .jpg. These files usually open in image viewer, but when I'm clicking a .jpg file by pressing shift, it calls GIMP (defaultimageeditor).

Here's my defaulthandler script:
Code:
#!/bin/sh
#------------------------------------------------------------------------------
# Updated Version 2013, 2014, 2015 by RSH for LazY Puppy and the new Menu Pipes
#------------------------------------------------------------------------------

## Get Application Directory
##--------------------------
[ "$APPDIR" = "" ] && APPDIR="`dirname "$0"`" # Application Directory
#APPDIRAPP="`basename "$0"`" # Application Name
#APPDIRDIR="`dirname "$APPDIR"`" # Directory of Application Directory
#[ "$APPDIR" = "." ] && APPDIR="`pwd`"
#export APPDIR="$APPDIR"
#export APPDIR=`dirname "$0"`
#[ "$APPDIR" = '.' ] && export APPDIR=`pwd`

# Submitted file
FFILE="$@"
AFILE="`basename "$FFILE"`"
IMGEDITNOVIEW="false"
AUDEDITNOPLAY="false"
FILETOAPPSELECTOR="false"
[ -f "/tmp/defaulthandler_use_imageview" ] && read IMGEDITNOVIEW < "/tmp/defaulthandler_use_imageview"
[ -f "/tmp/defaulthandler_use_audioplay" ] && read AUDEDITNOPLAY < "/tmp/defaulthandler_use_audioplay"
[ -f "/tmp/defaulthandler_use_appselector" ] && read FILETOAPPSELECTOR < "/tmp/defaulthandler_use_appselector"

# It is a Web Link or it has an extension?
if [ "`echo -n "$FFILE" | grep '^http:'`" != "" ]; then
   /usr/local/bin/defaultbrowser "$FFILE"
   exit
   elif [ "`echo -n "$FFILE" | grep '^www.'`" != "" ]; then
   /usr/local/bin/defaultbrowser "http://""$FFILE"
   exit
   elif [ "`echo -n "$AFILE" | grep '\.'`" = "" ]; then
   /usr/local/bin/defaulttexteditor "$FFILE"
   exit
   else
   AEXT="`echo "$AFILE" | rev | cut -f 1 -d '.' | rev`"
fi

# Where are the RoxApp Application Directories?
[ -d "$APPDIR/apps" ] && APPSDIR="$APPDIR/apps" || APPSDIR="/usr/local/apps"
# Where are some of the Binaries?
[ -d "$APPDIR/bin" ] && BINSDIR="$APPDIR/bin" || BINSDIR="/usr/local/bin"

if [[ "$FILETOAPPSELECTOR" == "true" && -f /usr/local/apps/Send2AppOrDir/AppRun ]]; then

   /usr/local/apps/Send2AppOrDir/AppRun "$FFILE"

   ######################################################################################
   else # [[ "$FILETOAPPSELECTOR" = "true" && -f /usr/local/apps/Send2AppOrDir/AppRun ]];
   ######################################################################################

   # This has been updated a lot!
   case "$AEXT" in

      #-----------------------------------------------
      # Special Definitions for RSHs Application Kiosk
      #-----------------------------------------------

      # Audacity, Rosegarden
      aup|AUP|rg|RG)
         # File 'AppKiosk' or 'searchnexecute' in Drectory?
         if [[ -f $APPDIR/AppKiosk || -f $APPDIR/gdambuilder || -f $APPDIR/searchnexecute ]]; then

            case "$AEXT" in
               # Audacity Files
               aup|AUP)
                  "$APPSDIR/Audacity/AppRun" "$FFILE" &
               ;;

               # Rosegarden Files
               rg|RG)
                  "$APPSDIR/Rosegarden/AppRun" "$FFILE" &
               ;;

               # KDEnLiVE Files
               kdenlive|KDENLIVE)
                  "$APPSDIR/Kdenlive/AppRun" "$FFILE" &
               ;;
            esac

         fi
      ;;

      #------------------------------------------------------
      # End of special Definitions for RSHs Application Kiosk
      #------------------------------------------------------

      #--------------------
      # Default Definitions
      #--------------------

      # SFS Modules
      iso|ISO)
         filemnt "$FFILE"
      ;;

      # SFS Modules
      sfs|SFS)
         sfs-handler "$FFILE"
      ;;

      # Archives
      gz|GZ|bz|BZ|tar*|TAR*|zip|ZIP|tgz|TGZ)
         /usr/bin/xarchive "$FFILE"
      ;;

      # Install Packages
      deb|DEB|pet|PET)
         /usr/local/petget/petget "$FFILE"
      ;;

      # Notecase Documents
      ncd|NCD)
         notecase "$FFILE"
      ;;

      # Plain Text Documents
      txt|TXT|lst|LST|cfg|CFG|specs|SPECS|rc|RC|sh|SH|py|PY|js|JS|json|JSON)
         /usr/local/bin/defaulttexteditor "$FFILE"
      ;;

      # Word Office Document
      doc|DOC|rtf|RTF|docx|DOCX|odt|ODT)
         /usr/local/bin/defaultwordprocessor "$FFILE"
      ;;

      # Spreadsheet Office Documents
      xls|XLS|gnumeric|GNUMERIC|odc|ODC|ods|ODS)
         /usr/local/bin/defaultspreadsheet "$FFILE"
      ;;

      # HTML/XML and similar Documents
      htm*|HTM*)
         /usr/local/bin/defaultbrowser "$FFILE"
      ;;

      # HTML/XML and similar Documents
      xml|XML|css|CSS|php|PHP)
         /usr/local/bin/defaulttexteditor "$FFILE"
      ;;

      # Image Documents 1 - GIMP should be the 'defaultimageeditor'
      xcf|XCF|ico|ICO|psd|PSD|gs|GS)
         /usr/local/bin/defaultimageeditor "$FFILE"
      ;;

      # Image Documents 2 - ViewNior
      bmp|BMP|jpg|JPG|jpeg|JPEG|png|PNG|gif|GIF|tif*|TIF*|xpm|XPM)
         #/usr/local/bin/defaultimageeditor "$FFILE"
         [ "$IMGEDITNOVIEW" = "true" ] && /usr/local/bin/defaultimageeditor "$FFILE" || /usr/local/bin/defaultimageviewer "$FFILE"
      ;;

      # Image Documents 3 - Corel Photopaint
      cpt|CPT)
         /usr/local/bin/defaultcorelphotoeditor "$FFILE"
      ;;

      # Image Documents 3 - Corel Draw
      cdr|CDR)
         /usr/local/bin/defaultcoreldraweditor "$FFILE"
      ;;

      # Image Documents 3 - Corel Dream 3D
      d3d|D3D)
         /usr/local/bin/defaultcoreldreameditor "$FFILE"
      ;;

      # PDF/PostScript Documents
      pdf|PDF|ps|PS|eps|EPS)
         /usr/local/bin/defaultpdfviewer "$FFILE"
      ;;

      # Audio Documents
      mp3|MP3|wav|WAV|flac|FLAC|ogg|OGG)
         #/usr/local/bin/defaultaudioeditor "$FFILE"
         #/usr/local/bin/defaultplayer "$FFILE"
         [ "$AUDEDITNOPLAY" = "true" ] && /usr/local/bin/defaultaudioeditor "$FFILE" || /usr/local/bin/defaultmediaplayer "$FFILE"
      ;;

      # Video Documents
      mp4|MP4|mpg|MPG|mpeg|MPEG|avi|AVI|mkv|MKV)
         /usr/local/bin/defaultmediaplayer "$FFILE"
      ;;

      #---------------------------
      # End of default Definitions
      #---------------------------

      # Any else Documents
      *)
         #/usr/local/bin/defaulttexteditor-bin "$FFILE"
         "$BINSDIR"/defaulttexteditor-bin "$FFILE"
      ;;

   esac

fi # [[ "$FILETOAPPSELECTOR" = "true" && -f /usr/local/apps/Send2AppOrDir/AppRun ]];


And here's my defaulttexteditor-bin (called by defaulthandler)
Code:
#!/bin/sh
#------------------------------------------------------------------------------
# New BackEnd for the defaulttexteditor Script
# Check for no-text files first and send them to 'defaultXXX' Script
# when doing a left-click onto the image while holding a shift key down
#------------------------------------------------------------------------------

# Send submitted file name/s into a temp file
[ "$@" != "" ] && SUBMITTED="$@" || SUBMITTED="new.txt"
echo "$SUBMITTED" > /tmp/file_submitted_shift_key_holded_down
BNSUBMIT="`basename "$SUBMITTED"`"
EXTENSION=${BNSUBMIT##*.} # extension only

case $EXTENSION in

   # KDEnLiVE Files
   kdenlive)
      if (grep -i kdenlive /usr/local/bin/defaultvideoeditor >/dev/null) then
         defaultvideoeditor "$SUBMITTED" &
         file_is_no_text="true"
      fi
   ;;

   # ISO Files
   iso|ISO)
      filemnt "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # SFS Modules
   sfs|SFS)
      sfs-handler "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # Archives
   gz|GZ|bz|BZ|tar*|TAR*|zip|ZIP|tgz|TGZ)
      /usr/bin/xarchive "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # Install Packages
   deb|DEB|pet|PET)
      /usr/local/petget/petget "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # Plain Text Documents
   txt|TXT|lst|LST|cfg|CFG|specs|SPECS|rc|RC|sh|SH|py|PY|js|JS|json|JSON)
      #/usr/local/bin/defaulttexteditor "$SUBMITTED"
      file_is_no_text="false"
   ;;

   # Word Office Document
   doc|DOC|rtf|RTF|docx|DOCX|odt|ODT)
      /usr/local/bin/defaultwordprocessor "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # Spreadsheet Office Documents
   xls|XLS|gnumeric|GNUMERIC|odc|ODC|ods|ODS)
      /usr/local/bin/defaultspreadsheet "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # HTML/XML and similar Documents
   htm*|HTM*|xml|XML|css|CSS|php|PHP)
      #/usr/local/bin/defaulttexteditor "$SUBMITTED"
      file_is_no_text="false"
   ;;

   # Image Documents 1 - GIMP should be the 'defaultimageeditor'
   xcf|XCF|ico|ICO|psd|PSD|gs|GS)
      /usr/local/bin/defaultimageeditor "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # Image Documents 2 - GIMP should be the 'defaultimageeditor'
   bmp|BMP|jpg|JPG|jpeg|JPEG|png|PNG|gif|GIF|tif*|TIF*|xpm|XPM)
      /usr/local/bin/defaultimageeditor "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # Image Documents 3 - Corel Photopaint
   cpt|CPT)
      /usr/local/bin/defaultcorelphotoeditor "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # Image Documents 3 - Corel Draw
   cdr|CDR)
      /usr/local/bin/defaultcoreldraweditor "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # Image Documents 3 - Corel Dream 3D
   d3d|D3D)
      /usr/local/bin/defaultcoreldreameditor "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # PDF/PostScript Documents
   pdf|PDF|ps|PS|eps|EPS)
      /usr/local/bin/defaultpdfviewer "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # Audio Documents
   mp3|MP3|wav|WAV|flac|FLAC|ogg|OGG)
      /usr/local/bin/defaultaudioeditor "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # Video Documents
   mp4|MP4|mpg|MPG|mpeg|MPEG|avi|AVI|mkv|MKV)
      /usr/local/bin/defaultmediaplayer "$SUBMITTED"
      file_is_no_text="true"
   ;;

   # Any else Documents
   *)
      #/usr/local/bin/defaulttexteditor "$SUBMITTED"
      file_is_no_text="false"
   ;;

esac

# Else, submitted file is a text file - send file to Geany
if [ "$file_is_no_text" = "false" ]; then
   if [ "`which geany`" != "" ]; then
      exec geany "$SUBMITTED" &
      elif [ "`which nicoedit`" != "" ]; then
      exec nicoedit "$SUBMITTED" &
      elif [ "`which leafpad`" != "" ]; then
      exec leafpad "$SUBMITTED" &
      # Lazy Puppy RunScript for Geany-0.20
      elif [ -f $HOME/.my-sfs-scripts/LP2_Geany-0.20.sfs.Scripts/LP2_Geany-0.20.sfs.Geany-text-editor.run.sh ]; then
      exec $HOME/.my-sfs-scripts/LP2_Geany-0.20.sfs.Scripts/LP2_Geany-0.20.sfs.Geany-text-editor.run.sh "$SUBMITTED" &
      # Lazy Puppy RunScript for Geany-0.21
      elif [ -f $HOME.my-sfs-scripts/LP2_Geany-0.21-i486.sfs.Scripts/LP2_Geany-0.21-i486.sfs.geany021.run.sh ]; then
      exec $HOME.my-sfs-scripts/LP2_Geany-0.21-i486.sfs.Scripts/LP2_Geany-0.21-i486.sfs.geany021.run.sh "$SUBMITTED" &
      # Lazy Puppy RunScript for Geany-1.22
      elif [ -f $HOME/.my-sfs-scripts/LP2_Geany-1.22-i686.sfs.Scripts/LP2_Geany-1.22-i686.sfs.geany.run.sh ]; then
      exec $HOME/.my-sfs-scripts/LP2_Geany-1.22-i686.sfs.Scripts/LP2_Geany-1.22-i686.sfs.geany.run.sh "$SUBMITTED" &
   fi
fi

# Remove temp File of submitted file name/s
rm -f /tmp/file_submitted_shift_key_holded_down

exit 0

_________________
RSH
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 2698
Location: Cradle of Humankind

PostPosted: Wed 13 Jun 2018, 06:07    Post subject:  

A workaround would be to right-click that file instead and use "open with" to specify the application you want it to open with.
Back to top
View user's profile Send private message 
mjmikulcik

Joined: 09 Jun 2017
Posts: 32

PostPosted: Wed 13 Jun 2018, 14:48    Post subject:  

Okay, so I've solved it. If you have the devx installed, (it's an sfs you can get from the setup/sfsmanager called development libraries or you could get it somewhere else)

What you need to do is place the attached file in your /usr/share/mime/packages directory and then run in the terminal the command
Code:
update-mime-database /usr/share/mime


After that, restart X -> go to shutdown, restart graphical server, and when it boots back you have to "set run action" (right-click on file) and instead of being in the 'zip' family it will set for qtractor.

If you don't have devx installed, I recommend it because its useful if you ever want to compile anything, but supposing you don't want it, there is another way.

Code:
#add mime-type (without using update-mime-database)
echo application/x-qtractor-file:*.qtz >> /usr/share/mime/globs
echo 50:application/x-qtractor-file:*.qtz >> /usr/share/mime/globs2
echo application/x-qtractor-file text/xml >> /usr/share/mime/subclasses
echo application/x-qtractor-file >> /usr/share/mime/types


paste this code into a script file. Set it to be executable in the permissions and run it. Then of course restart X. I haven't tested that method.

I hope this helps,
mjmikulcik

p.s. ITSMERSH I love your workaround but I don't think it's quite what Smithy wanted, however I might try it in the future myself
Screenshot.jpg
 Description   Here is a picture showing it works
 Filesize   37.96 KB
 Viewed   83 Time(s)

Screenshot.jpg

qtractor.xml.gz
Description  I took this by editing audacities. Also rename to just .xml
gz

 Download 
Filename  qtractor.xml.gz 
Filesize  287 Bytes 
Downloaded  70 Time(s) 
Back to top
View user's profile Send private message 
Smithy


Joined: 12 Dec 2011
Posts: 963

PostPosted: Wed 13 Jun 2018, 18:47    Post subject:  

Yay that works mjmikulcik, and fast too!

I've made a pet of it to add to qtractor. It's funny, step was talking about that stuff with woodenshoe the other day concerning rox filer.
Many thanks for working it out.

RSH: that does sound good that you can click with the shift key to change what you want to open, from a viewer like Viewnoir to an editor like Gimp, once you got used to it, that could be snappy.
click to open.png
 Description   
 Filesize   41 KB
 Viewed   66 Time(s)

click to open.png

Back to top
View user's profile Send private message 
ITSMERSH


Joined: 02 May 2018
Posts: 571

PostPosted: Thu 14 Jun 2018, 00:30    Post subject:  

Quote:
p.s. ITSMERSH I love your workaround but I don't think it's quite what Smithy wanted, however I might try it in the future myself

Never mind. Cool
Quote:
RSH: that does sound good that you can click with the shift key to change what you want to open, from a viewer like Viewnoir to an editor like Gimp, once you got used to it, that could be snappy.

It is! Very Happy

_________________
RSH
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [10 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2095s ][ Queries: 15 (0.0089s) ][ GZIP on ]