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 - 46 through 60 (of 76 total)
  • Author
    Posts
  • #37234
    Moderator
    BobC
      Helpful
      Up
      0
      ::

      It works correctly for Sol and Roxterm.

      #37235
      Member
      Xecure
        Helpful
        Up
        0
        ::

        Hi BobC, PPC, just gave it a first try, unfortunately, dot between Tor and geometry missing

        It seems the original script created by the icewm team didn’t contemplate a space inside the name of the window.
        When executing:
        icesh getGeometry getLayer getWorkspace prop WM_CLASS prop _NET_FRAME_EXTENTS
        and selecting the Tor Browser, I get this:

        1000x874+919+28
        0x1a00025 Normal
        0x1a00025 0 " 1 "
        0x1a00025 WM_CLASS = Navigator.Tor Browser.
        0x1a00025 _NET_FRAME_EXTENTS(CARDINAL) = 1, 1, 28, 1

        The problem is in WM_CLASS = Navigator.Tor Browser.

        I will try to change the code so it gets the full string after WM_CLASS =

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

        #37243
        Moderator
        BobC
          Helpful
          Up
          0
          ::

          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.

          See if the note I added to the text about workspace number helps.

          Workspaces can be named with names, not just numbers, so I think the user should understand that the program is just going to open it in the workspace it came from if selected.

          #37246
          Member
          Xecure
            Helpful
            Up
            0
            ::

            I fixed the name problem. I had to redo icewm original script, so it is not limited by words. It may not be the best, but it’s ok.
            https://pastebin.com/UtqWrFga
            Also, seeing that the Workspace name and workspace number may have the users asking “what is going on”, I have decided to display this information instead (even if it really saves the number instead of the name), so users may see something they understand.
            For window class names with many dots (wallpaper.py.Wallpaper.py), I have change the script a bit to fix displaying the name (it will work anyway, no matter the name that comes up), but it still has problems if the name and class are not the same.

            There is a bug with the list selection which doesn’t let you select things which are “far behind” the windows, and I haven’t been able to figure it out. Maybe PPC can figure this one. Also, when selecting a minimized, it will select the window with the highest position (last focused).

            Workspaces can be named with names, not just numbers, so I think the user should understand that the program is just going to open it in the workspace it came from if selected.

            That was our original idea, but now that I remade the original icewm team’s script, it was easier to get the name from there. So now we wont have to worry about the user saying that they think the workspace is wrong.

            Once we get the other program to create workspaces working, then this feature will make more sense when people name their workspace.

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

            #37249
            Moderator
            Brian Masinick
              Helpful
              Up
              0
              ::

              Great work! Not only is this collective effort creating additional tools that combine careful, light use of resources, they are also uncovering defects that may be “minor” in the overall scope of the tools, yet potentially significant when it comes to correctly identifying resource names and values.

              This has taken both effort and technical expertise, so between all of you, it has been a job very well done!

              Thanks again!

              Brian

              --
              Brian Masinick

              #100027
              Member
              luke22
                Helpful
                Up
                0
                ::

                I love this script. To note – I found that the one linked in #37228 works, but the latest in #37246 didn’t have the help aspects as far as I could tell.
                I used to use wmctrl and xdotool with various options and keyboard shortcuts to do this, but was able to use it with a browser window with a particular string of text in the address bar. i.e. I only used it for a particular website. Shortcut keys toggled this on or off. Unfortunately I’ve lost the code and don’t have the brain power any more to reconstruct, so finding this forum thread is a gift.

                Is there anyway of simply adapting this script to remember a particular website?

                Also I thought this script might have been included in antix22.

                #100058
                Member
                luke22
                  Helpful
                  Up
                  0
                  ::

                  I wrote too soon.
                  The script seems to run fine, but I don’t know where it stores the size, position info. EDIT- found winoptions in ~/.icewm and see settings added there.

                  I tried it on roxterm , leafpad and browser, but when re-opening any of these they resort to their default size and position and not what I thought was saved.
                  I must be doing something wrong. I’ve looked on icewm website and in the manual, but can’t see why winoptions is not overriding defaults for these saved settings.
                  How does winoptions apply saved settings on reopening these windows?
                  Please advise.

                  • This reply was modified 2 months, 2 weeks ago by luke22.
                  • This reply was modified 2 months, 2 weeks ago by luke22.
                  #100122
                  Member
                  luke22
                    Helpful
                    Up
                    0
                    ::

                    I know I’m talking to myself here, but it helps me come to terms with failure.

                    I’ve explored iceWM documents and options along with icesh for resetting winoptions. I have tried different layers and workspaces. I have explored on google as well as this forum for help.
                    Bottom line it only half works.
                    The winoptions file in ~/.icewm gets updated ok. I’m refreshing desktop via restart session from menu logout, or “killall -HUP icewm” or “icesh winoptions”.

                    I used a test case of the leafpad app. I moved it approximately central and resized much smaller manually. Ran the script from this thread. The winoptions file gets updated with geometry ok. Carrying out one of the above refreshes, the window size of leafpad is recognised, but the position is not. It always opens in a default position, normally bottom right corner. i.e. 50% success/failure.

                    I suspect there is a way to launch leafpad using the saved winoptions geometry but can’t find out how.

                    • This reply was modified 2 months, 2 weeks ago by luke22.
                    #100125
                    Member
                    Robin
                      Helpful
                      Up
                      1
                      ::

                      Just for info: I noticed similar issues after applying “icesh restart” command; While the window positions are kept properly for me, the workspace count is always reset to 2, even when it was set to another value before by e.g. icesh workspaces 4. Not sure what to think about all this. Moreover it shuffles arbitrarily all the open windows in taskbar, so you have some trouble to find e.g. the proper terminal or a file opened in leafpad which was in another position before, in case you have more of them opened and the names are shown abbreviated in taskbar, you see mostly the icons only. Obviously icewm doesn’t work that reliable when it’s about details, while running absolutely stable in general.

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

                      #100196
                      Moderator
                      BobC
                        Helpful
                        Up
                        0
                        ::

                        I recall messing with this, but don’t remember using it for leafpad.

                        You could run leafpad, and then analyze its window to look at all its attributes, and see if there is some attribute not being set correctly by the script.

                        Perhaps something has changed since the script was written.

                        I also wish restarting IceWM would not rearrange the taskbar, but its not a critical issue to me, for as often as I restart it.

                        #100197
                        Member
                        Xunzi_23
                          Helpful
                          Up
                          0
                          ::

                          Hi Robin,
                          ICEWM works as it should, it applies the preferences each start or restart.
                          The ICE shell command does not change prefs permanently so applies only until restart.

                          Maybe useful for new users so detailed.
                          Open /home/yourusername/.icewm/preferences in geany or editor of choice

                          Search for
                          # Limit number of taskbar workspaces
                          #TaskBarWorkspacesLimit=””
                          Make sure as above, i.e. no limit set.

                          Then
                          # WORKSPACES NAMES format as below, you can use name like docs mail etc on bigger screens.
                          WorkspaceNames=” 1 “, ” 2 “, ” 3 “, ” 4 ” , ” 5 ”

                          Save, do icewm –restart or logout then login again, enjoy.

                          #100199
                          Member
                          Xunzi_23
                            Helpful
                            Up
                            0
                            ::

                            luke 22
                            you are not just talking to yourself, interesting.
                            Re. starting applications in a particular size and position. There is quite a bit of info
                            in the depths of the forum, mostly easy to follow.

                            Some applications save own positional and size info or just seem to start at a random position
                            so frustrating. For LibreOffice prefixing command with –norestore which overrides the internal save
                            of size and position works. That is minus minus norestore in case unclear:-)

                            xprop to get correct application window propertys and application wmctrl may be useful in the quest.

                            At present have Palemoon, Tor and Claws opening correctly. LO works too with start option applied.
                            sample of some icewm winoptions as below, use xprop to ensure things are correct.

                            Navigator.Tor Browser.workspace: 4
                            Navigator.Pale moon.geometry: 941×1173+0+0
                            Navigator.Pale moon.workspace: 1
                            claws-mail.Claws-mail.geometry: 941×1173+0+0
                            claws-mail.Claws-mail.workspace: 0

                            Please do publish progress, I selfishly spent my time on applications I use a lot.

                            • This reply was modified 2 months, 2 weeks ago by Xunzi_23.
                            • This reply was modified 2 months, 2 weeks ago by Xunzi_23.
                            #100207
                            Member
                            luke22
                              Helpful
                              Up
                              0
                              ::

                              @BobC @Robin Thanks for thoughts and input.
                              @Xunzi_23 Thanks for response.
                              I’ll keep trying. I have seen other posts in the forum using google search method. I’ll re-read these more closely.
                              @BobC if this is off topic and needs separate thread, please move or instruct me to start a new thread (or tell me to stop whining :)).

                              My specific need is to run a web browser (currently firefox-esr) larger than screen so I can use my whole screen for reading a book’s page’s contents (i.e. text on page fills screen and book edges and browser borders etc are off screen) on ‘archive dot org’. I’m an avid reader of all sorts of subjects and I use this site daily.
                              I achieve this manually, fairly quickly by Alt-space M, to move with mouse and arrow keys, and then Alt-space S, to resize with arrow keys (+shift), and the Alt-space M again to position so page contents just fill screen height. It can take some fine adjustments to get there, but then I read for about an hour, just page flipping with no other interaction.
                              I’ve been trying with xdotool and wmctrl using the window geometry acquired as above with very limited success. Note the geometry is also captured in the winoptions file by the script in this thread.
                              When I ran an xfce distro this worked flawlessly with wmctrl.
                              In icewm (which I really like for keyboard shorcuts and speed) I get limited success. Sometimes I get the size, but getting the window edges off screen is a challenge. Sometimes I can’t manually move a window beyond screen edge. I am not fully understanding what restricts and frees window movement in icewm yet. Something to do with how I last resized the window I think.

                              The following is from my winoptions file.

                              Navigator.Firefox-esrgeometry: 1338×1257+0+-363
                              Navigator.Firefox-esrlayer: Normal
                              rox.Roxgeometry: 600×184+299+178
                              rox.Roxlayer: Normal
                              rox.Roxworkspace: 0
                              roxterm.Roxtermgeometry: 557×351+299+82
                              roxterm.Roxtermlayer: Normal
                              roxterm.Roxtermworkspace: 0
                              leafpad.Leafpadgeometry: 551×268+309+279
                              leafpad.Leafpadlayer: Normal
                              leafpad.Leafpadworkspace: 0

                              Apart from Firefox, each of the above apps open with the correct size of window but located to a corner of the screen. Firefox-esr limits itself to screen borders, mostly.
                              I am motivated to keep experimenting now, having got so far. I suppose I could explore fluxbox and jwm, but not yet as icewm is my favourite.

                              PS I am loving Antix, having used Puppy, Fatdog and KLV_Airedale recently. Antix starts from cold within 15 seconds compared to nearly 60 seconds for the others. My setup is a 10 year old Toshiba chromebook with lots of battery life left. ChoromeOS went some time ago, followed by GalliumOS.

                              #100213
                              Member
                              Xunzi_23
                                Helpful
                                Up
                                0
                                ::

                                Hi luke* The problem is not lack of flexibility with ICEWM, it is very configurable.
                                There are so many options, not easy to get understanding of why things happen the way
                                they do and not the way we want them to.

                                What did you set in the browser, session restore must be off or a fight between ICE
                                shell settings and the browser may occur.

                                You might in your case be able to use session restore to your advantage, try just
                                shutting down without closing the browser. It should open at previous position and size
                                as well as opening the book for you.

                                https://support.mozilla.org/en-US/kb/restore-previous-session gives background.

                                #100214
                                Member
                                Xunzi_23
                                  Helpful
                                  Up
                                  0
                                  ::

                                  luke, Just woke up to the fact the winoptions are incorrect. You were asking iceshell to
                                  open and position for example Navigator.Firefox-esrgeometry the separator is missing in all
                                  the commands.

                                  Please try

                                  Navigator.Firefox-esr.geometry: 1338×1257+0+-363
                                  Navigator.Firefox-esr.layer: Normal
                                  rox.Rox.geometry: 600×184+299+178
                                  rox.Rox.layer: Normal
                                  rox.Rox.workspace: 0
                                  roxterm.Roxterm.geometry: 557×351+299+82
                                  roxterm.Roxterm.layer: Normal
                                  roxterm.Roxterm.workspace: 0
                                  leafpad.Leafpad.geometry: 551×268+309+279
                                  leafpad.Leafpad.layer: Normal
                                  leafpad.Leafpad.workspace: 0
                                Viewing 15 posts - 46 through 60 (of 76 total)
                                • You must be logged in to reply to this topic.