Your Latest Workflow Improvement - Desktop Customization & Workflow

Users browsing this thread: 1 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.
phillbush
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)