antiX-23 – based on Debian 12 Bookworm – ideas

Forum Forums antiX-development Development antiX-23 – based on Debian 12 Bookworm – ideas

  • This topic has 200 replies, 27 voices, and was last updated May 11-6:42 pm by calciumsodium.
Viewing 15 posts - 121 through 135 (of 201 total)
  • Author
    Posts
  • #99835
    Member
    marcelocripe
      Helpful
      Up
      0
      ::

      Robin, I’m just dropping by to thank you for yet another great program.

      I’m working on @techore’s “conky-toggle.sh” program with many difficulties, due to the various fluctuations in electricity caused by the electricity utility. Since the privatizations took place in electric energy in Brazil, what we have in practice are the increasingly expensive bills to pay and the quality of the service provided increasingly worse. The next privatization will be of water and sewage throughout Brazil, the law having already been approved by the previous government. Does anyone want to “lease” the provision of these essential services for 30 years or more and profit a lot from the monopoly of this service?

      As soon as possible, I will help you with testing your new program.

      Note: Once the name of the program is defined in English by native speakers of the language, we cannot forget to create the .desktop file with the translation into other languages.

      Thanks.

      – – – – –

      Robin, eu estou passando aqui só para te agradecer por mais este excelente programa.

      Eu estou trabalhando no programa do “conky-toggle.sh” do @techore com muitas dificuldades, devido as diversas oscilações de energia elétrica causadas pela concessionária de energia elétrica. Desde que as privatizações ocorreram na energia elétrica do Brasil, o que temos na prática são as contas para pagar cada vez mais caras e a qualidade do serviço prestado cada vez pior. A próxima privatização será da água e do esgoto em todo o Brasil, a lei já foi aprovada pelo governo anterior. Alguém quer “alugar” por 30 anos ou mais a prestação destes serviços essenciais e lucrar muito com o monopólio deste serviço?

      Assim que for possível, eu irei te ajudar com os testes no seu novo programa.

      Observação: Assim que o nome do programa for definido em idioma Inglês pelos nativos do idioma, não podemos nos esquecer de criar o arquivo .desktop com a tradução para os outros idiomas.

      Obrigado.

      #99852
      Member
      PPC
        Helpful
        Up
        0
        ::

        @anticapitalista – I know folks here (mostly me) keep suggesting additions to antiX. but the script to toggle touch-pads on/off can be handy – I edited the suggested on, that used system notifications (and so, provided no output, unless users install Dunst or similar software) and adapted it to use yad “notifications” instead, that always pop up on the lower right corner of the screen. Marcelo is already working on a .desktop for it, and even without localization it would be a nice addition to the Control Center (right below the Mouse related options).
        The script is over at https://www.antixforum.com/forums/topic/how-to-disable-laptop-trackpad-touchpad/page/2/#post-99842 and a few posts above it is the initial .desktop file, suggested by MarceloCripe (I think he is still perfecting it). With the desktop file and the icons displayed in the yad “notifications”, localization is still desired, although it’s not that important…

        • This reply was modified 2 months, 3 weeks ago by PPC.
        #99908
        Member
        marcelocripe
          Helpful
          Up
          0
          ::

          Robin, now we have one more successful test.
          The “pt_BR” translation also worked perfectly.
          Thank you very much for this excellent program.

          – – – – –

          Robin, agora nós temos mais um teste bem-sucedido.
          A tradução “pt_BR” também funcionou perfeitamente.
          Muito obrigado por mais este excelente programa.

          Attachments:
          #100065
          Member
          Robin
            Helpful
            Up
            0
            ::

            @marcelo: Great to read the translation works for you also. Will upload the script to gitlab and the translations to transifex tomorrow.

            would also be nice to have an optional tool to alter the convention – allow either names or numbers to describe each workspace.

            @Brian : I have checked out your great proposal. Unfortunately IceWM shows a completely inconsistent behaviour when editing these entries, so it is probably not possible to script it that way. What I found out is:
            1.) Originally there are two entries, the line reads:
            WorkspaceNames=" 1 ", " 2 "

            2.) You can change and add names to the file, as you pointed out already, e.g.:
            WorkspaceNames=" Test1 ", " Test2 " , " Test3 " , " Test4 "
            Result: Nothing happens. So you need to restart IceWM session.

            3.) After IceWM session restart there come up as many workspaces as you have named.
            But the two desktops named before already keep their numbers 1 and 2 instead of the new names, while the additional new workspaces (which would be e.g. 3 and 4 normally) get the proper names you’ve set in the file, while in the file the new names are still present for the first two workspaces still.

            From a mess like that you can’t write a script, honestly.

            But of course I have not given up trying to acieve this. So here’s a first result. Please be aware it works for IceWM only by now. Since the script code is a bit larger than before when only handling the count, I’ll not pin up the code as a fullquote into this posting, but post it as an attachment file.

            antiX workspaces names changer

            It will only display the names of currently visible desktops always, not additional names which might be preset in the preferences file already before. To access these, switch the number of workspaces before, so those workspaces are visible.

            There is involved now a handy tool, called “icesh”, which I found to be present on antiX already, allowing to overcome the mess described above.

            Finally, there is a time critical task in this script. In case you notice the number of workspaces is set back to 2 instead the number you actually have set, please try to modify the value in line 79. Maybe it needs to get a bit more time to settle after restarting iceWM on weak machines, so please report which value should be set here. Default is 0.5 (When using 0.3 instead, I saw it fail occasionally. So on other machines this might easily need a higher value)

            To avoid confusion: Please be aware icewm counts the workspaces starting at zero, while in human readable form it is common to start counting with one. So the workspace numbers displayed in this GUI intentionally don’t match the workspace numbers as seen on console when calling e.g. the icesh directly with one of the multiple commands it provides.

            Script is prepared for translation already.
            Attached archive contains the .pot translation resource file and a test translation to German language in .po and .mp format, along with the script file itself.

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

            #100071
            Member
            PPC
              Helpful
              Up
              1
              ::

              Nice script, as always, Robin… It should be merged with the one that selects the number of work spaces, if possible…

              Suggestion – for some reason, instead of going for the current names of the workspaces (and allow me to edit them, it choose:

              área de trabalho #0: área de trabalho #0: 1
              as default for the first workspace (and the same, but numbered “2” in the end).
              (in English: workspace #0: workspace #0: 1), instead of simple “1” and “2”…

              The names I choose get rested every time I launch the script (to the very long names I describe above)… Is that by design?
              P.

              Edit: the test was performed in antiX 19, 64bits…

              • This reply was modified 2 months, 2 weeks ago by PPC.
              #100079
              Member
              Robin
                Helpful
                Up
                0
                ::

                The names I choose get rested every time I launch the script (to the very long names I describe above)… Is that by design?

                PPC, that’s a bug, not a feature 🙂 Keep in mind this was a first sketch only.

                Noticed I have goofed some of the sed regx. You can try again after removing one dot in the sed regex in line 75:

                75 new_name="$(sed -n 's/Workspace_Name'$i'="\(.*\)"/\1/p' <<<"$new_names")"

                Same issue in line 48 (there has to be only one dot instead of two within the Braces between the “x60”)
                48 <default>"'$(icesh listWorkspaces | grep -F "#${i}" | sed "s/..*: \x60\(.*\)\x60$/\1/")'"</default>

                Should work then. Sorry for the inconvenience!

                It should be merged with the one that selects the number of work spaces, if possible…

                Yes, you are perfecly right. I’m on it already. It’ll come soon.

                Biggest drawback is this icesh tool works only for icewm, other than xdotool and wmctrl. But with the latter two it seems not to be possible to make the name changes work properly. So we’ll have to research for some workaround to manage the other window managers.

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

                #100081
                Member
                PPC
                  Helpful
                  Up
                  0
                  ::

                  Should work then

                  No problem, I sed is powerful, but a pain to work with…
                  I performed the changes – it got a bit better: now it only says “workspace #0: 1”, etc, in each field (the text “workspace is no longer repeated, at least, but it appears once, followed by “#”, the real workspace id (that begins in 0, for the first one, etc), “:” and the chosen name of the workspace between single quotes…
                  I hope this information helps to debug the problem, Robin…
                  Very nice idea, thanks for the hard work!

                  P.

                  Edit: trying to help: on the line that lists the work space names, if I run this command on the terminal, I get ONLY the workspace’s chosen names:

                  • This reply was modified 2 months, 2 weeks ago by PPC.
                  • This reply was modified 2 months, 2 weeks ago by PPC.
                  • This reply was modified 2 months, 2 weeks ago by PPC.
                  #100088
                  Member
                  Robin
                    Helpful
                    Up
                    0
                    ::

                    on the line that lists the work space names, if I run this command on the terminal

                    check your proposed line with a ˋ within one of the workspace names, e.g. Neˋt
                    While sed catches this still properly, cut fails on it:

                    $ icesh listWorkspaces | cut -f 2 -d “\ˋ” | cut -f 1 -d “‘”
                    Main
                    Test
                    Ne

                    $ icesh listWorkspaces | grep -F “#0” | sed “s/..*: \x60\(.*\)\x60$/\1/”
                    Main
                    $ icesh listWorkspaces | grep -F “#1” | sed “s/..*: \x60\(.*\)\x60$/\1/”
                    Test
                    $ icesh listWorkspaces | grep -F “#2” | sed “s/..*: \x60\(.*\)\x60$/\1/”
                    Neˋt

                    Btw, You have to think around corners, when evaluating the lines within the GTKdialog script, which actually gets written at runtime into a temp file. Hint: Check the /dev/shm folder for the file while the script is running (that’s very similar to how aCSTV is managed).

                    … the test was performed in antiX 19, 64bits…

                    So you are running it on antiX 19. This easily can be the reason why it is failing for you. Please check occasionally when you are on antiX 23. I’m running it on antiX 23 with 6.1.10 kernel, and for me it works fine with all long titles, blanks and special characters in workspace names now after the fix of the two dots.

                    And please, let me know the precise strings you have tested with, so I can try to reproduce it. Maybe there are some special characters not recognised properly by some tool, we have seen a similar issue in leafpad last year as you might remember (and same again with xdotool search –name failing on foreign language characters right now).

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

                    #100089
                    Moderator
                    Brian Masinick
                      Helpful
                      Up
                      0
                      ::

                      Hi Robin, regarding your comments in post #100065, you are absolutely right.
                      When I change from
                      WorkspaceNames=" 1 ", " 2 "
                      to
                      WorkspaceNames=" Web ", " Mail ", " Term ", " Edit "
                      absolutely NOTHING changes until I restart IceWM, in which the WorkspaceNames initially look like:
                      WorkspaceNames=" 1 ", " 2 ", " Term ", " Edit "
                      until the next time I use IceWM. I cannot recall at the moment whether a logout and login would suffice; a reboot certainly does suffice, so that’s typically what I do. It’s worked that way for as long as I can remember, to the point that I don’t quibble about it, I just understand the behavior.

                      I was also looking into sed, because some editors or script languages that use separators allow you to change the separator.
                      When I looked at the sed man page I did not see any provision for this, but if anyone wants to experiment, who knows, maybe the separator can change based on the character specified after the s. It might NOT work with sed, since it is a pretty small, light, simple tool.

                      I did a search, typing “sed separator character” into the Google search engine and the very first line that came back matched my “old” recognition of the behavior of similar tools:

                      “Basically, sed takes whatever follows the “s” as the separator.”
                      https://backreference.org/2010/02/20/using-different-delimiters-in-sed/index.html
                      https://coderwall.com/p/khdkuw/delimiters-in-sed-substitution

                      So my conclusion is that the GNU implementation of sed does indeed allow a different separator than /; for example, the coderwall reference says that
                      echo foo | sed s,foo,bar,
                      works.

                      --
                      Brian Masinick

                      #100090
                      Moderator
                      Brian Masinick
                        Helpful
                        Up
                        0
                        ::

                        As far as the handy script to alter numbers and/or names, I’ll take a look at it later.

                        --
                        Brian Masinick

                        #100115
                        Member
                        PPC
                          Helpful
                          Up
                          0
                          ::

                          I think I won’t have much free time today, but here goes one idea- the IceWM Personal menu manager GUI script just got rewritten to a lot more easier to use and feature rich (it’s basically a fork of IceWM’s Toolbar Icon Manager, but working on the ‘personal’ config file, instead of on the ‘toolbar’ file (that’s why it does not work for fluxbox and JWM- I’ll have to fix that on a future version, if I can, getting the name of the current window manager, and writing to the personal menu in the correct syntax that each window manager uses- that will take a bit of research and a reasonable amount of scripting)…
                          It’s currently up for localization on Transifex.

                          My Suggestion – since a tool is only useful when it’s easy to access, I propose that this script should be the first entry on IceWM’s Personal menu (so users have a quick way to manage the menu from the menu itself), followed by DO’s introduction video an any other useful links…

                          P.

                          #100116
                          Member
                          PPC
                            Helpful
                            Up
                            0
                            ::

                            Please check occasionally when you are on antiX 23

                            I forgot to answer this- I don’t have my antiX23a1 live stick with me but… even with applying the fix in those 2 lines, on antiX 22, 64bits, runit, full, I still get the names of the workspaces as the localized version of “workspace”, a “#”, followed by the number of the workspace, starting with 0 as he first one, a “:” then, between single quoation marks (note the first is different from the last), I get the chosen name for the workspace… – same as in antiX 19.
                            Can it be some change in a new version of sed that antiX23a1 uses??… Some problem related to encoding, since my systems are all in pt-pt?
                            If I have any new ideas, I’ll report them here, Robin.

                            Edit: after some 10 minutes tweaking it, the script works perfectly under my antiX 22. I just edited line 48… Please see if my changes make sense to you, Robin- I simple cut everything up to the “:” and then the first and last characters, that are the offending and different single quotation marks in the start and the end of the name of the workspaces…

                            Edit2: I just noticed my additions to line make your pipe to the sed irrelevant – the script works just as well here if I remote it- this tells me that code was not working at all here on my system, even if I remove the duplicated dot between the 60’s… (Wow- this lines sound like some techo babble out of a Star trek episode…)

                            P.

                            • This reply was modified 2 months, 2 weeks ago by PPC.
                            • This reply was modified 2 months, 2 weeks ago by PPC.
                            #100121
                            Member
                            Robin
                              Helpful
                              Up
                              0
                              ::

                              Yes, you are right about sed taking any character as separator, this is wellknown and documented already in the original sed docs from 1994 by Bruce Barnett from General Electric. (https://www.grymoire.com/Unix/Sed.html#toc-uh-27). But that won’t get you out of this muddle. It only moves the issue to another character. The true solution is to mask the separator character (whatever character you decide to use as separator) by a backslash. Then it will be treated by sed as a default character instead of a separator. Yes it is that simple, really. You can use bash parametric expansion (parameter substitution as described in man bash around line 1108ff ) to apply the replacement while using a runtime generated string within a variable as a pattern: pattern=”${pattern/\//\\\/}”. To understand this picket fence, keep in mind you need to mask backslashes in bash to use them as character instead of escape sequence (see man bash, section about quoting and escape sequences, lines 412ff), and within this expansion you have to mask the default slash additionally, since it is used as separator by bash here also. For both masks bash expects an additional backslash. Write “\\” instead of “\” and “\/” instead of “/”, in all occurrences within the curly braces, except for the separators themselves. Main structure of the expansion is pattern=”${pattern/original/replacement}”, with “pattern” being the variable name. So if you want to replace all “/” in the variable, you have to write “\/” instead of “original”. And in order to replace it by “\/” to make sed happy, you need to write firstly “\/” for “/” wherein the “\” again needs to be masked by another masked backslash “\\”, put together to “\\\/” for the replacement. When building up finally the complete expansion expression from these parts, you’ll get: “var=${var” + “/” (Separator) + “\/” (Original) + “/” (Separator) + “\\\/” (Replacement) + “}” which makes aggregated: pattern=”${pattern/\//\\\/}” when put together. OK, that’s some more than four corners to think around 🙂

                              But it works fine and reliable in all scripts, I make use of this for a long time already. Try yourself:

                              $ foo="path/here"
                              $ echo "/some/path/here" | sed -n "s/$foo/bar/p"
                              sed: -e expression #1, char 13: unknown option to s'
                              $ echo "/some/path/here" | sed -n "s/${foo/\//\\\/}/bar/p"
                              /some/bar

                              same with comma:

                              $ foo="path, here"
                              echo "..., we have a path, here." | sed -n "s,$foo,bar,p"
                              sed: -e expression #1, char 14: unknown option to s'
                              
                              $ echo "..., we have a path, here." | sed -n "s,${foo/,/\\,},bar,p"
                              ..., we have a bar.

                              You can also use the backslash masking directly in sed instead using a variable for the pattern, in case it’s about a fixed pattern and not a pattern constructed at runtime:

                              $ echo "..., we have a path, here." | sed -n 's,path\, here,bar,p'
                              ..., we have a bar.

                              So, as said, the true solution is not to replace the separator in sed command (as suggested commonly all over the internet), but masking the very character used as separator within a pattern, either directly or by bash expansion applied on a variable (or using any other method before feeding the pattern to sed).

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

                              #100126
                              Member
                              PPC
                                Helpful
                                Up
                                0
                                ::

                                @Robin – my proposed solution for this proposed additional GUI script to rename workspaces to antiX23 avoids using sed in line 48 (also avoiding all it’s complexities) and it does make the script work on antiX 22 (untested on antiX 19, I’ll provide feedback on that later).
                                Was I the only person noticing this problem with Robin’s original script?

                                P.

                                #100129
                                Member
                                Robin
                                  Helpful
                                  Up
                                  0
                                  ::

                                  @PPC Please read carefully 100088. Have you checked your line with backquotes used in a workspace name? For me it fails, and no way to fix it, while sed can do it easily. And it’s not sed failing here:

                                  Turned out that two of the helper tools are a bit fastidious about what characters to accept or display: IceWM itself refuses to display simple slashes in workspace names on GUI, while they are properly set. (hey, that’s ridiculous! It can display them in Taskbar names, so what the heck…?). And then GTKdialog fails on simple arrows <> in strings to be preset in entry fields, since these are interpreted as tags of GTKdialog source language. You can’t put it into quotes, since then other characters within the string fails due to GTKdialog runs this on dash instead of bash. And you also can’t mask it, since then you can’t know afterwards whether a masking character was set deliberately by the user as part of his workspace name. So in the end single way is (yes, a really dirty workaround, I know!) to automatically replace the characters causing trouble. Finally the GTKdialog entry field “eats” leading blanks in preset entries, so spaces have to be replaced also. So the script will apply the following replacements:

                                  > to › (u....)
                                  < to ‹ (u....)
                                  / (u002f) and / (uff0f) to ⁄ (u2044)
                                  Blank (u0020) to Mid Space (u2005)

                                  Tested with all kinds of special characters meanwhile:

                                  combined script

                                  I do hope whatever characters a user enters are treated properly by the tools now. Please stress test all kinds of special and foreign characters on your system and report any issues.

                                  Now please check out the new combined script and perform all testing on antiX 23 only! If you find an issue, please let me know whether it happens on 6.1.10 kernel also. We can care for antiX 21/22, antiX 19 and 17 later.

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

                                Viewing 15 posts - 121 through 135 (of 201 total)
                                • You must be logged in to reply to this topic.