Light weight screenshot and annotate combo

Forum Forums antiX-development Graphics Light weight screenshot and annotate combo

  • This topic has 315 replies, 10 voices, and was last updated Aug 23-5:44 pm by BobC.
Viewing 15 posts - 226 through 240 (of 315 total)
  • Author
    Posts
  • #61559
    Member
    Xecure
      Helpful
      Up
      0
      ::

      You could save the whole command inside a variable and then run the variable with eval

      [...]
      if [ "$ADDNOTE" = "true" ] && [ ! -z "$NOTEFORMAT" ] && [ ! -z "$NOTETEXT" ]; then
        SCROT_COMMAND="scrot $PARMSTR --note \"$NOTEFORMAT -t '$NOTETEXT'\" \"$WORKFILE\""
        echo "$SCROT_COMMAND" # just to see what the command looks like
        eval "$SCROT_COMMAND"
      [...]

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

      #61569
      Moderator
      Brian Masinick
        Helpful
        Up
        0
        ::

        @BobC: I can tell you one thing about quoted strings: when a string is operated upon from within a script, it sometimes has to be repeated multiple times. I’m not sure what the exact scenario is here, but it’s not unusual to either have to quote or backslash escape (\) a pattern 3, 4, or even 6 times, depending on the context in which it is used.

        Could this possibly have anything to do with the issue encountered?

        EDIT: I see that Xecure presented another viable solution. I’m looking forward to seeing what you ultimately came up with; I’ll check it out later.
        Thanks for the effort you and others have put into this tool.

        • This reply was modified 1 year, 11 months ago by Brian Masinick.

        --
        Brian Masinick

        #61586
        Moderator
        BobC
          Helpful
          Up
          0
          ::

          Yes, I will try Xecure’s solution. I’ve made another 50 tries at least and the more I work with it, the more difficult it is getting to make any sense out of why things work or don’t. I’m very disappointed in my inability to learn it, but the rules are just too complex, and I’m almost trying things at random because the errors are so irrational, and there is no way to find out exactly what is happening.

          I’ve spent almost 3 months at this. I am old enough to know better than to try to add to a design in a language I don’t know for features I am not familiar with.

          Another discouraging event… After getting all that help text formatted, I am able to get the help screen to pop up, but it doesn’t display the text that is in the text field. I think the real problem is that I don’t understand what the code does correctly, so can’t even change it.

          #61588
          Moderator
          BobC
            Helpful
            Up
            0
            ::

            Xecure’s answer worked without any problem. I guess I just don’t know the language. Working from examples does no good if the examples are not examples of “best practices” that can be copied and tweaked, and as a result I was trying to invent wheels.

            Xecure, Can you take a look, please? The help doesn’t work. The problem is probably something simple related to me not knowing how it is supposed to work. I’ve made many tries, and finally just simplified to to where there is no choice of help screens to display since I wasn’t able to get a passed parameter to work, but it still doesn’t display the the text from the field. Sorry, but I’m not very good with YAD, again, and I don’t understand why the field doesn’t display on the screen. Again, I’m disappointed that I couldn’t figure it out.

            There have been a number of changes to the main screen, and the help text will need to be changed to match it.

            PS: Many thanks to Xecure for solving the program call. I had spent at least 10 hours flailing away at it trying in vain…

            https://i.imgur.com/HxXPc3l.jpgScreenshot with note after annotation

            • This reply was modified 1 year, 11 months ago by BobC.
            • This reply was modified 1 year, 11 months ago by BobC.
            • This reply was modified 1 year, 11 months ago by BobC.
            #61595
            Member
            Xecure
              Helpful
              Up
              0
              ::

              PS: Many thanks to Xecure for solving the program call. I had spent at least 10 hours flailing away at it trying in vain…

              It also took me a long time to learn how to run commands stored in variables. The my-offline-repo script took a very long time to make because I was learning bash as I went.

              I will have a look at the Help window of your script in a bit and send you a PM. I will first test if there is a problem in the 19.4 i386 grub menus.

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

              #61600
              Member
              ile
                Helpful
                Up
                0
                ::

                Hello BobC and everyone
                gtklp v. 1.3.1 is unable to pass filename through the command-line.
                Neither can it accept a job-name or title.
                The RADIOBUTTON_PRINT with just simply “gtklp” command , without the file_name after, will get to the same place as the current full command. The button label can be adjusted to “Save and Open Printer Dialog”. That leaves the user in a position to “ADD” the file-name to the file list in gtklp. That is the current behavior of the Print button in Actions Dialog.

                An alternate is to label the Print button as
                “Save and Send to printing queue.”
                The print queue of gtklpq can be shown populating with the job; the job will have no identity label or title. Seeing the name appear in the gtklpq dialog window can provide a sign that the file has been added to print queue.

                
                    if [ "$RADIOBUTTON_PRINT" = "true" ] ; then
                      echo Print was selected
                      if which "gtklp" >/dev/null; then
                gtklpq &
                sleep 1s
                      lp -H hold -- "$SAVEDIR"/"$file_name"."$file_ext" & sleep 1s 
                      else

                Alternate to that is to encourage printing control through a browser.

                The Actions could be separated categories of default viewer, viewers without print, and viewers that have printing capacity(?) And then have no “Save and Print” button.

                Attachments:
                #61604
                Moderator
                Brian Masinick
                  Helpful
                  Up
                  0
                  ::

                  I tried out the latest script and it works nicely. The documentation (should anyone actually READ it, is clear and understandable; nice job!
                  I took a couple of full screen shots and they worked nicely.

                  --
                  Brian Masinick

                  #61607
                  Moderator
                  BobC
                    Helpful
                    Up
                    0
                    ::

                    Ok, lucky for me, Xecure knows how to work YAD. I thought the error was in the script, but it was the text itself. So the help is fixed. I also improved and added some text, and added the printer correction from Ile above. I also added an option to turn on or off the Window border in Window mode in case its causing problems for anyone, and added to ability to include the mouse cursor to the pic if in Window mode. I also figured out how to default checkboxes, and made the changes for that.

                    New, improved code is added to this post.

                    The new options and text can be seen on the screen prints below.

                    PS: Thanks Brian and Ile for testing… And Thanks in advance to anyone else for trying the program and helping identify any problems while the program is being tested…

                    • This reply was modified 1 year, 11 months ago by BobC.
                    #61624
                    Moderator
                    Brian Masinick
                      Helpful
                      Up
                      0
                      ::

                      Very cool! I read the help, saved a screenshot and added some simple annotations with a clumsy red mark and red text markup.
                      Is there anything else needed? I think it does most things I would think of doing. (The “clumsy” part was ME; the tool is great!) 🙂

                      • This reply was modified 1 year, 11 months ago by Brian Masinick.

                      --
                      Brian Masinick

                      #61626
                      Member
                      ile
                        Helpful
                        Up
                        0
                        ::

                        Hello BobC and everyone
                        A — note options for font, size, color, location, would be elaborate.
                        Font default can be chosen for internationalization support(?)
                        When I was at first just printing numbers , I picked a font that I like the appearance of the numerals. When expanded to text entry it needs to be a good international font.
                        The location upper left seems fairly fixed; for a rectangle, the only spot that can be known is the upper left corner. even non left to right languages, i will guess, will need upper left.
                        color and brilliance would be nice to control. default color gold -ish can be seen on most background.
                        A font at size72 with a brilliance of 16 out of 255 can look like a dim watermark sort of appearance.(?) This makes notes personal at a user demand Screenshot level when it seems like the note option is well suited to cron jobs.
                        Absent the ability to change the note settings, (always available in the script. antiX afterall is configurable.) the note text presents a no-nonsense project or machine mark or personalized text.
                        sum
                        location fixed, font fixed, pick a lucky color and presume it fixed,
                        that leaves font size and brilliance maybe we can handle those two variables(?)
                        When introducing s with variables in antixscreenshotsterbp I considered putting the s as part of the variable name. It was not necessary, because s existed in all options, so the variable is placed after s.
                        I might trial introducing notes as a variable, like done with s, but put the “–note” option inside the variable. then add note variables for font size and for brilliance, both are number fields. I wait to do the trial; my Desktop is off during two days on the backup generator since storm. When power is restored (promised in six hours) I will write scripts and check out all of BobC’s advances. I was started on doing that when the power went off two days ago, the Desktop blanked., shrug.

                        #61627
                        Anonymous
                          Helpful
                          Up
                          0
                          ::

                          the only spot that can be known is the upper left corner

                          That’s a good point. The script could
                          .

                          xrandr | grep -w connected | cut -d' ' -f 3
                          or
                          xdpyinfo | awk '/dimensions/ {print $2}'
                          but that doesn’t consider presence, or size, of ROX panel or window manager toolbar.

                          #61628
                          Moderator
                          BobC
                            Helpful
                            Up
                            0
                            ::

                            Yes, top left with an allowance for window title bar was how I chose where to set the default. And, yes Skidoo, your efforts and inputs are ALWAYS appreciated 🙂

                            Ok, Ile, you didn’t like the default font, but you didn’t say what a font that would be good for everyone?

                            #61630
                            Member
                            ile
                              Helpful
                              Up
                              0
                              ::

                              Hello BobC
                              I did not speak of Your script default font.
                              I did not, Let those who know name the best font; the antiX system default font at release seems a candidate? or The same font that gtkDialog is using?

                              (Powered just)

                              #61631
                              Anonymous
                                Helpful
                                Up
                                0
                                ::

                                Working from examples does no good if the examples are not examples of “best practices”

                                unsure how narrowly I should quote here
                                .

                                Working from examples does no good if the examples are not examples of “best practices” that can be copied and tweaked

                                In some programming domains, BestPractices nowadays too often parrots//follows Cargo_cult_programming

                                “code search” websites enable you to see various ways others have approached a task (real world usage examples, vs text cookbook examples)
                                For example: https://searchcode.com/ or via G00gle “mysearchterm site: github.com”

                                stackexchange, serverfault, askubuntu -ish Q & A sites enable you to see various approaches along with a measure of consensus (or lack thereof) for howto approach a given task

                                a couple more bookmarks candidates:
                                https://www.commandlinefu.com
                                http://shelldorado.com/links/index.html#archives

                                tldr and bropages and https://www.mankier.com strive to present examples supplemental to manpages

                                v——– check out this interactive site :
                                https://explainshell.com/

                                #61632
                                Moderator
                                BobC
                                  Helpful
                                  Up
                                  0
                                  ::

                                  Skidoo, I’ve opened a separate tab for your post to remind myself to come back and follow the links…

                                  If anyone could tell me what the default font is, I would be happy to try that. I truly am looking for default value that won’t leave people staring at an undecipherable screen or a bunch of error messages. Give the new code a try and put in YOUR font, etc. It should remember your settings for you, next time, I hope. Here is a pic of the revised prompt screen.

                                  PS: I’ll have to edit the help screen, too. And Skidoo, Yes I should have spent a few weeks trying to learn the language. I get too buried in problems to figure out how the swamp really should work. I made and make too many assumptions, and am just lucky to have friend that are kind enough to give me a tow when I get mired. Thanks All!

                                  • This reply was modified 1 year, 11 months ago by BobC.
                                Viewing 15 posts - 226 through 240 (of 315 total)
                                • You must be logged in to reply to this topic.