Skip to content

Playing nicely with fish shell

CraftedCart edited this page Oct 6, 2017 · 3 revisions

When running bspwm and sxhkd with the fish shell, there are a few things to keep in mind.

.xinitrc

In your .xinitrc you need to set the SXHKD_SHELL variable to /usr/bin/sh. Otherwise all sxhkd commands will be run with fish, which is a nice shell, but too slow for sxhkd, so it will add few fractions of a second to each sxhkd keypress event, making the whole system feel sluggish.
Neither starting sxhkd with -f 100(which I think is deprecated) or using a compositor like compton fixes this problem, so it is important you realize where it is coming from.

bash

If your .xinitrc is written in bash, i.e. your first line is

#!/bin/bash

your need to add the line

export SXHKD_SHELL='/usr/bin/sh'

before the lines starting sxhkd and bspwm.

fish

If your .xinitrc is written in fish shell syntax(maybe you do not like bash), i.e. your first line is

#!/usr/bin/fish

you need to add the line

set -g -x SXHKD_SHELL '/usr/bin/sh'

before the lines starting sxhkd and bspwm

sxhkdrc

Add this line to your sxkhdrc(in ~/.config/sxhkd/sxhkdrc):

#!/usr/bin/env sh

(Though I am not sure whether this is necessary)