Hotkey to Remember window size and position for IceWM

Forum Forums General Tips and Tricks Hotkey to Remember window size and position for IceWM

  • This topic has 75 replies, 9 voices, and was last updated Feb 23-6:21 pm by Brian Masinick.
Viewing 15 posts - 31 through 45 (of 76 total)
  • Author
    Posts
  • #37151
    Member
    Xecure
      Helpful
      Up
      0
      ::

      I understand your idea, PPC, but when trying to get to open another window with HELP info, I just wasn’t able to do it with the main yad script inside a function. I tryed playing with a different selection menu, but I gave up. Maybe someone with more experience can set the menu to work.
      I also gave up with the menu because I had so many roxterminals open I didn’t know which was which.

      I finally decided to use a different method and have set a button to get the user to interactively select the window they want.
      I have set in line 127 a path (need to be changed to wherever you save this script) that will call the script interactively.
      There are 4 buttons: Help, Select other, OK and Quit.
      OK and Quit work the same way as before.
      Help calls for a help window, explaining thing about how to use the program.
      Select other closes the window, changes the cursor, and lets you select a window with the cursor. When clicking with the cursor, a new window will open with the info about the window you have selected, ready to save the info conf to icewinoptions file (to get this to work, you need to change path in line 127).

      If this interactive option is not wanted, and the selection menu is better, then someone can continue from where I left and simply change the select other button to open PPC’s yad window to select a different opened window.

      The file: https://pastebin.com/ZfVQm3UP

      antiX Live system enthusiast.
      General Live Boot Parameters for antiX.

      #37152
      Member
      PPC
        Helpful
        Up
        0
        ::

        Picking up Xecure’s Help file idea, and adapting it:

        https://pastebin.com/ea9r95wF

        I also correct the “hide conky from the window list” BUG and took the liberty of tweaking a bit the text presented on the main script (sorry, Bob and all)

        Now anti can pick what script is best suited for antiX

        P.

        #37160
        Moderator
        BobC
          Helpful
          Up
          0
          ::

          Xecure,

          I tried your code there. In the IceWM Dev’s version he use xprop to allow the user to select which window to look at. My suggestion would be if run from a key, look at the active window. If run from Control Centre or menu, let the user choose with xprop.

          Maybe later that could be enhanced with a fancy selection list, but as Moddit said, they are going to set this up for a program, and once they are happy with it, it will probably stay set.

          If you guys need me to do something here to help, let me know what…

          PS: I found the -s option. I think that will work, but before putting it into “Point to the Window” mode, maybe stop and pop up a box to tell them that they need to have the window they want to save partially visible on the screen in order to select it. Click Ok when ready to select…

          • This reply was modified 2 years, 11 months ago by BobC.
          #37161
          Moderator
          BobC
            Helpful
            Up
            0
            ::

            PPC version #1

            Oh my! I have soooo many windows!

            If only I could choose one, LOL.

            This is my fault, but I bet others would have that same problem… Let me try version #2

            BRB…..

            Version #2 seems to have 2 copies of the code with > in front on the lower section and something about infinte loops… I won’t try to test it given that.

            Your version #1 is similar to what I was thinking, but I didn’t realize that I would have 100 very similar windows to choose from in an unknown sequence. I think to “Point and Shoot” would be better…

            • This reply was modified 2 years, 11 months ago by BobC.
            #37168
            Member
            PPC
              Helpful
              Up
              0
              ::

              Hi, Bob!

              -Your suggestions about Xecures’s script make it a one solution fits all (it’s perfect to use with a hotkey and also allows the user to select a window to “Remember”/”Forget”)…
              But I like my own script- there’s something about choosing from a menu that appeals to me…

              -About what you said about the second version of the script:
              *if you want, you can try the latest version I sent to pastebin- its completly safe… The complex “>” part is to delete Conky from the text file that lists all open windows- it removes all lines with “Conky (” from the file, saves it with the “2” suffix and then overwrites the original file with this second one. Itś a one liner I picked up from the web, to allow easy manipulation of text files…
              *Now about the loop- yes- there s loop- because anticapilaista suggested a single way to set all windows the user wanted to set, running the script once and then selecting, in sequence, one after another, the windows that are to be remembered/forgotten…
              All the user has to do is click the “Quit” button from the window selection screen and the script exits!

              – TIP: while testing scripts that can trap your system from a loop: ALWAYS start unkown scripts from the terminal: that way, if you can’t get out of a loop, simple close the terminal and you’r done with it! (Yeah, that happened a lot to me in my first bash scripting tries, hell, it still happens now and then 🙁 )

              @Xecure: I forgot to tell you this in my last post- the way to run a function from another function is simply exporting it to the function you want to run it from, like I did, in my last pastebin script- just as an example!

              P.

              #37169
              Member
              Xecure
                Helpful
                Up
                0
                ::

                I was finally able to get PPC’s list into the script.
                https://pastebin.com/GNv82uxi

                This script has two (three) options

                /script/path -l
                will launch PPC’s list option

                /script/path -s
                will launch the selection tool mentioned by BobC

                /script
                normal script will select the focused window, as initially intended. It can be asigned to a key-binding for easy launching. It will also give you the option of selecting a different window if you selected or launched it for the incorrect window.

                Help launches for all cases (please test).

                The only thing needed is for the text to be changed (my english is not the best, so please, if needed, rephrase all sentences), and to make the list nicer, which shouldn’t be too difficult.

                BTW: I have changed window name and class, so these in the future, when trying to save window properties for these yad windows, they will be saved individually and no longer save for ALL yad windows.

                Edit: list a bit more “beautiful”. Still needs improvements.
                https://pastebin.com/uDWLCx9n

                • This reply was modified 2 years, 11 months ago by Xecure. Reason: better looking list

                antiX Live system enthusiast.
                General Live Boot Parameters for antiX.

                #37171
                Member
                PPC
                  Helpful
                  Up
                  0
                  ::

                  @Xecure: Your are briliant- great scripting there!

                  @Bob- What I still have to suggest is only some small language changes to the main script:

                  Instead of “Entries shown are for the program XXX”, I think “Entries shown are for XXX’s window” sounds better…
                  And, in the columns, remove the first header “Add/Remove”, rename the second “Entry” (or something similar) and the third one simply “Current Value”

                  P.

                  #37183
                  Member
                  Xecure
                    Helpful
                    Up
                    0
                    ::

                    Thanks, PPC. I have learnt a lot from you and your code and you input.

                    I think the program is taking shape very nicely.

                    antiX Live system enthusiast.
                    General Live Boot Parameters for antiX.

                    #37184
                    Forum Admin
                    anticapitalista
                      Helpful
                      Up
                      0
                      ::

                      Looking very slick. Well done to all involved.
                      One ‘issue’ regarding workspace. workspace 2 (shown in toolbar) is workspace1 in the script.

                      Philosophers have interpreted the world in many ways; the point is to change it.

                      antiX with runit - leaner and meaner.

                      #37185
                      Member
                      Xecure
                        Helpful
                        Up
                        0
                        ::

                        One ‘issue’ regarding workspace. workspace 2 (shown in toolbar) is workspace1 in the script.

                        I know. I got that impression too when first testing the script. I think it starts numbering from zero, even if the workspace names are 1 and 2.

                        In the man page for icesh, it says:

                        -W, -Workspace WORKSPACE
                        Filter clients by workspace. Workspace WORKSPACE is either a workspace name or a workspace number counting from zero. If WORKSPACE starts with an exclamation mark then the filtering is inverted.

                        getWorkspace

                        Print the workspace for the specified window.

                        So even if the interface says “Workspace 1”, icesh uses workspace 0. I don’t know if we should add a warning in the help window to explain this.

                        For people with three or more workspaces, does the script work well? It would be interesting for people who are very used to icewm to test it out first and, after some time, can give some feadback to improve it before we consider it finished.

                        antiX Live system enthusiast.
                        General Live Boot Parameters for antiX.

                        #37222
                        Moderator
                        BobC
                          Helpful
                          Up
                          0
                          ::

                          I incorporated the suggestions above and added localization. I’m old school, so Zip files are easier for me…

                          #37228
                          Member
                          Xecure
                            Helpful
                            Up
                            0
                            ::

                            Very good work, BobC.
                            I decided to change some things on your script. Mainly, I fixed a bug when hitting Escape or closing from the window buttons, if “Select other” was just used or list option was enabled, that doesn’t let you close the window and keeps asking the user input.
                            https://pastebin.com/pH0RpkCR

                            antiX Live system enthusiast.
                            General Live Boot Parameters for antiX.

                            #37230
                            Moderator
                            BobC
                              Helpful
                              Up
                              0
                              ::

                              No, the good work was you making it the select work and PPC tweaking. I just did the little things requested above to it and gave it a few test runs.

                              I suggest letting Moddit test it to decide if it makes sense and meets the needs. I think its looking quite nice, and appreciated the commented code.

                              It looks like another win for antiX’s IceWM flavor desktop to me 🙂

                              #37231
                              Member
                              ModdIt
                                Helpful
                                Up
                                0
                                ::

                                BobC wrote, I suggest letting Moddit test it to decide if it makes sense and meets the needs,

                                Will do my best, I am busy with a solo Canoeing camp trip.
                                Kids are in exams for next couple of weeks.

                                Will see if I can somehow get decent internet and a mains power supply, due covid
                                restrictions I am unable to just go for a beer and plug in. Battery is near dead.

                                #37232
                                Member
                                ModdIt
                                  Helpful
                                  Up
                                  0
                                  ::

                                  Hi BobC, PPC, just gave it a first try, unfortunately, dot between Tor and geometry missing
                                  in the created winoptions, same for between Tor and workspace.
                                  My feeling is need to advise user to logout and back in again otherwise new users will test
                                  immediately and think the task failed. Probably that is the easiest way unless script would
                                  reload the settings auto-magically.

                                  Downloaded script again. unfortunately same error. Will find a way to look again tomorrow 12.06.

                                  Navigator.Torgeometry: 1000×1074+-4+-4 Must read Navigator.Tor.geometry: xxx
                                  Navigator.Torlayer: Normal
                                  Navigator.Torworkspace: 4 Must read Navigator.Tor.workspace: 4 and will then load to
                                  displayed 5. Understanding “Counting from 0” will only be needed for those working in text config.

                                  • This reply was modified 2 years, 11 months ago by ModdIt.
                                Viewing 15 posts - 31 through 45 (of 76 total)
                                • You must be logged in to reply to this topic.