A script that does it all: Define a custom shortcut for Compiz Window Manager
Ralf Mardorf
silver.bullet at zoho.com
Fri Apr 22 11:16:08 UTC 2016
On Fri, 22 Apr 2016 12:19:41 +0200, Ralf Mardorf wrote:
>The executable script:
>
>$ cat /usr/local/bin/win75
>#!/bin/bash
>window="$(printf '%x' $(xdotool getactivewindow))"
>win_w=$(wmctrl -l -G | grep $window | cut -d" " -f11)
>win_h=$(wmctrl -l -G | grep $window | cut -d" " -f12)
>w=$(echo $win_w | awk '{printf($1*0.75)}')
>h=$(echo $win_h | awk '{printf($1*0.75)}')
>wmctrl -i -r 0x$window -b remove,maximized_vert,maximized_horz
>wmctrl -i -r 0x$window -e 0,-1,-1,$w,$h
>exit
The dirty fixed script:
$ cat /usr/local/bin/win75
#!/bin/bash
window="$(printf '%x' $(xdotool getactivewindow))"
win_w=$(wmctrl -l -G | grep $window | cut -d" " -f11)
win_h=$(wmctrl -l -G | grep $window | cut -d" " -f12)
w=$(echo $win_w | awk '{printf($1*0.75)}' | cut -d"." -f1)
h=$(echo $win_h | awk '{printf($1*0.75)}' | cut -d"." -f1)
wmctrl -i -r 0x$window -b remove,maximized_vert,maximized_horz
wmctrl -i -r 0x$window -e 0,-1,-1,$w,$h
exit
I'm quite sure that there is a simple solution for the math, what I'm
doing most likely is a joke, but it works.
More information about the ubuntu-users
mailing list