Hacker News new | ask | show | jobs
by hprotagonist 1266 days ago
~/.config/i3/config:

  # emacsclient
  set $em_daemon ~/.local/bin/em

  # make a quick launcher for specific things I do all the time
  bindsym $mod+o mode "spotlight"

  mode "spotlight" {
       ## specific files in a new emacs buffer
       # dired in home
       bindsym d exec $em_daemon ~/; mode "default"
       # ibuffer
       bindsym e exec $em_daemon --eval "(ibuffer)"; mode "default" #
       # guaranteed new scratch buffer
       bindsym s exec $em_daemon --eval '(switch-to-buffer (format-time-string "%d %b %Y %H:%M:%S"))'; mode "default"

       ## common binaries
       bindsym f exec firefox ; mode "default"
       bindsym h exec --no-startup-id zeal ; mode "default"
       bindsym j exec --no-startup-id ~/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox ; mode "default"
       bindsym m exec --no-startup-id mendeley ; mode "default"
       bindsym k exec --no-startup-id keepassxc ; mode "default"
       ## special launchers
       # ipython
       bindsym i exec zsh -c '$alacritty -e ~/.local/pipx/venvs/ipython/bin/ipython'; mode "default"
       # app switcher
       bindsym a exec "rofi -show window -show-icons -theme gruvbox-dark-hard.rasi"; mode "default"
       ## just in case we did this by mistake
       bindsym Escape mode "default"
  }
6 comments

Exactly what I came in to say: why reach for a function key when you have ~26 good letters and a bunch of modifiers right under your fingers?
This. It makes more sense to bind apps to homerow keys with some chain or modificator to "snipe" often-used applications instead of F-keys.
Not if you suffer from RSI and you want to use as few key strokes as possible. I really don't understand this trend towards minimalist keyboards. I want more keys, not fewer.

I mean, a pianist also doesn't put everything on their home row.

Funny, RSI of a different kind is what pushed me to a minimalist keyboard. I pay the cost of increased complexity to avoid the strain of reaching distant keys.
That I do understand. But, for instance, I reach for my F keys with my entire hand, not by doing funny & painful movements with my fingers.
More of a mnemonic in my case, not just homerow, but yeah launching frequented apps has never been more fluid than when I switched to my tiling WM.
You can also get most of this configuration-free in Gnome. [Super] key switches to a spotlight context; one alphabetic letter focuses the most frequently used app with that prefix; and [Enter] key launches it without prompt.
I like what you've done. Here's a snippet from my i3 that I use atleast 5 times a day:

#generate password "pwgen -sy 32" and send to clipboard (uses s to generate more symbols) Also, the NEWLINE is stripped from the end. [tr -d '\n']

    bindsym $mod+F12 exec "pwgen -sy 32 1 | tr -d '\n' | xclip"
lovely, I never thought of using emacsclient as a global wm entrypoint

ps: I think I need to write an i3-whichkey that displays the current set of bindings because I often forget my own config :)

wait until you find out about exwm
Oh I know about it, I'm just willingly not reading more as I'm already lagging behind :D
This is what I was thinking. Someone needs to introduce the OP author to a tiling window manager.
I like the mode idea, wonder if I can get an equivalent in KDE.
Maybe checkout https://vickychijwani.me/blazing-fast-application-switching-.... Personally I use jumpapp which does more or less the same thing. https://github.com/mkropat/jumpapp.
I meant for example, if I hit Meta+o then I could press any single key after that.. i.e. 't' for terminal, 'f' for file manager, 'b' for browser. KDE doesn't support that, as far as I know.. nothing built in, anyways.
True nothing fully built in. With jumpapp installed though and adding Custom Shortcuts, I have the following:

    Alt  B --> Browser (eg Firefox)

    Alt  K --> Konsole

    Alt  T --> Thunderbird

    Alt Z --> zim

    Alt D --> doom
jumpapp will open the app if it is not open and switch to it if it is open. It's way to handy to forgo IMHO. But jumpapp is a dependency, true.