aboutsummaryrefslogtreecommitdiffstats
path: root/_config
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@gmail.com>2016-01-10 00:14:08 +0800
committerAaron LI <aaronly.me@gmail.com>2016-01-10 00:16:37 +0800
commiteb1cbb009dd8f98eb71db6ff00f741d5329465ee (patch)
tree3fdd158b108deea530cdebe21b11737bc9de6c19 /_config
parent17c23577b823bced60ff0673d31611a1c7738fdd (diff)
downloaddotfiles-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')
-rw-r--r--_config/openbox/menu.xml7
-rw-r--r--_config/openbox/rc.xml33
-rwxr-xr-x_config/openbox/scripts/pipemenu-places.pl (renamed from _config/openbox/scripts/pipemenu-places)0
-rwxr-xr-x_config/openbox/scripts/urxvtc.sh21
-rwxr-xr-x_config/openbox/scripts/urxvtq.sh32
-rwxr-xr-x_config/openbox/scripts/xcompmgr.sh25
-rwxr-xr-x_config/openbox/scripts/xdg-menu.py (renamed from _config/openbox/scripts/xdg-menu)0
7 files changed, 80 insertions, 38 deletions
diff --git a/_config/openbox/menu.xml b/_config/openbox/menu.xml
index e13a5a3..c8472d5 100644
--- a/_config/openbox/menu.xml
+++ b/_config/openbox/menu.xml
@@ -22,7 +22,7 @@
<separator />
<item label="_Terminal">
<action name="Execute">
- <execute>urxvtc || urxvt || x-terminal-emulator</execute>
+ <command>sh -c 'urxvtc || urxvt || x-terminal-emulator'</command>
</action>
</item>
<item label="_Web browser">
@@ -37,7 +37,7 @@
</item>
<item label="_Editor">
<action name="Execute">
- <execute>gvim || mousepad</execute>
+ <execute>sh -c 'gvim || mousepad'</execute>
</action>
</item>
<separator />
@@ -64,7 +64,7 @@
</item>
</menu>
<separator />
- <menu id="places" label="_Places" execute="~/.config/openbox/scripts/pipemenu-places ~/" />
+ <menu id="places" label="_Places" execute="~/.config/openbox/scripts/pipemenu-places.pl ~/" />
<separator />
<menu id="client-list-menu" />
<separator />
@@ -78,7 +78,6 @@
<item label="Restart">
<action name="Restart" />
</item>
- <separator />
<item label="Exit">
<action name="Exit" />
</item>
diff --git a/_config/openbox/rc.xml b/_config/openbox/rc.xml
index d7398d7..d0de25b 100644
--- a/_config/openbox/rc.xml
+++ b/_config/openbox/rc.xml
@@ -383,25 +383,26 @@
<command>scrot -s -e 'mv $f ~/pictures'</command>
</action>
</keybind>
- <!-- Application launch -->
- <keybind key="W-f">
+ <!-- Launch applications -->
+ <keybind key="W-t">
<action name="Execute">
- <command>thunar</command>
+ <command>sh -c 'urxvtc || urxvt || x-terminal-emulator'</command>
</action>
</keybind>
- <keybind key="W-k">
+ <!-- Quake-like terminal -->
+ <keybind key="W-grave">
<action name="Execute">
- <command>xkill</command>
+ <command>~/.config/openbox/scripts/urxvtq.sh</command>
</action>
</keybind>
- <keybind key="W-t">
+ <keybind key="W-f">
<action name="Execute">
- <command>urxvtc || urxvt || x-terminal-emulator</command>
+ <command>thunar</command>
</action>
</keybind>
- <keybind key="W-Enter">
+ <keybind key="W-k">
<action name="Execute">
- <command>urxvtc || urxvt || x-terminal-emulator</command>
+ <command>xkill</command>
</action>
</keybind>
<keybind key="C-A-Delete">
@@ -956,6 +957,20 @@
# end of the example
-->
+
+ <!-- Quake-like terminal with urxvt -->
+ <application name="urxvtq">
+ <decor>no</decor>
+ <position force="yes">
+ <x>center</x>
+ <y>0</y>
+ </position>
+ <desktop>all</desktop>
+ <layer>above</layer>
+ <skip_pager>yes</skip_pager>
+ <skip_taskbar>yes</skip_taskbar>
+ <maximized>Horizontal</maximized>
+ </application>
</applications>
</openbox_config>
diff --git a/_config/openbox/scripts/pipemenu-places b/_config/openbox/scripts/pipemenu-places.pl
index 812eb27..812eb27 100755
--- a/_config/openbox/scripts/pipemenu-places
+++ b/_config/openbox/scripts/pipemenu-places.pl
diff --git a/_config/openbox/scripts/urxvtc.sh b/_config/openbox/scripts/urxvtc.sh
new file mode 100755
index 0000000..087253f
--- /dev/null
+++ b/_config/openbox/scripts/urxvtc.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Start urxvt client, and start urxvt server first if necessary.
+#
+# 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
+#
+
+urxvtc "$@"
+if [ $? -eq 2 ]; then
+ urxvtd -q -o -f
+ urxvtc "$@"
+fi
+
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
+
diff --git a/_config/openbox/scripts/xcompmgr.sh b/_config/openbox/scripts/xcompmgr.sh
deleted file mode 100755
index e59eb6a..0000000
--- a/_config/openbox/scripts/xcompmgr.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-case "$1" in
- set)
- killall xcompmgr
- sed -i 's/#xcompmgr.*$/xcompmgr \&/g' ~/.config/openbox/autostart.sh
- xcompmgr &
- ;;
- unset)
- sed -i 's/^xcompmgr.*$/#xcompmgr \&/g' ~/.config/openbox/autostart.sh
- killall xcompmgr
- ;;
- setshaded)
- killall xcompmgr
- sed -i 's/#xcompmgr.*$/xcompmgr -CfF \&/g' ~/.config/openbox/autostart.sh
- xcompmgr -CfF &
- ;;
- setshadowshade)
- killall xcompmgr
- sed -i 's/#xcompmgr.*$/xcompmgr -CcfF \&/g' ~/.config/openbox/autostart.sh
- xcompmgr -CcfF &
- ;;
- *)
- echo "This script accepts the following arguments : set, setshaded, setshadowshade, unset"
-esac
diff --git a/_config/openbox/scripts/xdg-menu b/_config/openbox/scripts/xdg-menu.py
index 0a8c1bc..0a8c1bc 100755
--- a/_config/openbox/scripts/xdg-menu
+++ b/_config/openbox/scripts/xdg-menu.py