Your Latest Workflow Improvement - Desktop Customization & Workflow

Users browsing this thread: 9 Guest(s)
venam
Administrators
Your latest workflow improvements, let's hear them.
Personally, I haven't changed much in my workflow apart from trying to keep the number of currently opened browser-based applications to a minimum, using ssh-add to preload my sshkeys when needed, and...

(18-07-2019, 04:35 PM)jkl Wrote: Refreshing workflow improvement: Getting rid of LaTeX.
I've actually started using latex for a project of mine, but I've soon learned of the dangerous world I was entering, so I'll try to not overdo it.
s0kx
Members
Bought myself a small whiteboard the other day. It's really nice to be able to e.g. write quick math equations without wasting a ton of paper. Of course a drawing tablet would also work, but I think it's better to take your eyes off the computer screen every once in a while ;)
TheAnachron
Members
This may be tiny but still very useful to me:

ted = terminal editor
Code:
#!/bin/sh

exec ${EDITOR} "${1}"

tedw = terminal editor $(which)
Code:
#!/bin/sh

w=$(which "${1}") || exit 1
exec ted "${w}"

cdw = cd $(which)
Code:
cdw() {
  w=$(which "${1}" 2>/dev/null)
  if test -z "${w}"; then
    2>&1 printf 'Error: %s could not be found.\n' "${1}"
    return 1
  fi

  cd $(dirname "${w}")
}

filew = file $(which)
Code:
filew() {
  w=$(which "${1}" 2>/dev/null)
  if test -z "${w}"; then
    2>&1 printf 'Error: %s could not be found.\n' "${1}"
    return 1
  fi
  file "${w}"
}

I have a ton of more scripts for handling my media, backups, documents and more. I've automated most of the things that can be automated except my PLA (plain-text accounting), which I find better to do manually because I can be more specific.
seninha
Long time nixers
Recently I replaced the cd builtin with a function. The path given to the function can be a directory, or a regular file (in which case it's considered the directory in which it resides). So, if I do `cd path/to/file.txt` is the same as `cd path/to`.
The function also sets the completion for the `make` command to the Makefile in the current directory.
It also combines the popd and pushd functionalities (which my shell doesn't have).

If an argument is given, it is interpreted as follows.
  • If the sole argument is a `+` the current directory is added to the beginning of the directory stack.
  • If the first argument is a `+` followed by a list of paths, those paths are added to the directory stack.
  • If the sole argument is `+N` (where N is a number), the N-th entry on the directory stack is moved to the beginning of the stack and it becomes the current directory.
  • If the sole argument is a `-`, the previous current directory becomes the current directory.
  • If the sole argument is `-N` (where N is a number), the N-th entry on the directory stack is removed from the stack.
  • If the sole argument is composed with dots, a directory up in the hierarchy becames the current directory. `cd ..` goes to the parent directory, `cd ...` goes to the parent's parent's directory, etc. You can even do `cd ..../somedir`.
  • If the sole argument is `..X` (where X is a word), go to the first directory up in the hierarchy containing word. For example, if I am at `/home/phill/tmp/stuff/foo` and I enter the command `cd ..tmp`, I go to `/home/phill/tmp`.
  • If the sole argument is a path, go to that path.
freem
Nixers
I think my latest workflow improvements have been:

1) have "buttons" in my status bar to control mpd. I could already do it with keyboard, sure, but they require both hands (no super key on keyboard's right side, which is the $mod key for my "desktop") and sometimes I have my right hand side on the mouse, thus it's easier to have buttons:

Code:
#!/bin/sh

## this script allows to show status and control user-land runit daemons in i3blocks
btn_type="${1:-"error unknown option $1"}"

which mpc 2>/dev/null >/dev/null || btn_type="error mpc not found"

#may be better icons, but requires better font
#btn_prev="\0342\0217\0256"
#btn_next="\0342\0217\0255"
#btn_play="\0342\0217\0265"
#btn_pause="\0342\0217\0270"
#btn_stop="\0342\0217\0271"

btn_prev="[<<]"
btn_next="[>>]"
btn_play="[|>]"
btn_pause="[||]"
btn_stop="[S]"

case "$btn_type" in
    "prev")
        ACT="prev"
        TXT="$btn_prev\n$btn_prev\n#ffff00\n"
        ;;
    "next")
        ACT="next"
        TXT="$btn_next\n$btn_next\n#ffff00\n"
        ;;
    "play")
        ACT="toggle"
        if mpc | grep '^\[playing\]' -q >/dev/null 2>/dev/null
        then
            TXT="$btn_pause\n$btn_pause\n#0000ff\n"
        else
            TXT="$btn_play\n$btn_play\n#00ff00\n"
        fi
        ;;
    "stop")
        ACT="stop"
        TXT="$btn_stop\n$btn_stop\n#ff0000\n"
        ;;
    *)
        TXT="rtfm $btn_type\n$btn_type\n#ff0000\n"
        ;;
esac

test -n "$BLOCK_BUTTON" && mpc $ACT >/dev/null 2>/dev/null

printf "$TXT"

2) the use of keepassxc. For long, I was not using that kind of tool, but now that I use it I understand why they're nice. TBH, I'm annoyed that current version (not yet in debian stable) have redone their graphics for that shitty fashion of flat design and low contrast colours, but old won't break magically soon, and I can probably live with the lacking features until I find a better alternative.

3) still WIP, but I've been running all my "desktop daemons" (keepassxc, quasselc, claws-mail, mpd, unclutter) under a user's instance of runsvdir, so that they are restarted when they are closed (either because of crash or because of accidental action). This also provides me with an easier way to control them, since I can use
Code:
sv [start|stop|restart|alarm|...] $daemon
to control them. When I'll have a more resilient environment (WM, taskbar, command-launcher) I intend to integrate this into the taskbar, somehow, and to have there "poweroff", "stop session", "pm-suspend", etc buttons, too. For some of them, I don't know yet how to do that, since they require admin rights and I would prefer to avoid the use of sudo or elogind. I also intend to integrate the WM in runsvdir, which is the final reason which got me tired of i3, but I can't find anything else that seems to fit how I work, so I'm probably going to write my own (already did some research, currently preparing a test environment, which got me back at some tasks I stopped months ago)
dany74q
Members
Two which come to mind -

Context: Where I work at, we are dealt macs - I took a 16" macbook pro w/ i9-9980HK @ 2.4GHz,
64GB of RAM and a 1TB NVMe SSD (the built-in AP1024N);
Sadly, the performance does not match the impressive specs - it throttles endlessly,
docker on mac is still pretty bad and even running Goland over our 130 go-module monorepo is just plain slow.

I've tackled this on two fronts:
1. Offloading the deployment of our components to an arch machine w/ an extremely fast SSD
hosted in a relatively close datacenter; I've bootstrapped k8s w/ kubeadm, metal-lb[1]
and hostpath-provisioner[2] for a smooth local-k8s experience.
2. Offloading the IDE (read: compilation & indexing) - all sources now reside on said arch machine;
I'm using jetbrains' projector project[3] & mutagen[4] as a continuous rsync-like solution.

My mac now only runs Emacs, the projector client, a terminal and slack; this makes working on it tolerable.


And another, albeit silly one - I find myself executing long running commands on my mac and going afk at times,
I'm now &&-ing such commands to a small beep function that notifies me audibly when it's done;

Code:
function beep() {
    for x in `seq 10`; do osascript -e 'beep' && sleep 0.2; done
}


[1] https://github.com/metallb/metallb
[2] https://github.com/torchbox/k8s-hostpath-provisioner
[3] https://github.com/JetBrains/projector-server
[4] https://github.com/mutagen-io/mutagen
jkl
Long time nixers
As all WordPress (yes, I still use that) Markdown plugins I tried (which is exactly one) are quirky and org2blog is too complex for short one-sentence blog entries (I’d need to spend more time on using org2blog than on writing the actual prose), I am currently considering to write my articles in a simple text editor again and pipe it into pandoc so I can stick with the Classic Editor (which prefers HTML).

This was a good moment to switch from Acme to Sam again which works just fine as a “better ed”. I wonder if there is a way to control Sam via 9P though, which would reduce the number of commands needed to convert the current buffer to HTML to just one.

(I did that in Acme once and it worked beautifully, but Sam is different in many ways.)

edit: FWIW, the pipe command works just as well.

--
<mort> choosing a terrible license just to be spiteful towards others is possibly the most tux0r thing I've ever seen
dany74q
Members
(30-06-2021, 10:30 AM)jkl Wrote: As all WordPress (yes, I still use that) Markdown plugins I tried (which is exactly one) are quirky and org2blog is too complex for short one-sentence blog entries (I’d need to spend more time on using org2blog than on writing the actual prose), I am currently considering to write my articles in a simple text editor again and pipe it into pandoc so I can stick with the Classic Editor (which prefers HTML).

Hm - jkl, you can export to pandoc via org directly (I think it's built in by now, or there's an ox-pandoc)
Would that work for you ?
jkl
Long time nixers
It probably would; however, although I find GNU Emacs amazing for serious programming, its export functionalities are annoying to use in my opinion. A matter of taste, I guess?

--
<mort> choosing a terrible license just to be spiteful towards others is possibly the most tux0r thing I've ever seen
tuxifreund
Members
Two things have made my work easier lately:

1. colourcolumn in Vim - nothing new, but incredibly practical.

2. a function I built into my own browser. I don't know if something like this already exists in other browsers, but I've never come across it before. I would describe it as "user-defined protocols", even if that's not quite the right word.

For example, you write the following in your configuration file:

Code:
[Protocols]
ddg = https://duckduckgo.com/?q=

And if I now enter ddg://foobar in the address bar, it searches for "foobar" because the text is simply appended to the URL specified in the configuration. This makes it possible to forward gopher and gemini URLs to an HTTP proxy, for example.
mcotocel
Members
Nothing huge, but I've added keybindings to my WM configuration to open Emacs with various programs running, such as Elfeed (RSS reader), Mu4e (Email client), and Circe (IRC client).
freem
Nixers
Last improvements: start using a mindmapper (VYM in my case) and start using a password manager (keepassxc, but I can't say I love it. It's just okay enough for me, and for now).

I expect more improvements to come from the usage of VYM, since I started mapping my system today, so that I might have a cleaner view of what I should change or improve.
I started it in french, and, as I was refining it, I thought it might be interesting to share it so I started changing some stuff to english, so maybe someday I'll share it, most likely on IRC though, since I don't really see the point at sharing that kind of stuff on a permanent place.
seninha
Long time nixers
2022 update.

After adding support for dockapps on shod, I started to use them, especially system monitor dockapps.
I think that a dock is better than a bar: the content of a bar is limited to text (in a lightweight bar) or to its widgets. On a dock, you can swallow any window into it.

I also replaced mutt/firefox/hexchat/newsboat/gopher with a single internet suite application: SeaMonkey.
SeaMonkey is from a time where you could do everything inside a browser (and I'm not talking about web applications, but the browser itself): from checking your mails to playing music.
Yeah, I know it goes against the principle of “do one thing and do it well”, but I needed to replace Firefox with something lighter. And, while I'm using it, why not use it in all its power?

One last addition to my workflow are some awk scripts that parse project files, grep for interesting lines (tasks todo, calendar events, habits done, etc) and sort and format them on the terminal. The awk scripts are glued with a sh script called “agenda”.
pfr
Nixers
Similar to TheAnachron a few posts above, I've been using some simple scripts to view and edit executables in my $PATH

PHP Code:
#!/bin/sh
#
# ec < edit command

file_path=$(command -"$1" 2>/dev/null)

if [ -
"$file_path]; then
    printf 
"%s\n" "Error: $1 not found"
    
exit 1
fi

$EDITOR 
"$file_path
This obviously needs sudo to edit

and

PHP Code:
#!/bin/sh
#
# vc < view command

file_path=$(command -"$1" 2>/dev/null)

if [ -
"$file_path]; then
    printf 
"%s\n" "Error: $1 not found"
    
exit 1
fi

bat 
-"$file_path
Bat can be replaced with cat or whatever you want.

This saves me having to remember the full path or type the full path.