1. 10

    That’s really interesting. Anyone have an alternative solution for this that doesn’t require proprietary software?

    1. 2

      Yeah I’m interested too, there are not so much open source software out there with a decent OCR. I’m thinking about building something from tesseract ocr

    1. 4

      I’m working on my “modern”, “light” and “configurable” GPLv3 terminal MUA.

      It’s just a hobby project for now but I would like to get it out there as a serious alternative to mutt. No actual code has been published yet because I would like it to have all the features I want for an alpha release and I’m not there yet. My end-goal is to include python3 bindings to enable dynamic loading of user plugins!

      Screenshot of one of the two mail viewing interfaces. There other is modeled after mutt and looks more or less the same.

      You can follow my progress on my mastodon account. Discussions and questions welcome.

      1. 15

        Misleading title: Add-on developers, not core Kodi developers.

        1. 2

          Their discussion of why kernels need multiple mutable references and how this is interacts with linear types — how it requires a work around — was a highlight.

          The unsafe part of TakeCell is curious: https://github.com/helena-project/tock/blob/master/kernel/src/common/take_cell.rs#L52

          It seems like double access to a TakeCell would result in one thread/holder “doing nothing” (and having to retry?).

          1. 1

            It seems like double access to a TakeCell would result in one thread/holder “doing nothing” (and having to retry?).

            Yes, the map call will return an error so failure will be known. It is not explicitly stated but the authors clarified it on reddit.

          1. 4

            I’d like to apologize for the rude question, but why not just use the command line all the time?

            1. 3

              Two examples: navigating logs to look at a lot of commit diffs, and doing partial commits (add -p) to straighten out the history. Both a lot easier with a GUI like gitx or even an editor-based UI like magit.

              For basic add-commit-pull-rebase-push, though, sure.

              1. 2

                For git add -p, there’s a very nice TUI interface called crecord (adapted from mercurial) that you might like: https://github.com/andrewshadura/git-crecord

                1. 1

                  navigating logs to look at a lot of commit diffs

                  This has to be the only thing I haven’t mastered to do comfortably yet with cli. On emergencies I resort to gitk.

                  1. 1

                    I often use tig for this on the cli, but as I don’t know too many commands, I sometimes fall back to gitg.

              1. 2

                A python script to log work into a self-hosted JIRA instance.

                Final step remains - Integrate it into my workflow as a post-commit git-hook that asks the user (me :-) ) how much time to log into the JIRA task (using the issue key of the JIRA task from the commit description)

                1. 1

                  That’s nice. You could also log TODOs and ask the user if to update existing TODOs or add new ones, or even parse TODOs from the committed code.

                1. 5

                  I am writing an MUA with ncurses inspired by mutt. I wanted my first project in Rust to be a dive into the language. My goals for now are:

                  • separate the backend and UI as much as possible so that you’re not locked in the TUI
                  • a sane configuration UX (unlike mutt)
                  • use threads when appropriate

                  pipe dreams:

                  • should be extensible with plugins if there are any features that fit with the API
                  • should have as many features as mutt

                  The UI is pretty rudimentary so far; just an index and pager (not shown). ncurses is a pain to work with, I must say. I might look into the panel library since I think it has good platform support.

                  I’m still working on the library part, I have implemented mail backends as traits but have only Maildir for now. I believe when I finish the ‘check for new mails on a different thread’ part the library will only have mail composition left unimplemented as far as necessary features go. I wrote my own parsers with nom which I might publish separately later on.

                  I still haven’t made my repo public because It is not close to being finished, it’s a lot of work. I don’t think having an unfinished repo public is a good idea, what do you think? (I also use my emails for testing which I think should be replaced with something more public.)

                  1. 1

                    Nice project! I’d definitely like to take a look at your code base if you make it public :)

                    I don’t see why developing in the open would be problematic, especially if the software is to be eventually released as “open source” or free software. Though as you mentioned you should definitely remove your private emails before putting it out there.

                    1. 1

                      Thanks a lot! It will be GPLv3, but I’d like to release it when it’s ready for an alpha or beta version. For now there’s no basic functionality other than reading e-mails, and since I’m in the design process still I guess it’s not ready for co-operative developing. So publishing it will be only for read-only in-progress code.

                      1. 1

                        Glad to hear that you’ll GPLv3 it!

                        And you have a reasonable point about being in the design process. It’d be great if you could document your design decisions. We need more docs :) Good luck!

                  1. 1

                    Instead of manually (un)commenting it all the time, use something like git diff --cached | grep FIXME to search only the staged (to be commited) changes for FIXMEs.

                    EDIT: Sorry, this will only work as a pre-commit hook, my bad. To make this a pre-push hook, git fetch the remote and run the diff against the remote HEAD.

                    1. 1

                      To make this a pre-push hook, git fetch the remote and run the diff against the remote HEAD.

                      I think if you do that the alarm will go off if the remote HEAD fixes FIXMEs that still exist in your branch.

                      Better to diff against last(public() and ancestors(.)); in Git speak I think that would be origin/my_branch_name, which AFAICT you can obtain via origin/$(git rev-parse --abbrev-ref HEAD). Although that breaks if you are in a detached head state. Is there a more idiomatic way to do this?

                    1. 2

                      Very small nitpick: this only works if /bin/sh is bash (or something that supports $((...))). Works like a charm after telling it to run with bash.

                      I missed the original sct thread, and redshift felt heavy, so this little script + sct will be of great use to me. Thanks!

                      1. 4

                        Piling on the nitpick wagon, error messages should go to stderr rather than stdout:

                        - echo "Please install sct!"
                        + echo >&2 "Please install sct!"
                          exit 1;
                        
                        1. 2

                          FWIW, dash handles this properly as well:

                          % file /bin/sh
                          /bin/sh: symbolic link to dash
                          % sh
                          $ echo $((1440 - 720))
                          720
                          

                          OpenBSD’s ksh, same goes for zsh:

                          $ echo $((1440 - 720))
                          720
                          

                          So I guess on the majority of systems you’d run X on, this won’t be an issue ;)

                          Now, my own nitpick - I’ve ran shellcheck and fixed some warnings:

                          #!/bin/sh
                          
                          # Copyright (c) 2017 Aaron Bieber <aaron@bolddaemon.com>
                          #
                          # Permission to use, copy, modify, and distribute this software for any
                          # purpose with or without fee is hereby granted, provided that the above
                          # copyright notice and this permission notice appear in all copies.
                          #
                          # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          
                          S=4500
                          INC=2
                          SCT=$(which sct)
                          
                          if [ ! -e "$SCT" ]; then
                              echo "Please install sct!"
                              exit 1;
                          fi
                          
                          setHM() {
                              H=$(date +"%H" | sed -e 's/^0//')
                              M=$(date +"%M" | sed -e 's/^0//')
                              HM=$((H*60 + M))
                          }
                          
                          setHM
                          
                          if [ $HM -gt 720 ]; then # t > 12:00
                              for _ in $(jot $((1440 - HM)));  do
                                  S=$((S+INC))
                              done
                          else # t <= 12:00
                              for _ in $(jot $HM); do
                                  S=$((S+INC))
                              done
                          fi
                          
                          while true; do
                              setHM
                          
                              if [ $HM -gt 720 ]; then
                                  S=$((S-INC))
                              else
                                  S=$((S+INC))
                              fi
                          
                              $SCT $S
                          
                              sleep 60
                          done
                          

                          Also note that on linux systems, the jot binary is often not available (I just discovered it today, it’s an OpenBSD utility). At least on void linux one can install it with the outils package.

                          Either way, very useful - no need to run sct by hand now :)

                          1. 2

                            Odd, my dash at home barfed on the script. I now checked again, and it errors out on function setHM { .. }: it wants setHM () { ... } instead.

                            Not quite sure why I remember $((...)) being a problem…

                            1. 1

                              function, even though technically a bashism, originated in ksh.

                              In terms of $((...)) being a problem, you are most likely referring to ((...)) which is indeed a bashism. Alternatively, you might have come across ++ or -- in $((...)), which are not required by POSIX.

                            2. 1

                              for _ in $(jot $((1440 - HM))); do

                              huh, I had no idea _ was a thing, neat!

                              1. 1

                                $_ holds the last argument of the preivously run command. Overwriting it does no harm here and in similar places, so I occasionally make use of it (both to silence shellcheck and to signal the value won’t be used). It’s possible though some folks might object :)

                              2. 1

                                Also note that on linux systems, the jot binary is often not available (I just discovered it today, it’s an OpenBSD utility).

                                You can use seq instead of jot on linux.

                              3. 1

                                In similar vein, I’d suggest to replace [ with [[ because the latter is a bash/zsh/dash builtin.

                                1. 1

                                  Its a myth, you can check it with type [, both are builtin, [[ is only available in larger shells, [ is POSIX. The [ should be preferred for #!/bin/sh portability.

                                2. 1

                                  $((…)) is very much POSIX.