Window icon to move window to other monitor?

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
floweringmind
Level 2
Level 2
Posts: 59
Joined: Mon Jun 04, 2007 5:52 pm

Window icon to move window to other monitor?

Post by floweringmind » Sat Mar 16, 2019 3:18 pm

I know about the keyboard shortcut.
Is there a way to have an icon on the title bar that when click would move the window to the other monitor?

User avatar
secureIT
Level 3
Level 3
Posts: 164
Joined: Wed Dec 05, 2018 1:26 pm

Re: Window icon to move window to other monitor?

Post by secureIT » Mon Mar 18, 2019 4:17 pm

Hi,

you can do that with this script :

Code: Select all

#!/bin/bash
#script for moving active window to another monitor (side-by-side)
#name: movetoothermonitor.sh
#needs: xdotool wmctrl
wid=`xdotool getactivewindow`
max_state=`xprop -id $wid _NET_WM_STATE`

wmctrl -ir $wid -b remove,maximized_vert,maximized_horz
eval `xdotool getwindowgeometry --shell $wid`

new_x=1600
if [[ "$X" -ge "$new_x" ]]; then
  new_x=0
fi

xdotool windowmove $wid $new_x $Y
if [ -z "${max_state/*_NET_WM_STATE_MAXIMIZED_*/}" ]; then
  wmctrl -ir $wid -b add,maximized_vert,maximized_horz
fi
xdotool windowraise $wid
In order to run the script you have to install xdotool and wmctrl
put the script in ~/bin
make it executable
After that you can assign it to a starter
Command for the Starter :

Code: Select all

bash -c movetoothermonitor.sh
edit:
I know that this is not a window-icon, but it is another way to achieve what you want (without keyboard shortcuts)
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

Post Reply

Return to “Cinnamon”