superclick upd
parent
95995abb14
commit
3cdb05019d
|
@ -198,12 +198,12 @@ trainer(){
|
|||
case "$LANG" in
|
||||
pl*)
|
||||
TITLE="Trener SuperClick"
|
||||
MOUSE="przytrzymaj klawisz <kbd>super</kbd> i kliknij w wybrany obszar okna<br /><br /><em>...kolejne kliknięcia zmieniają rozmiar</em><br /><br /><a href='run://jgdeskgrid -s'><button type='button'> Konfiguruj ...</button></a>"
|
||||
MOUSE="przytrzymaj klawisz <kbd>super</kbd> i kliknij w wybrany obszar okna<br /><br /><em>...kolejne kliknięcia zmieniają rozmiar</em><br /><br /><a href='run://jgdeskgrid -s'><button type='button'> Konfiguruj ...</button></a><a href='run://viewnior /usr/share/mabox/img/superclick-keyboard.gif'><button type='button'> Demo (z klawiatury) </button></a>"
|
||||
KEYB="<em>z klawiatury: Super + KP_1..9</em>"
|
||||
;;
|
||||
*)
|
||||
TITLE="SuperClick trainer"
|
||||
MOUSE="hold <kbd>Super</kbd> key and click in appropriate area<br />of any window<br /><br /><em>...subsequent clicks change the size</em><br /><br /><a href='run://jgdeskgrid -s'><button type='button'> Configure ...</button></a>"
|
||||
MOUSE="hold <kbd>Super</kbd> key and click in appropriate area<br />of any window<br /><br /><em>...subsequent clicks change the size</em><br /><br /><a href='run://jgdeskgrid -s'><button type='button'> Config Menu ...</button></a><a href='run://viewnior /usr/share/mabox/img/superclick-keyboard.gif'><button type='button'> Keyboard Demo</button></a>"
|
||||
KEYB="<em>with keyboard: Super + KP_1..9</em>"
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
# superclick-desktop = actions for w-Leftmouseclick event on desktop
|
||||
|
||||
CONFIG_FILE="$HOME/.config/mabox/superclick-desktop.conf"
|
||||
|
||||
if [ ! -f ${CONFIG_FILE} ]; then
|
||||
cat <<EOF > ${CONFIG_FILE}
|
||||
# SuperClick on desktop config file
|
||||
# Sidearea width in pixels
|
||||
sidewidth=300
|
||||
# Commands to run on super + clik on left, center or right desktop area
|
||||
left_cmd="mb-jgtools places 2>/dev/null"
|
||||
center_cmd="jgdesktops -s 2>/dev/null"
|
||||
right_cmd="mb-jgtools right 2>/dev/null"
|
||||
EOF
|
||||
fi
|
||||
|
||||
# read config variables from file
|
||||
source <(grep = $CONFIG_FILE)
|
||||
|
||||
SIDEWIDTH=${sidewidth:-0}
|
||||
CENTER_CMD=${center_cmd:-"jgdesktops -s 2>/dev/null"}
|
||||
LEFT_CMD=${left_cmd:-"mb-jgtools places 2>/dev/null"}
|
||||
RIGHT_CMD=${right_cmd:-"mb-jgtools right 2>/dev/null"}
|
||||
|
||||
# TODO: Make it work on dual monitor setups - buy second monitor and look how it is implemented in superclick script ;)
|
||||
MON_WIDTH=$(xrandr | grep " connected" |awk '{print $3}' |awk -F[x+] '{print $1}')
|
||||
RIGHT=$((MON_WIDTH-sidewidth))
|
||||
|
||||
eval $(xdotool getmouselocation --shell)
|
||||
|
||||
if [ $X -lt ${sidewidth} ];then
|
||||
bash <<< "$LEFT_CMD"
|
||||
elif [ $X -gt ${RIGHT} ];then
|
||||
bash <<< "$RIGHT_CMD"
|
||||
else
|
||||
bash <<< "$CENTER_CMD"
|
||||
fi
|
|
@ -1,23 +0,0 @@
|
|||
<!DOCTYPE html><html><head><style>
|
||||
body{padding:0;margin:0;}
|
||||
.grid-container {display: grid;grid-template-columns: auto auto auto;gap: 1px;background-color: #113344;padding: 1px;height:100vh;}
|
||||
.grid-container > div {background-color: rgba(255, 255, 255, 0.8);color: #113344;text-align: center;font-size: 20vh;line-height: 33vh;}
|
||||
.grid-container > div.item5 {background-color: rgba(255, 255, 255, 0.8);color: #222222;text-align: center;
|
||||
font-size: 16px;
|
||||
font-weight:bold;line-height: 5vh;position:relative;}
|
||||
.grid-container > div.item5 span {position:absolute;left: 50%;transform: translate(-50%, 0);width:100%;}
|
||||
.grid-container > div:hover {background-color: #113344;color: yellow;}
|
||||
</style></head>
|
||||
<body><div class="grid-container">
|
||||
<div class="item1">↖</div>
|
||||
<div class="item2">↑</div>
|
||||
<div class="item3">↗</div>
|
||||
<div class="item4">←</div>
|
||||
<div class="item5"><span><br />hold <kbd>Super</kbd> key<br />and click<br />in appropriate area<br />of any window</span></div>
|
||||
<div class="item6">→</div>
|
||||
<div class="item7">↙</div>
|
||||
<div class="item8">↓</div>
|
||||
<div class="item8">↘</div>
|
||||
</div></body></html>
|
||||
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 61 KiB |
Loading…
Reference in New Issue