Linux nerds, a question about your personal machines:
What is your favourite quality-of-life tweak you've made to your system?
An alias? A utility, a setting, something in .bashrc or ~/bin?
I'd like to know.
@mhoye the prompt starts with a # and ends with a newline, so I can more easily copy the command out to share with others
@mhoye Definitely my aliases. When I discovered those it changed the command line for me.
The best ones are just being able to type the name of one of my machines and have it ssh straight into it. Another one does the ssh but then runs a command to get the temp (it can get hot) and exits.
And I can never remember the command that this alias runs:
alias ns='netstat -alnp --protocol=inet | grep -v CLOSE_WAIT | cut -c-6,21-94 | tail -n +2'
but I use that a lot.
@mhoye Rebinding caps lock to control. For some reason it’s one of the biggest keys on the keyboard but aside from this hack I never use it
@mhoye rebinding caps-lock to escape (seriously: saves a lot of strain on my left wrist)
@mhoye Consistent keyboard shortcuts across all machines for things like moving between workspaces, popping up apps, etc.
@mhoye i recently tried out paperwm on linux. Really nice with touch pad on a limited screen. Just some small things bothered me, so i went back to normal window manager. But that bothered me even more. So now i use scrollable window manager. :)
@mhoye
1. Running Linux
2. Cinnamon DE (although Plasma 6/Wayland is okay too)
3. Firefox (based) browser with uBlock and uMatrix
All the other stuff is secondary benefits, although Arch based distro and the AUR rank at the top of those secondary benefits.
@mhoye One was taking more control over versions with Guix (https://guix.gnu.org), GNU stow/xstow,, and SDKman (https://sdkman.io).
@mhoye this one alias:
alias l='ls -Nlrt'
then: install micro, the text editor
then: create ~/bin for all the weird little toadstools that accrue on my systems.
@mhoye i have `h` aliased[0] to a history of directories, navigable with fzf.
i have various uses of fzf sprinkled all over my setup, and it's been a huge improvement in everything i've applied it to.
[0]. https://code.p1k3.com/gitea/brennen/bpb-kit/src/branch/main/home/.sh_common#L169
[1]. https://github.com/junegunn/fzf
@mhoye I deal with a lot of virtual environments for Python projects (every repository has one) and activating them was a pain since environment names don't autocomplete. I made this bash function and now it's all automatic (triggered by a cd): https://github.com/leouieda/dotfiles/blob/main/bash/.bash/functions/yavanna.sh
@mhoye
I switched my fixed-width fonts — terminal, IDEs, etc. — to Comic Mono. It feels more legible than any other font I’ve tried before, and it adds a bit of whimsy to a boring environment.
@mhoye
As an experience designer that works with several & various development teams - using ephemeral containers with mounted directory as prototype/development environments, effortlessly using different versions of the same programming language and different languages as long as there’s memory and storage.
Also have a “remove crud.sh” script that clears unneeded cache directories and storage-guzzling auto-update applications.
@mhoye about a decade ago I made a conscious effort to unwind as much customization as possible, and to use as many defaults as I could stand. Where I do need more customization, I try to adopt open source projects (think oh-my-zsh or janus for vim) and accept their opinions. It was freeing to stop obsessing over the details and learn to be comfortable with the defaults, and it makes using other people's machines tolerable. I got a ton of cognitive load back.
@dahukanna can you tell us more about this? I’ve seen something like this as part of deployment practices but not as a local ergonomic approach.
@mhoye Ploopy's recreation of the beloved Trackball Explorer.
@mhoye Custom monotype font.
I use fish. Also flameshot to handle screenshots.
As a more unofficial thing, I have my browser start- and homepage set to a self written HTML with links to my personal projects.
Zoxide, fzf, and fd have revolutionized my day-to-day cli file handling, replacing the harder-to-use cd/find/ls/less combos.
Uv from astral.sh for python management runs a close second in the "revolutionary" category.
@mhoye learning nnn and traversing my system with it with newfound ease. https://github.com/jarun/nnn
@atuin has absolutely changed the way I use the terminal (I have all my terminal session history across my LAN synced to a local atuin server). It binds to `ctrl-r` and multiple ctrl-r's let you cycle through different views of command history (global/machine/session/directory).
It's incredible to be able to lookup a command from 6 months ago to remember how I did something (even on a different machine).
@mhoye Mapping a key (I chose right control) to compose.
@mhoye
A long time ago I mapped ctrl-r to fzf, which lets me fuzzily search command history. Way more useful than the built-in history search
I work with multiple development teams that would require arduous instructions to set up a development environment for the UI or UI micro services, that I’m reviewing for UI implementation of my designed experience or even writing/correcting the CSS to reflect the intention.
By running that code in an ephemeral container with the git repo directory mounted, I completely skip the “arduous instructions”. I also can run a “polyglot” set up.
I have a presentation on this from 2017.
@mhoye I cannot function without disabling MacOS (sorry) "natural scrolling"
@mhoye
Super+H to minimize windows.
@mhoye Getting a split keyboard and putting Tab and Esc in the middle, accessible by index finger.
@mhoye 1Password
@mhoye the most significant for me is using a stenography machine instead of a keyboard (with Plover). Just night and day for speed and ergonomics. A small thing I like a lot is autojump - I can live without it but it's very nice to have
@radicalabacus How long did it take to get comfortable with that?
@mhoye mbsync everything to every device with a keyboard and then mairix. I can find all the emails instanter.
heh. Using a super simple window manager like LXQt. No fancy animations, no transparency, just simple, highly responsive controls and displays. Is it perfect? No. But, man is it less distracting.
@mhoye BlueTooth audio receiving in from my phone, where I listen to pod-casts. (a2dp)
It mixes with whatever else I'm doing and just works. Media controls work (after I enabled that systemd service)
@mhoye Non-nerdy: Adblocking since forever; Nerdy: Using QWERTY instead of QWERTZ
@mhoye I pull my shell configuration into a separate folder, so that I can organize it better. This makes it so you can conditionally load it in the actual shell RC file, with minimum edits.
EG: I have a `$HOME/.bash.d` folder with files used for various tools (asdf, aliases, work-specific tools, etc.), then do an `if [[ -d "$HOME/.bash.d" ]]; then` and source each file present.
@mhoye Another improvement has been adopting Nushell (https://www.nushell.sh/) as my primary $WORK shell
@mhoye I built a better up for the system search (on Gnome, inspired by Quicksilver) and I love it so much
https://mkhl.codeberg.page/searching-summoning/
oh and something that desaturates background windows
@mhoye this is a more general thing rather than an individual tip, but: setting up a personal "dotfiles" repo has made a big difference for me. All those config settings, aliases, scripts and so on are now deliberate, permanent parts of my working environment on every machine I use
@mhoye remap the keyboard, swapping positions of CAPSLOCK and ESC
@radicalabacus @mhoye this is fascinating and I would love to hear more about your experience
@mhoye I install Syncthing on every machine that can run it, I have for many years now and I can't imagine not having it.
@mhoye I've had this in my bashrc for decades
alias cd.="cd .."
alias cd..="cd ../.."
alias cd...="cd ../../.."
alias cd....="cd ../../../.."
alias cd.....="cd ../../../../.."
@mhoye Putting my entire (fvwm) setup in git. First time on a new device: Install git if missing, install fvwm and some other tools if missing, check out my ~/setup repo and run the script to set up all symlinks: Tada!
@mhoye A hardware thing for me - switched to an Ergodox keyboard a few years back and it has ruined normal keyboards forever. :)
@Susan_calvin Mairix is new to me, thank you. Very cool.
@mhoye alias cd to zoxide
@twobraids Oh, that's interesting....
Writing a small shell script that (re)creates a standard tmux environment.
Also: creating a standard vim/gvim session and tweaking my .vimrc file to have it configured just the way I like it. Still a work in progress, this one.
In general, having thoroughly commented shell scripts take care of repetitive tasks, the kind you write once and only tweak once in a while is a fantastic time saver.
@mhoye check the source code sometime for an example of old skool register level optimization in C. Glad to intro it!
My own contribution to this is my per-project shell history hack - everything under /src/* gets its own independent backscroll - that I've laid out here.
Now I want to figure out how integrate zoxide and fzf into this...
https://gist.github.com/mhoye/469ed97d7887b451da5d45b87acb53f5
@mhoye I defined the right ALT key as the Compose Key.
@mhoye direnv. direnv all day long.
It does very little, but what it does, it does _extremely_ competently, and solves most of the project-by-project config needs much more cleanly than just about anything else i've used.
@mhoye I have lots of other quality of life tweaks, but in terms of favourite, bring-it-everywhere, wont-live-without-itness, direnv is head, shoulders, pelvis, and most of a thigh above everything else.
@ballpointcarrot @mhoye +1 I'm doing the same but in $XDG_CONFIG_DIR ($HOME/.config) :)
@mhoye have you tried atuin yet?
@djc No, but I might have to; it's got a lot of fans in here.
@twobraids @mhoye I put this in my .xmodmap:
############
clear lock
keycode 66 = Hyper_L
remove mod4 = Hyper_L
add mod3 = Hyper_L
############
So caps lock becomes an additional modifier key, which I bind with a variety of keystrokes for windows manipulation, virtual desktop switching, and app launching.
@mhoye 1) I only check out git branches as worktrees. 2) I wrote a script to help with this https://gitlab.com/tvaughan/dotfiles/-/blob/main/tvaughan/bin/git-new-worktree?ref_type=heads
@mhoye One virtual screen for each of my favorites apps. Each one is displayed full screen and it is easy to switch. Tried this on my professional Windows computer, the user experience is not so good. :(
@mhoye I (very strongly) suspect your per-project history idea can be done cleanly with it; I'll experiment and let you know!
@owen Thank you!
@joelvanderwerf @twobraids @mhoye That is genius.
Slight suggested mod:
clear lock
keycode 66 = Hyper_L Caps_Lock
remove mod4 = Hyper_L
add mod3 = Hyper_L
If I've got it right, this means Shift+Caps Lock gives you the original Caps Lock operation, should you ever need it.
@mhoye If I'm calling `ls`, I want more than just the filenames, so I add this alias in .zshrc
```
alias ls="ls -ahlc --color"
```
@mhoye using a dotfile manager like chezmoi.io. it makes syncing my dotfiles between different machines super easy
@mhoye I think a few others have commented with similar ideas but mine is disabling Caps Lock, binding it to Ctrl+Alt+Shift, and then binding lots of stuff off of that (e.g., Caps+L locks my screen). I think I was originally inspired by Steve Losh in https://stevelosh.com/blog/2012/10/a-modern-space-cadet/.
On all Linux boxes, in .bashrc
"unalias ls 2> /dev/null"
fucking color ls as a default, and with colors that aren't readable on a dark background, should be ripped from the core distros with vengeance.
@mhoye My main PC is a system I built in 2022 It has no moving parts, is passively cooled, and emits no sound. It lives in my bedroom at the foot of my bed, and my room is about 30 dBA ambient.
My PC scores about 17500 on Cinebench R23, which is pretty good, core temps about 88°C max at about 102 W max.
Thermaltake Core P3, Gigabyte Z690 UD AX, Intel Core i5-12600K, Seasonic Prime Fanless 500W PSU, Samsung 980PRO 500 GB, 32 GB DDR5, Noctua NH-P1.
@mhoye favourite is hard, but this is usually one of the first things I copy to a new system: a function that invokes either ls
or less
as appropriate (this is the fish version, I have one for bash somewhere too).
function l
if test -n $argv[1]
if test -d $argv[1]
ls $argv[2..] -- $argv[1]
else if test -f $argv[1]
less -N $argv[2..] -- $argv[1]
else
ls $argv
end
else
ls
end
end
alias -- -='cd - > /dev/null'
alias ..='cd ..'
alias ..2='cd ../..'
alias ..3='cd ../../..'
alias ..4='cd ../../../..'
alias ..5='cd ../../../../..'
alias ..6='cd ../../../../../..'
alias ..7='cd ../../../../../../..'
alias ..8='cd ../../../../../../../..'
alias ..9='cd ../../../../../../../../..'
alias ll='ls -Fl'
alias la='ls -FlA'
alias lld='ls -Fld'
alias lad='ls -FlAd'
alias llrt='ls -Flrt'
alias lart='ls -FlArt'
alias lldrt='ls -Fldrt'
alias ladrt='ls -FlAdrt'
for i in {1..100}; do ll$i() { ls -Flrt "$@" | tail -${0#ll} }; done
for i in {1..100}; do la$i() { ls -FlArt "$@" | tail -${0#la} }; done
for i in {1..100}; do lld$i() { ls -Fldrt "$@" | tail -${0#lld} }; done
for i in {1..100}; do lad$i() { ls -FlAdrt "$@" | tail -${0#lad} }; done
@mhoye Change the default fonts away from Droid Sans to something like Atkinson Hyperlegible, and the terminal font to one of a couple of fixed-widths my eyes like better. My eyes are not young, and those reduce eyestrain better than light/dark mode tweaks.
@mhoye The Intel One Mono font. "A monospace typeface designed with input from a team of low-vision and legally blind developers for optimized legibility."
Huge QoL inprovement for me!
@jmtd details plz
I use #KdePlasma and configure as many keyboard shortcuts as will fit in my tiny brain so that I don't have to keep picking up the mouse. #Plasma is brilliantly configurable; #Windows is not. So I've changed some Plasma shortcuts to be the same as Windows' equivalents to reduce cognitive load when switching between home and work.
I often have several console windows open on the same virtual desktop. I give each one a different colour to make it easy to Alt+Tab between them. I have simple aliases (red
, blue
, green
, turq
) to make it easy to launch them.
@mhoye syncthing on everything. Reverse proxy on all my self hosted stuff. And I can't live without zoxide
- replies
- 0
- announces
- 0
- likes
- 1
@mhoye@mastodon.social Using custom shorthands/aliases for a lot of commands, especially #Git.
Originally I started out with these and have adapted them over the years:
https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git
Another one is aliasing rm
to the trash-cli
, so I don't permanently delete anything important on the command line.
#Linux #TechTips
@mhoye switched my home server over to Ubuntu Core. No more worrying about updates. Gonna switch my laptop when I get time.
@mhoye silly little thing I never regretted - using a small script to generate random machine passwords that only include characters on one side (left hand for me) of the keyboard. Still a strong password, but as that is the only one I actually type regularly, worth optimising.
@mhoye This sounds really basic, but mapping the super key to open Application Finder in Debian Xfce.
maybe not favorite, but a huge quality-of-life tweak:
xinput to switch mouse buttons for left hand, independently of other mice on the system - for some reason, (last I looked) only #XFCE had this option in a GUI.
most impactful: switching to #dvorak layout
(I also considered editing the code and re-compiling #Firefox with #emacs keyboard shortcuts. Maybe this summer.)
@mhoye
My absolute favorite is also related to shell history.. Using @atuin has been a game changer!
Fuzzy complete with scrollable history that I can switch between global, session, host, and current directory.
I'm running a self-hosted server instance for syncing between desktop and laptop, though there is an encrypted-storage cloud option if one prefers that.
@ted What does Core get you specifically?
@mhoye From a good friend of mine:
alias please=sudo
@mhoye image based system, so the upgrades can apply cleanly and rollback if they fail. Allows for reliable automatic updates. Which mostly means that it stays up-to-date while I just use it.
@jesterchen Very nice.
@mhoye Turns out not to be as straightforwards as I hoped, at least for zsh (thanks, Apple) - while setting HISTFILE is trivial, direnv runs its config in a separate shell, so operations like `fc -R` don't propagate.
What ends up happening is that if you cd into a project that sets HISTFILE, and then exit your shell, _all_ history gets dumped into that histfile, while if you cd out again (and HISTFILE gets restored), _no_ history gets stored in that histfile.
@mhoye Although it's awkwardly big, I'd have to say adding a keyboard launcher to my environment. I can distinctly divide life into 'before launcher', when I had a whole collection of this and that to make doing various things easy, and 'after launcher', where I hit a key and start typing and make magic happen like that.
(There's like a dozen or more moving parts involved, including extensive customization of what the launcher does, so it's not a small tweak.)
@owen Yeah, that's why I've got pushd and popd in my gist - you need to know all of the ways into and out of a directory to get this right, and if you miss anything, chaos.
@mhoye I could write a book on this. Got a nice script that detects which cluster in working against, if it’s a cloud address it loads my local env for that cloud provider (ie token exchange, set short lived keys), if it’s local or desktop it loads the appropriate talos config.
@delProfundo I would read your book!
@mhoye Yeah. Ironically, zsh itself has a much nicer builtin approach for this than bash does, using `fc -p NEW_HIST_FILE` and `fc -P` - it's just that the way direnv works doesn't integrate with it.
@mhoye I’ve got “l” aliases to ls -lah
Iirc, oh-my-zsh includes something similar.
@mhoye Not Linux-specific, but all my keyboards run QMK in one flavor or another, and I've bound the caps lock key so that if it's tapped I get the normal toggle, and if it's held it switches me to a second layer where I can use media keys or access a numpad layout on JKLUIO789, like Thinkpads used to do.
@mhoye this plays a glorious office chatter / screaming kids blocking pink noise in my headphones. Simply by typing 'silencio'
@mhoye one of my favourites is putting `+noall +answer` in ~/.digrc
also I've been using `alias ls "eza -g"` for the last year or so and I've been happy with it so far
@mhoye installing fish as a shell everywhere.
Sometimes I think how many hours I've spent trying to make other shells behave in a sane way over the years. Happy that is long gone.
@mhoye I have an away script that unmounts the disk array and drops CPU frequency and a home script that winds up the clock and remounts the disks.
@bval @mhoye Me to, I also switch platforms every 5y or so, Linux, Mac, Linux, Mac, Windows, Linux, so I can work usefully on anything. I started in sysadmin so there was no point in customizing anything, since all the target systems are shared with the team and need to stay as close to defaults to not confuse others.
@mhoye Colemak keymap
@mhoye I use an app switcher (rofi) that lets me type the name of the app I want, and switches focus to it, matching against its name, window title, etc., along with an extension for it (brotab) that adds browser tabs to that list, so I can, for example, jump to inkscape, then my whatsapp browser tab, then one of three googledocs tabs, regardless of what firefox window they are in, whether they are the focused tab or not, or whether they are in the current screen/workspace or not.
@mhoye Flycut, for easy access to my copy/paste history (this is OSX - there's lots of alternatives for Mac, and other OSes.)
@mhoye Comic Code or similar font for terminals and editors.
@mhoye I use this one a lot:
# mkcd makes a dir and cds in
mkcd () { mkdir -p "$@" && cd "$@" || exit; }
@mhoye I made a wrapper around time that sends a desktop notification when a long-running command finishes.
@mhoye keeping copies of my dot files in Github and automatically colour-coding terminal windows to easily show what system I'm connected to.
@mhoye fish shell. The autocompletion is *so* much nicer than bash
@mhoye ctrl-alt-T to open a new terminal. Caps lock as control.
All those small but critical shell etc dotted config files, .vimrc, .bashrc, .Xmodmap, and so on, i put in ~/Bin, named without the dot, and symlink to them in ~/. Then I never lose them, instead of scattered they're in one place, easier to save and document. Etc.
@mhoye I’m starting to put together a series of short videos about GitOps/devex for some clients. Lots of the magic will be covered by the series!
Still haven’t quiet mastered the audio but getting there :
@mhoye https://soundswitch.aaflalo.me/ for quick audio device switching on my gaming machine.
On my Mac, installing altTab <https://github.com/lwouis/alt-tab-macos> so that window switching works the same on on Windows and Mac
setting my background to solid black used to be notable, but they finally added an option for black wallpaper a couple versions back. So, forget I mentioned it. It used to be a minor cool change though
@mhoye Long ago, I wrote a windows registry file to map my keyboard. It still works after 20 years:
https://www.darweesh.org/mjd/caps_lock_to_control_AND_left_windows_to_alt.reg
@mhoye Timeshift with BTRFS snapshots, when possible. The "tweak" here is choosing the root filesystem as BTRFS when doing a new Linux Mint install.
@mhoye i use a mouse with 2 extra buttons, by default often mapped to prev/next or some such.
Instead i map them to virtual desktop forward/back.
Because i have 2/3 screens and usually 3 virtual desktops, each window can live fulscreen somewhere and i can easily switch between applucations with the mouse.
(Of course i also have that and more as keyboard shortcuts)
Doubles as a very quick boss-key, should you need it :D
@mhoye A shortcut for i3wm which sticks floating Windows to every virtual desktop.
@mhoye Super basic, but: CapsLock as an additional Ctrl key
@mhoye I have turned off or disabled every default system sound, and physically built it from scratch with big quiet heatsinks and fans tuned for minimum noise.
There are a total of five fans in my PC and four of them often aren't even turning at all.
My computer makes no noise unbidden, and I don't ever hear it unless I choose to listen to music or a video or I'm working it super hard (rendering or gaming).
@waltertross @CppGuy @matt @mhoye
```
gb() {
local path;
for ((i = 1 ; i <= "$1" ; i++)); do
path+="../"
done
cd "$path" || exit;
}
```
@mhoye escape key between tab and shift. Underscore on shift space.
@mhoye Backing up all my valuable dot files to git and having a script to set them all up again on new machines... But then I maybe have too many random computers...
@mhoye Trying to avoid GUI as much as possible.
In .bashrc:
# Autocorrect typos in path names when using `cd`
shopt -s cdspell
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# support git gpg passphrase entry in a ssh session
if ! xhost >&/dev/null; then
GPG_TTY=$(tty)
export GPG_TTY
fi
Git:
$ git alias
alias=!git config -l | grep ^alias | cut -c 7- | sort
dc=d --cached
d=diff --color-words
lg=log --color --color-words --graph --pretty=format:'%C(red)%h%C(reset) -%C(auto)%d%C(reset) %s %C(green)(%cr) %C(bold blue)<%an>%C(reset)' --abbrev-commit --all
Tools:
https://github.com/jesseduffield/lazygit - `git-gui` for terminals.
https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh - a useful shell prompt included with git
@mhoye I set my default text editor to helix and made it so that I can open what's in the command line in it with ctrl+e
@mhoye fish as shell, starship as prompt
@mhoye CDPATH
@mhoye It started out as this simple alias
alias cdtop='cd $(git rev-parse --show-toplevel)'
But it has evolved to a script to cover a number of other (competing) opinions of what the top level of a project should be.
@mhoye I disable the system bell in every way I know of.
@mhoye I have a set of scripts that mirror the source code for the uncommon tools I use, that build those tools from source, and that modify the PATH accordingly, all that in my home directory without requiring root access.
@mhoye perhaps a slightly boring one, but: installing the Vimium Firefox extension (https://addons.mozilla.org/en-US/firefox/addon/vimium-ff).
The 'f' shortcut to open any link on the current page is awesome.
@raboof @mhoye Vimium is one, PaperWM (tiling/scrolling window management extension for GNOME) is the other. I wrote about both here: https://lwn.net/Articles/1005332/
@mhoye Colour coded bash prompts to give an indication of which host I am on... examples like green variants for hosts in dev, blues for hosts in pre-prod, reds for devs. Also different red prompts used for root in each environment.
Different prompt formatting for 'normal' sessions versus screen sessions so I can tell at a glance also.
Other than that I try to use the best quality physical screens I can afford to save my eyes. I've been running Benq pro line monitors for the last couple of decades. A dalliance with Apple iMacs in the noughties.
@dahukanna @mhoye distrobox is amazing for this kind of workflow. It bindmounts everything useful inside the container, so it feels like you are not in a container. I use an immutable version of Fedora (Silverblue), so all my dev env is in distrobox container, and I aliased e="distrobox enter" , so I usually open a terminal and hit e right away. It also gives me "e ubuntu" or anything after another distrobox create.
@matmaul @dahukanna @mhoye oh, I'll need to have a look at distrobox.
Otherwise I get something a bit similar with QubesOS - everything is nicely integrated into a seamless graphical experience, but it's running on separate VMs, some of them ephemeral.
@mhoye switch from bash to fish.
@mhoye putting the following in my helix config:
[editor.whitespace.characters]
newline = "↩"
A slight extension to that -- I use a two line bash prompt.
The top line starts user@host:/cwd, ends with some spaces, and has a colored background -- that enables easy and accurate copy targeting, and differentiation from the mass of output lines. "pet" hosts are individually color-coded with gradients, "cattle" hosts get flat colors by role.
The second line displays a ✓$ in green or a ✗$ in red depending on the previous command's exit value. That's been so, so useful to let me know that something went wrong nonobviously.
@dashdsrdash @mhoye Yep, multi-line is great. You can lose your place and mistakes can when the path is obscured by a line break, especially when you have a large number of terminal sessions open. Reduced cognitive work load is good.
@waltertross @CppGuy @matt @mhoye I have "climb tree":
ct()
{
cd ${PWD%/$1/*}/$1
}
SO MANY little hacks, aliases, shell functions, and scripts.
Sometimes I don't want to run *top, I just want a quick status:
alias s='COLUMNS=999 top -bin1 |head'
This lscpu
command shows me a concise CPU speed status:
lscpu --extended=cpu,core,online,maxmhz,minmhz,mhz
Also, I always swap caps lock and escape, which makes vi-style keystrokes a TON easier to use, and I have scroll lock assigned as the compose key.
A small one I've been using for about a year now:
Turning on vi-style editing in my shell.
Total. Game. Changer.
@RussSharek Tell me more.
I remap Caps as my Compose key
$ setxkbmap -option compose:caps
and use it DOZENS of times every day.
It's especially handy if you create your own ~/.XCompose file where you can include the system one
include "%L"
and then define your own atop it, so I have added some custom arrows, vertical ellipsis, the "Enter" key (⏎), and a number of emoji like
<Multi_key> <greater> <colon> <parenright> : "😈" U1F608 # SMILING FACE WITH HORNS
Also, it pays to skim through all the `<Multi_Key>` items in the system file to learn what's in there. Em- and En-dashes, horizontal ellipsis, diacritics, superscript/subscript numbers, and so much more.
@mhoye capslock -> escape key
it's... mostly possible on most systems, although some take a little more convincing than others
Narrator: you almost never need it 😉
(I remap my Caps key to Compose, and then add left-shift+right-shift as my Caps functionality, and even knowing it's there, I can't say I've intentionally used it more than once or twice in the last two decades. Caps-lock-as-is is SUCH a useless key 😛)
@mhoye starting my fish prompt with:
echo -n -s (jobs | wc -l) ' ' ...
This gives me a cue to `fg` again after Ctrl-Z'ing my editor to drop back to the shell
@mhoye
Using #Zellij #HelixEditor and #Starship prompt.
@mhoye This little helper function for managing jobs in Bash:
It had drastically reduced my reliance on tools like tmux or screen, or having multiple terminals open for different things
Also aliases like "...", "...." for jumping up multiple directory levels
https://codeberg.org/selfawaresoup/configurations/src/branch/main/bash_includes/aliases.sh#L8-L14
@mhoye The first tweak was mental: learning to always write `rm folder/subfolder` first, and then add `-rf` at the end once I’m done and the path is correct. It's a good way to avoid accidentally hitting Enter and deleting a parent folder you definitely did not want to delete.
The related tweak, on macOS, is installing GNU coreutils or uutils-coreutils and using the `rm` implementation from that instead of the macOS/BSD `/bin/rm`, which does not support options after the path(s):
```sh
$ /bin/rm some/dir -rf
rm: some/dir: is a directory
rm: -rf: No such file or directory
```
Or alternatively, as I’m doing now, using Nushell which has its own `rm` command as a built-in.
@mhoye Though my biggest quality-of-life tweak, whatever the OS I’m using, is making sure I have some form of clipboard history running, and learning the keyboard shortcuts to access it. My working memory is really bad, so I cannot survive without clipboard history.
@fvsch What are your preferred systems for this?
@totoroot @mhoye
I have one-letter aliases for my most-used commands and 2 letter aliases for another 20 or so where the single-letter abbreviation was already taken. Probably saved me a million keystrokes over my career so far. It also helps transition to a new functionally-similar command when needed, which explains "alias m=less".
Any scripts I write get iteratively shorter names as I use them more often, so I tend to name them with weird initial letters when I think they'll turn out to be generally useful.
@mhoye https://github.com/YaLTeR/niri is a really neat scrolling and tiling window manager. Coming from XFCE, I’d say that setting up a usable desktop environment around it is a bit of a pain, but actually using it is intuitive - unlike a lot of the other funky WMs, which feel like having to learn VI again.
@mhoye Using caps lock for a new layer that contains special character, symbols and umlauts.
It's pretty nice when ä is capslock+a, ẞ is capslock+shift+ß and – is capslock+-.
Very little to learn/remember.
Things I do on every new (to me) computer with a keyboard:
1. Remap caps lock to control
2. Install iterm2 and Inconsolata
3. docker, and alias dkr → docker run -it ... so that I can launch captive versions of RIPLs at various versions aka node:12, python:2.7 → dkr python:2.7 python
4. ...that's just the beginning...
@mhoye oh, since you mentioned utilities, I wrote a thing for systematic execution and maintenance of checklists. It's probably had the most impact on my effectiveness by far:
@mhoye I don’t remember on Linux because it’s been a while. On Windows 11 there is a built-in feature that seems to mostly work. On macOS there are a few good options, I’ve used Jumpcut, CopyClip 2, Maccy, and am currently using Raycast.
@dashdsrdash @chris @mhoye
The aphorism "no pets only cattle" isn't a tweak per se but has served me well over the years, especially when I was on a team that had 1000+ servers to manage. Haven't heard many others use that nomenclature though; your mention reminded me of it.
The pets v. cattle distinction is a useful one in a lot of situations. One of the things I teach students in my project course is "decide up front which of your feature ideas are pets and which are cattle", for example, because it makes decisions a lot easier later if time pressure gets bad.
The difference is pretty stark: I care deeply about the health and wellbeing of each of my "pet" systems, including all my personal machines and perhaps a dozen or two boxes at work.
I'm indifferent to whether or not dev-web-345 is working today, except in the sense that I want monitoring to tell me when it isn't. If I have to mark it dead and allocate another machine for that purpose, eh, that's the job.
Yeah, absolutely. If you've got the right eyes you can see the differences at a glance: does this machine have a name, or does it just have a slot in a naming convention?
@MichaelTBacon I can hear a 16 year old in the late 90s choosing the colors now....
"Dark Blue on Black is so l337! Now to set the rxvt transparency to 80% and install an awesome, complicated desktop image!"
@xinit @MichaelTBacon So, I feel exactly the opposite way about this.
Color in terminal systems is often done _badly_ yes, but that's a reason to figure out how to do it well, not to avoid it entirely. Debian defaults it to off and I think that's a missed opportunity.
@mhoye I have both my work MacBook and my personal Windows desktop connected to separate inputs on my monitor. I wrote scripts on each machine that use m1ddc(1) (on mac) and the Python monitorcontrol library (on Windows) to send input change commands to the monitor over DDC. Then I bound them to a button on my Stream Deck Mini to get one-tap switching between systems. My keyboard, mouse, and the stream deck are all connected to the monitor's USB hub, so this is just a nice built-in KVM.
@mhoye Instead of dealing with git submodules or package managers I manage my vim plugins with a couple of lines in a Makefile https://unwiredcouch.com/bits/2021/09/02/vim-package-managment-make.html
While I use a few aliases, I find that shell-functions are more predictable, especially with how they handle arguments. But yes, such time-savers, especially for convoluted/obtuse arguments.
I really need to move some of my common shell-history items into more static/persistent entries as aliases/functions in my shell RC file so I'm not relying on history quite so much 😬
@mhoye
I'm pro-color-ls but also very pro-accessible-by-default and that blue on black thing is the worst of things.
@MichaelTBacon
alias ec="emacsclient -nw"
bind '"\C-x\C-f":"ec "'
Looks like it fills roughly the same space as notmuch (which I've used on occasion) but handles MH and mbox, not just Maildir. Nice!
So many good tips in this thread.
For me, one of the biggest has been pushing as much as I can to plain-text because the Unix environment excels at handling it.
Calendar? Yep, kept in remind(1)
Finances? Yep, ledger(1) files
Time tracking for billing? Yep, also in ledger(1) facilitated by some wrapper shell-functions
Todo? Yep, todo.txt-style files (main one happens to be linked to my ~/.plan letting me use finger(1) to display it)
Documents? Yep, written with markup (usually HTML or Markdown), and converting them to desired output formats
Then everything can get checked into git and pushed to a repo on my VPS and synced back down to various machines I use.
Any $EDITOR works for manipulating them, I can grep them, or make automated transformations with sed/awk, etc. And that all works on ancient junker hardware with super low-end specs.
The fundamental thing about a terminal is that it should be usable and accessible from a wide range of devices, and you should make few assumptions about how it's going to be used.
I think having an environment variable that can be set by the calling process (whatever your xterm successor is) to enable it is fine. But if I ssh in from a remote server, don't give me any damned colors. I'm trying to check on a process, not getting fancy.
@MichaelTBacon @xinit Well, I was asking about personal machines here, not work tools. (And these days if you're SSH'ing into individual machines to look at individual processes, that's a process smell...)
But more generally... look, if you don't make room in your life for joy, your life will not have room for joy in it.
@mhoye @xinit I am weird, I get joy out of a 300 character perl one-liner that works perfectly!
But if we're talking personal/desktop machines here, if color ls is going to be a thing, here in the year 2025 the colors should change relative to background color. If I have a dark background (and I have a dark background, what are we, animals?) then have some kind of switch that changes dark blue to light cyan.
Using "," as first char in all custom functions/aliases: so much easier to find "your own" stuff. Use long names for functions (",helm-whatever"): usable tab completions is better than less typing. If I need it a lot: add an additional short alias.
Wezterm: works on all machines, same keyboard shortcuts everywhere.
direnv: autoactivate python venvs, autoload .env variables
Atuin to sync shell history across hosts: never lose history anymore when you witch computers. strl+r to search
@mhoye git absorb for managing a rebase heavy workflow: absorbs change as fixup commits into commits which last changes adjacent lines
@mhoye
git: worktrees; lazygit
shell: atuin; starship; ripgrep
@mhoye I have a shell script called $ that execs it's args:
#!/bin/sh
exec "$@"
So I can cut and paste a shell command that has a $ as a prompt from docs.
@stevenixon @mhoye yeah mine is `rbash` (remote bash) and it takes the name of a system and name of an environment as arguments. Handles ssh or kubectl or whatever else under the hood to just get me bash on some server, container, or pod.
`rbash cms production`
@mhoye my favorite quality of life tweaks are less about specific tools and more about ways of working:
- version control
- trunk-based development
- test-driven development
- pair programming
- continuous integration
- continuous delivery
@mhoye on MacOS with LogiTech MX Keys I've remapped the eject key to an emoji picker. I have no CD drive to open/close, but I want to type emojis often.
@mhoye @xinit @MichaelTBacon for readable terminal colors, I highly recommend Dracula Pro.
@mhoye It's minor, but I've had a Quake/visor-style terminal window on a hotkey since ~2010; I can summon my terminal from anywhere, but it's only in the foreground when I need it
@stevegrunwell tell me more about how you set this up.
@mhoye It used to be through some Cocoa script, but iTerm 2 has "visor" as an option.
You didn't specify Linux-only, so this is on my Mac 😉
@mhoye It's hard to say it's necessarily a favorite, but there's a simple clipboard affordance that doesn't exist in some of the non-macOS environments I use. Okay, fine, mostly Debian with a heavy GNU loadout.
alias pbcopy='xclip -i -selection clipboard'
alias pbpaste='xclip -o -selection clipboard'
This makes it a little easier to do simple hybrid stuff like [gui select] [gui copy] % pbpaste | sort | pbcopy [gui paste]
In terms of actual "favorite," it's probably the family of systems that are designed for managing unprivileged installation of scripting systems. perlbrew, pyenv, rbenv, that sort of thing. System perl / system python / system ruby are all platform infrastructure. Nothing deployable should be built on them.
alias e='emacsclient -n'
@mhoye How about hardware? I went through a bit of hand numbness recently and took the opportunity to re-do some of my ergonomics.
It wasn't RSI from the mouse, but I have been generally uncomfortable with mice for a while.
The Elecom Huge trackball is one of the rarest devices - a non-thumb-controlled trackball that's CHEAP. It only has one minor flaw with its bearings, but that's a popular YouTube fix.
@mhoye
I'm no hardcore dev but absolutely love Guake to dip in to the command line https://guake.github.io/
@mhoye alias "ll" to "ls -lavh"
That, and magit. I don't have it installed everywhere, and I really miss it where I don't have it.
@drimplausible @stephen setting them as the non-optional fonts in Firefox plus minimum font sizes is a lifesaver.
@mhoye I basically never want to use a Linux distribution that isn't NixOS or built in the same way. Fully declarative sysadmin is basically the only way I'm willing to do it now.
@mhoye I physically swap the f/d and j/k keys on any keyboard. This puts the raised bumps under the middle fingers in the home row, as God intended
@mhoye @drimplausible @stephen
If you use Android and are looking for a Mastodon client, Atkinson Hyperlegible is one of the fonts you can choose in #pachli.
https://pachli.app/pachli/2025/02/28/2.10.0-release.html#add-atkinson-hyperlegible-next-font
@mhoye sudo rm -rf /
@mhoye
Customise the Bash prompt to show Git and Python Venv statuses without conflict.
@mhoye Simple vim macro to write the selection to a temporary file, and a matching macro to read it.
Basically copy & paste between processes without having to rely on copy & paste.
@mhoye Hmm. Making a dot-env folder, and sourcing files from that.
It combines well with using ansible or some such to write stuff there.
@mhoye best quality of life, stop using Bash.
Use Fish Shell. Great autocomplete, nice shell functions.
Or use Nu shell.
Add in Atuin for history management.
Those changes are a big improvement for most users.
Add zoxide for getting where you want to be.
Then add modern utilities like eza, ripgrep, fd find, bat, delta (for git), fzf, dust, direnv, tfenv, helix or neovim, etc
1Password for Linux, it works great as SSH agent and for git signing. You can use `op` for loading secrets via plugins or use direnv.
git config with a list of aliases and using some of the above tools.