What software have you made to improve your workflow or rice? - Desktop Customization & Workflow
Halfwit
Anyways for me, https://github.com/halfwit/dsearch is my main utility for any query, from opening a file, to a link in the correct program. It uses dmenu as a backend, and many bespoke pieces are tightly integrated. That makes it really unfortunate to try to use with other setups, thus https://github.com/halfwit/searchfs is being worked on, which will present a 9p-based filesystem that one can listen on your home network with, mounting up on client PCs with 9p-fuse or even a bare mount -t 9p. From it you can simply read from a file, like /path/to/where/i/mounted/youtube/channel/craz3bra and get a list of videos, /path/to/where/i/mounted/google/image/chickadee to get a list of URLs pointing to images of chickadees, etc. The benefit of this approach is twofold. First, you can trivially client-side cache the results, as most 9p client implementations have baked in caching, and secondly a system with relatively light resources can leverage the more powerful host system and better (ethernet connected intsead of wifi) latencies to the internet. It's pretty simple to pipe it through like `cat /path/to/where/i/mounted/youtube/search/chickens | dmenu | plumb` should I require something transient like I had with dsearch, but much more stable, and simple to install and use on any arbitrary system; quite contrary to dsearch.

Other than that, I've written hwwm, which is deprecated and pending a complete rewrite to abstract it from X11 (I want to also use it with Plan9's Rio) and to clean up the configurations heavily, as well as moving much of the logic to a monolithic binary for reasons of abstracted state management (currently I rely heavily on X11 atoms)

I did a rewrite of Plan9's Plumber in shell that understood remote URLs by content-type, but since I've gone back to using the original plumber from Plan9 (basically xdg-open on crack for the uninitiated) and instead rewrote the client binary to understand remote URLs, for a much more flexible and clean approach.

Tangential to the Plumber thing was a dsearch-target called `store`, which took an arbitrary resource, mostly URLs, and ran a specific handler based on the content-type. So for a pdf, it would run a script which fetched artwork, set in the Author's name and publishing year, and created a launcher entry for a dmenu that has pango image support. On a Youtube video, storing it meant appending it to an m3u playlist, for an RSS feed, an entry was added to my aggregator, for a github URL, I could clone into my src directory or store it as a bookmark; super handy and generally useful. Since then, I've realised I could use Plan9's Plumber to achieve the same thing, with a very clean syntax and greater granularity than otherwise possible (seriously, it's so clean!)
(The code for this is still available in dsearch, under https://github.com/halfwit/dsearch/blob/...dlers/save, but again it's terribly bespoke to my own needs and not very generally useful for others.)
Basically everything I've made in the past on Linux was re-evaluated when I went to plan9, and I came up with better solutions overall.
budRich
(09-09-2019, 12:22 PM)fraun Wrote:
(06-09-2019, 05:35 PM)budRich Wrote: i also made a custom css that hides all posts on nixers from jkl .


I'm interested!

https://0x0.st/zJlp.png
zge
Thanks, but shouldn't the regex be have a ^ and a $? If I'm not mistaken, your bloking anyone who has "jkl" as a substring.

^^ Also, not sure how clever it is to use googleapis...
budRich
(11-09-2019, 07:05 AM)zge Wrote: Thanks, but shouldn't the regex be have a ^ and a $? If I'm not mistaken, your bloking anyone who has "jkl" as a substring.

^^ Also, not sure how clever it is to use googleapis...

When fraun was interested i got interested too, so I searched for "userscript to hide annoying users on forum". I found a pastebin with a script for some other forum, and just hacked on it till jkl disappeared. I don't know javascript or jQuery, but i am sure there is a way to do it without jQuery at all, and maybe it can be included in some other way then google api. I use decentraleyes, and i think it always uses local jquery anyways.

And yes, the regex could be improved, maybe not using a regex at all and only test for exact matches would be better.
kontroll
(11-09-2019, 11:09 AM)budRich Wrote:
(11-09-2019, 07:05 AM)zge Wrote: Thanks, but shouldn't the regex be have a ^ and a $? If I'm not mistaken, your bloking anyone who has "jkl" as a substring.

^^ Also, not sure how clever it is to use googleapis...

When fraun was interested i got interested too, so I searched for "userscript to hide annoying users on forum". I found a pastebin with a script for some other forum, and just hacked on it till jkl disappeared. I don't know javascript or jQuery, but i am sure there is a way to do it without jQuery at all, and maybe it can be included in some other way then google api. I use decentraleyes, and i think it always uses local jquery anyways.

And yes, the regex could be improved, maybe not using a regex at all and only test for exact matches would be better.

I registered for the sole purpose of submitting an improvement.

Code:
$('table').has("a[href='https://nixers.net/member.php?action=profile&uid=1548']").has("span[class='usernames']").css('display', 'none');

It selects only tables where there is a child <a> element that links directly to the offending user. And because this created problems with the main forum page, it also requires a <span> child with the class of 'usernames'. It appears sufficiently specific to circumvent any overzealous matching, and small enough to please the eye.
jkl
I find it amusing how many hours are wasted by writing scripts which discriminate other members in order to "improve your workflow". Get a life, friends.
kontroll
For my part I wouldn't say it's a matter of hours, but I'm sure some people may take it that far.
fraun
(17-09-2019, 08:08 AM)jkl Wrote: I find it amusing how many hours are wasted by writing scripts which discriminate other members in order to "improve your workflow". Get a life, friends.
My "interest" was more of an interest in how to do it. I also found it funny / though the original comment was a joke...
budRich
(17-09-2019, 08:08 AM)jkl Wrote: I find it amusing how many hours are wasted by writing scripts which discriminate other members in order to "improve your workflow".

I find your definition of discrimination amusing. Using the script only restricts and discriminate the user of the the script.

Since I have such a turbo riced environment, the userscript dirthack took me ~5 minutes (4 of which where following links when i searched for "userscript hide annoying user on forum").

And limiting ones social media, is probably the most effective workflow improvement of all.

(17-09-2019, 08:08 AM)jkl Wrote: Get a life, friends.
rice is a way of life.. friend.
--

(17-09-2019, 07:36 AM)kontroll Wrote: I registered for the sole purpose of submitting an improvement.
...

You did the right thing! "My" code (the script I was inspired by, only had three .parent() ), wasn't the prettiest.

---
on topic:

using mpv for audio. I never watch a video and listen to mp3/flac (music/pod) at the same time, so using the same program for both is great. And mpv has some nice playback manipulation features (change speed with adjusted pitch) built in, and is very "rice friendly" . I have this bash script, that i use to open all media with:

Code:
#!/usr/bin/env bash
: "${MPV_FIFO_FILE:=/tmp/mp_pipe}"

targetVideo="$1"

if [[ -n $(xdotool search --class mpv) ]]; then
  echo "loadfile \"${targetVideo}\" append-play" > "$MPV_FIFO_FILE"

else
  rm -f "$MPV_FIFO_FILE"
  mkfifo "$MPV_FIFO_FILE"
  mpv "$targetVideo" --input-file="$MPV_FIFO_FILE" > /dev/null 2>&1 &
fi

If no mpv instance is running, it will start a new one, with the important "--input-file" option, otherwise it will add $1 to the playlist of the currently running mpv instance. This input-file fifo can be used to send any action to mpv, and i use it to control the media with global (i3) keybindings via this:

Code:
#!/usr/bin/env bash

: "${MPV_FIFO_FILE:=/tmp/mp_pipe}"

action="${1:-toggle}"
arg="${2:-}"

case "$action" in

  ( speed )
    : "${arg:-+}"
    [[ $arg = + ]] \
      && arg="multiply speed 1.1" \
      || arg="multiply speed 1/1.1"

      echo "$arg" > "$MPV_FIFO_FILE"
  ;;

  ( toggle )
    echo "keypress space" > "$MPV_FIFO_FILE" ;;

  ( next )
    echo "playlist-next" > "$MPV_FIFO_FILE"  ;;

  ( prev )
    echo "playlist-prev" > "$MPV_FIFO_FILE"  ;;

  ( seek )
    amount="${arg:-2}"
    [[ ! $amount =~ ^[+-][0-9]+$ ]] && amount='+2'
    echo "seek $amount" > "$MPV_FIFO_FILE"
  ;;
esac
Halfwit
I use mpg123/ogg123 for audio and pipe the now playing title to a file, which is then read by my status bar. It's super useful, and works well with external mpd/radio streams. Mpd you can have as a multi-device solution, and you should try it out in that capacity if you haven't. It really shines




Members  |  Stats  |  Night Mode