diff options
author | Aaron LI <aaronly.me@gmail.com> | 2016-01-10 00:14:08 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@gmail.com> | 2016-01-10 00:16:37 +0800 |
commit | eb1cbb009dd8f98eb71db6ff00f741d5329465ee (patch) | |
tree | 3fdd158b108deea530cdebe21b11737bc9de6c19 /_config/openbox/scripts/urxvtq.sh | |
parent | 17c23577b823bced60ff0673d31611a1c7738fdd (diff) | |
download | dotfiles-eb1cbb009dd8f98eb71db6ff00f741d5329465ee.tar.bz2 |
Add quake-like urxvt to openbox
* `urxvtc.sh`, `urxvtq.sh`: quake-like urxvt terminal
* fix error application launch in rc.xml and menu.xml
* add suffix to scripts
Diffstat (limited to '_config/openbox/scripts/urxvtq.sh')
-rwxr-xr-x | _config/openbox/scripts/urxvtq.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/_config/openbox/scripts/urxvtq.sh b/_config/openbox/scripts/urxvtq.sh new file mode 100755 index 0000000..165daae --- /dev/null +++ b/_config/openbox/scripts/urxvtq.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Make a urxvt client behave like Quake with `xdotool`. +# +# Credits: +# [1] ArchWiki - rxvt-unicode - Improved Quake-like behavior in Openbox +# https://wiki.archlinux.org/index.php/rxvt-unicode#Improved_Kuake-like_behavior_in_Openbox +# [2] HOWTO: get a quake-like urxvt terminal in openbox +# https://bbs.archlinux.org/viewtopic.php?pid=550380 +# +# Aaron LI +# Created: 2015-01-09 +# Updated: 2015-01-09 +# + +this=$(realpath $0) +this_dir=$(dirname $this) + +wid=$(xdotool search --classname "^urxvtq$") + +if [ -z "$wid" ]; then + $this_dir/urxvtc.sh -name urxvtq -geometry 90x24 + wid=$(xdotool search --classname "^urxvtq$") + xdotool windowfocus "$wid" + xdotool key Control_L+l +elif [ -z "$(xdotool search --onlyvisible --classname '^urxvtq$' 2>/dev/null)" ]; then + xdotool windowmap "$wid" + xdotool windowfocus "$wid" +else + xdotool windowunmap "$wid" +fi + |