antiX 22: selecting preferred applications

Forum Forums Official Releases antiX-21/22 “Grup Yorum” antiX 22: selecting preferred applications

  • This topic has 80 replies, 9 voices, and was last updated Nov 24-6:29 pm by Robin.
Viewing 15 posts - 31 through 45 (of 81 total)
  • Author
    Posts
  • #91579
    Member
    calciumsodium
      Helpful
      Up
      0
      ::

      I tested the desktop-defaults-set-20221026a version on antiX22 x64 base. Works good.

      Question. Once I am in advanced settings mode, I see no way to get back into the non-advanced settings mode, except by exiting the program and starting the program again. Is that what is intended?

      #91580
      Member
      PPC
        Helpful
        Up
        0
        ::

        Is that what is intended?

        I apologize to BobC, for, once again, answering in his place- but yes- the new script simply calls the old version of the scrip (that now works as the “advanced” one, since it’s harder to use, but more powerful)- so you get the exact expected behavior. Unfortunatly, yad windows need some tweaks to remain open after using them once (that’s why the window closes once you click “ok”- if you forgot to change a favorite, you need to reopen it… But you raise a good point, we could adapt the “advanced” script and insert a button to launch the “new” script… but it raises some complex questions, like having to change it’s localization file to translate that new button… Ouch…

        P.

        #91584
        Moderator
        Brian Masinick
          Helpful
          Up
          0
          ::

          A really easy alternative to yad is wish, a graphical TCL/Tk language. Here’s the code for a really simple script to start either of two text editors.
          I wrote the original tool in 1999 and I’ve modified it a few times; the latest version just has these two tools, which can be very easily changed:

          #!/bin/bash
          # the next line restarts using wish \
          exec wish "$0" "$@"
          #
          #
          # File: backgroundApps
          # Purpose: Start applications using radio buttons
          # based on code from Clif Flynt: TCL/Tk for Real Programmers
          # Author: Brian Masinick, October 1999
          
          # To use this program, run the command wish followed by the file to
          # be edited or used and any optional argument.
          
          frame .type -relief raised -bd 1
          
          # This program has been designed to use the standard dialog widgets
          # that have been added to as of Tk 8.0.  These are used in conjunction
          # with standard frames and buttons to produce the user interface.
          
          set emacsPath "/usr/bin/emacs"
          set gvimPath "/usr/bin/gvim"
          
          tk_optionMenu .appButton myApp $emacsPath $gvimPath
          pack .appButton
          
          set input [entry .e1 -textvariable inputvalue]
          set action [button .b1 -text "Open File:" -command {exec $myApp $inputvalue &}]
          
          pack $action $input -side left -expand 1 -fill x -padx 2 -pady 2
          button .quit -text quit -command exit
          button .help_button -text help -command help
          pack .quit .help_button -side left -expand 1 -fill x -padx 2 -pady 2
          pack .type -fill x
          
          # Help ---
          # The procedure below displays a message about this procedure and how
          # to use it
          
          proc help {} {
          	if [catch {toplevel .help}] return
          	message .help.text -text \
          "backgroundApps - written by Brian Masinick, October 1999
          
          Click on Emacs or Gvim to choose the editor you want to use.
          
          Then click on the text insertion area and type in the name of the file
          you want to edit.  Finally, to edit that file, using the editor you
          have selected, click on the Open File: button."
          
          	button .help.ok -text "ok" -command {destroy .help}
          	pack .help.text
          	pack .help.ok -fill x -padx 2 -pady 2
          }

          --
          Brian Masinick

          #91641
          Member
          blur13
            Helpful
            Up
            0
            ::

            General question: what does the “Preferred Applications” actually do? Does it simply set the preferred applications used in the icewm menu for “terminal” “browser” etc, and the text editor used when opening config files in the control center? My experience has been that most programs use xdg-open and that I have to configure .config/mimeapps.list for preferred applications. And in other cases ~/.mailcap.

            #91670
            Moderator
            BobC
              Helpful
              Up
              0
              ::

              On the menus, toolbar, scripts, and .desktop files, if you see a desktop-defaults-run command, it will look up what your default application program is for that function.

              I don’t know exactly how mime works, but I can tell you that the program does also setup mime info, but not for the 2 files you referred to. The one it updates is: $HOME/.local/share/applications/mimeinfo.cache

              If someone knows how to get it to call the other “advanced settings” program and return to the one I worked on, please let me know. I had expected it to return, but it didn’t.

              #91696
              Forum Admin
              Dave
                Helpful
                Up
                1
                ::

                Use a separate function that would record $0, run the original with a “;” then exec $0 & exit. Not 100% certain without testing but something like

                
                function advanced() {
                    ME=$0;
                    desktop-defaults-set-adv;
                    exec $ME &
                    exit
                }
                

                Maybe ME variable is not needed, or maybe it needs to be called with nohup….

                Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

                #91702
                Moderator
                BobC
                  Helpful
                  Up
                  0
                  ::

                  Thanks, Dave, I’ll give that a try.

                  #91725
                  Member
                  Robin
                    Helpful
                    Up
                    0
                    ::

                    Hello Bob,
                    didn’t you receive my Email some days ago (26.10.) in reply to your request for testing the former version? I had added a “Back” button already to the advanced settings, along with making the two separate scripts fit for translation both. The back button is missing in your new version, maybe you can take it over from what I’ve sent you. Moreover I’d suggest to use the cleaned up translation strings and code from what I’ve sent you. The existing transifex translation files can get mass updated in all languages easily using sed commands to match the new msgids, so translators don’t need to retranslate all the existing identical strings for this change. I could provide the fixed .po files for all languages, then anticapitalista can update the resource with them, and only the two new strings “Back” and “Advanced Settings” actually will need to be translated.

                    Moreover the script version you’ve attached in your posting above hangs when trying to abort from advanced settings with error:

                    lang=de
                    ./desktop-defaults-set-20221028/desktop-defaults-set: Zeile 378: ./desktop-defaults-set-20221028/desktop-defaults-set: Keine Berechtigung
                    ./desktop-defaults-set-20221028/desktop-defaults-set: Zeile 378: exec: ./desktop-defaults-set-20221028/desktop-defaults-set: Kann nicht ausführen: Keine Berechtigung

                    Obviously it tries to execute something it has not permission for, no idea what it is, while it should simply abort only. You can only kill the process using ctrl+c. This issue was not present in the two-scripts version before.

                    Kind Regards
                    Robin

                    Windows is like a submarine. Open a window and serious problems will start.

                    #91729
                    Moderator
                    BobC
                      Helpful
                      Up
                      0
                      ::

                      Ok, Robin, lets just go with your version. I did combine the programs per your suggestion. I didn’t get the error you received, but if your version doesn’t have that problem, I’m fine with using it instead of mine. I certainly am no expert on the translation issues, either.

                      PS: I tested your version, and it works fine. Let’s let others try it too. I’ve been real busy at work lately and had forgotten about your attachments.

                      Thanks 🙂

                      • This reply was modified 6 months, 1 week ago by BobC.
                      #91747
                      Member
                      Robin
                        Helpful
                        Up
                        0
                        ::

                        OK, I’ve made a one-script version from it. While downloading the translation files from transifex for processing I’ve noticed that exactly this cutoff was done already by anticapitalista per 2022-10-17 and in anitX 22 are the new strings files present already. This means, that the versions attached above won’t work properly in translation, and were not based on the most recent script version. So I started anew, from the version present in antiX 22, which is proven to work and seems to be most recent one in reach. Please check the result from this link at gitlab: desktop-defaults-set download and report if you find any issues. If it works for you, I’ll send a merge request to anticapitalista for this update. Will create the .pot file from it soon, so it can be updated at transifex to cover the few additional strings. No retranslation of existing strings will be needed.

                        Windows is like a submarine. Open a window and serious problems will start.

                        #91749
                        Member
                        calciumsodium
                          Helpful
                          Up
                          0
                          ::

                          Hello,

                          I tested this last version. The “Back” button works as intended.
                          I noticed two things.
                          1. This script is not set to executable. Only when I set it to executable will it show up in the Control Centre. All the scripts that BobC had previously were set to executable.
                          2. You had the term “Free Choice” instead of “Advanced Settings”. For me, the “Advanced Settings” term sounds better.

                          Thanks.

                          • This reply was modified 6 months, 1 week ago by calciumsodium. Reason: added wording about it not showing up in Control Centre only if the script is set to executable
                          #91752
                          Member
                          Wallon
                            Helpful
                            Up
                            0
                            ::

                            Dear Robin,

                            I tested the version on github.

                            When the window opens, I notice on the screenshot desktop-defaults-set1.jpg
                            point 1 in red: the title of the window is not complete. A part of the sentence “Advanced settings” is missing
                            point 2 in red: “Free Choice” is not translated into French.

                            When I click on the “Free Choice” button, I see on the screenshot desktop-defaults-set2.jpg;
                            point 1 in red : a part of the title is in English “Free Choice”.
                            point 2 in red : “Back” is not translated into French.

                            Best regards,
                            Wallon

                            #91755
                            Member
                            Robin
                              Helpful
                              Up
                              0
                              ::

                              Dear Wallon, dear calciumsodium

                              Many thanks for testing.
                              What you see still in English language are the new strings, which need to get translated still. For testing you can download the .pot file and create your own .po file from it, adding the missing translations and build the .mo file using either poedit or msgfmt. Here’s the download link for the updated .pot file. As a base you can use the po translation file from transifex (antiX-development) in your language “for use”, which contains all reused translations.

                              About wording: I believe the expression “Advanced settings” is wrong here, even when it sounds more familiar. The second window doesn’t provide any additional settings, no advanced functions, but the very same settings as the window before. The true difference is: Here you have a free choice now from your complete file system what you want to set in each entry. This is why I called it “Free Choice”, which describes this best. Maybe an English native speaker can put it even more concise. But I consider something like “Advanced settings” to be simply wrong here.

                              Many Greetings
                              Robin

                              Windows is like a submarine. Open a window and serious problems will start.

                              #91756
                              Moderator
                              BobC
                                Helpful
                                Up
                                0
                                ::

                                How about “Expert Mode” or “Override Choices”?

                                I would expect people would want to use it if they added an application and it doesn’t come up as a choice because it’s desktop entry didn’t identify it as usable for that function.

                                #91761
                                Member
                                calciumsodium
                                  Helpful
                                  Up
                                  0
                                  ::

                                  “Expert Mode” sounds very good to me.

                                Viewing 15 posts - 31 through 45 (of 81 total)
                                • You must be logged in to reply to this topic.