Define a custom shortcut for Compiz Window Manager

Ralf Mardorf silver.bullet at zoho.com
Fri Apr 22 09:02:24 UTC 2016


On Fri, 22 Apr 2016 10:34:09 +0200, Ralf Mardorf wrote:
>either
>
>window="0x$(printf '%x\n' $(xdotool getactivewindow))"
>
>or, since there's no need to use hex
>
>window="$(xdotool getactivewindow)"

Wrong, the OP needs hex to get the original size for the math:

$ window="0x0$(printf '%x' $(xdotool getactivewindow))"
            ^
            ^ The hex lenght is tricky for grep

$ window="$(printf '%x' $(xdotool getactivewindow))"

works without "0x", but for the other command "0x" is needed, but
not necessarily "0x0".

$ win_w=$(wmctrl -l -G | grep $window | cut -d" " -f11)
$ win_h=$(wmctrl -l -G | grep $window | cut -d" " -f12)
$ echo $win_w $win_h
1152 808
$ wmctrl -l -G
0x00600003 -1 0    0    1025 32   archlinux panel
0x00c0001d -1 1026 0    126  32   archlinux panel
0x01000003  0 0    80   1152 808  archlinux Rocketmouse - Claws Mail 3.13.2
0x01400012  0 0    80   1152 808  archlinux Inbox (49315 unread) - Evolution
0x01a00003  0 0    80   1152 808  archlinux Unknown Crewman - Sylpheed 3.5.0
0x02200004  0 0    80   1152 808        N/A Linux Commando: Quick hex / decimal conversion using CLI - QupZilla
0x01c00007  0 0    80   1152 808  archlinux rocketmouse at archlinux:~




More information about the ubuntu-users mailing list