aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2016-08-05 01:48:13 +0200
committerGravatar Tom Willemse2016-08-05 01:48:13 +0200
commit393087e8a5c73542192d0e06c92f8dd5ea1eb4ba (patch)
tree86bcc191e20a1eb7bfc41a4b80e46f6c16f3c3a2
parent6cabddd647c877e25b9c3f341117e516f89ff781 (diff)
downloadnew-dotfiles-393087e8a5c73542192d0e06c92f8dd5ea1eb4ba.tar.gz
new-dotfiles-393087e8a5c73542192d0e06c92f8dd5ea1eb4ba.zip
Add rofi configuration
-rw-r--r--rofi/.config/Xresources/Rofi.conf6
-rwxr-xr-xrofi/.config/herbstluftwm/autostart.d/rofi.sh14
-rw-r--r--rofi/.config/rofi/windows.conf3
-rwxr-xr-xrofi/usr/bin/hlwm-switch-to-window8
-rw-r--r--x11/.Xresources1
5 files changed, 32 insertions, 0 deletions
diff --git a/rofi/.config/Xresources/Rofi.conf b/rofi/.config/Xresources/Rofi.conf
new file mode 100644
index 0000000..3b4cc33
--- /dev/null
+++ b/rofi/.config/Xresources/Rofi.conf
@@ -0,0 +1,6 @@
+! Use a nice font.
+rofi.font: Fantasque Sans Mono 15
+
+! Add C-g to the keys used to cancel an action in Rofi. I am used to
+! this from Emacs and I always press it before I press ESC.
+rofi.kb-cancel: Escape,Control+bracketleft,Control+g
diff --git a/rofi/.config/herbstluftwm/autostart.d/rofi.sh b/rofi/.config/herbstluftwm/autostart.d/rofi.sh
new file mode 100755
index 0000000..22fe03e
--- /dev/null
+++ b/rofi/.config/herbstluftwm/autostart.d/rofi.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env zsh
+
+if ! whence hc; then
+ function hc() { herbstclient "$@"; }
+fi
+
+# Run things with rofi
+hc keybind Mod4-r spawn rofi -show run -m 0
+
+# Use a special rofi configuration that allows windows to be locked by
+# herbstluftwm.
+hc keybind Mod4-w spawn rofi -show window -m 0 \
+ -window-command "$HOME/usr/bin/hlwm-switch-to-window {window}" \
+ -config "$HOME/.config/rofi/windows.conf"
diff --git a/rofi/.config/rofi/windows.conf b/rofi/.config/rofi/windows.conf
new file mode 100644
index 0000000..d520d5d
--- /dev/null
+++ b/rofi/.config/rofi/windows.conf
@@ -0,0 +1,3 @@
+! -*- mode: conf-xdefaults; -*-
+rofi.kb-accept-entry: Control+Return,Shift+Return
+rofi.kb-accept-custom: Control+j,Control+m,Return,KP_Enter
diff --git a/rofi/usr/bin/hlwm-switch-to-window b/rofi/usr/bin/hlwm-switch-to-window
new file mode 100755
index 0000000..4a722db
--- /dev/null
+++ b/rofi/usr/bin/hlwm-switch-to-window
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+winid="0x$(printf "%x\n" $1)"
+tag=$(herbstclient attr clients.$winid.tag)
+herbstclient chain \
+ , silent substitute M tags.by-name.$tag.my_monitor focus_monitor M \
+ , use $tag \
+ , jumpto $winid
diff --git a/x11/.Xresources b/x11/.Xresources
new file mode 100644
index 0000000..f7876cb
--- /dev/null
+++ b/x11/.Xresources
@@ -0,0 +1 @@
+#include ".config/Xresources/Rofi.conf"