import mabox-terminal terminator wrapper
parent
80acd45dc7
commit
fd59eaa7d8
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Author: Daniel Napora <napcok@gmail.com>
|
||||
# "Show-Hide" terminal wrapper for terminator for use with keybind eg. super + enter.
|
||||
# Depenging on actual state it will start, show or hide terminal window.
|
||||
|
||||
ID=$(wmctrl -x -l | grep mabox-terminal | awk '{print $1}' | head -n 1)
|
||||
if [ -z "${ID}" ]; then
|
||||
TOP=$(wmctrl -d|grep "*"|awk '{print $8}'|cut -d',' -f2)
|
||||
LEFT=$[$(wmctrl -d|grep "*"|awk '{print $4}'|cut -d'x' -f1)/8]
|
||||
HEIGHT=$[$(wmctrl -d|grep "*"|awk '{print $4}'|cut -d'x' -f2)/2]
|
||||
WIDTH=$[${LEFT}*6]
|
||||
terminator -T mabox-terminal -b --geometry "${WIDTH}x${HEIGHT}+${LEFT}+${TOP}" -x "neofetch;/bin/bash"
|
||||
else
|
||||
ID_DEC=$((${ID}))
|
||||
ACTIVE_WIN_DEC=$(xdotool getactivewindow)
|
||||
if [ "${ACTIVE_WIN_DEC}" == "${ID_DEC}" ]; then
|
||||
xdotool windowminimize ${ID_DEC}
|
||||
else
|
||||
xdotool windowactivate ${ID_DEC}
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue