Show the launcher when the mouse enters a "trigger" area
The script below activates the (auto-hidden) launcher when the mouse pointer enters a certain area (activation area in the image).
Since it would not be convenient to have to draw an exactly straight line towards the targeted launcher icon, after the launcher is activated, I created an area of 200px from the left side of the (right) screen, in which you can freely move around without hiding the launcher again (the move area).

How to use
The script uses xdotool
to get the mouse position:
sudo apt-get install xdotool
Copy the script into an empty file, save it as trigger_launcher.py
In the head section of the script, I set the values as they should be appropriate to your screen combination and top-alligned. If you however would use the script with other screen (sizes) or you would like to alter the (trigger-) marges, you can change it in the head of the script:
# the script assumes the two screens are top-alligned (!)
#-- set the area to trigger the launcher (from left bottom of second screen) below:
vert_marge = 50
hor_marge = 200
#-- set the width of the left screen below:
width_screen1 = 1680
#-- set the height of the right screen below:
height_screen2 = 900
#---
Test-drive the script with the command:
python3 /path/to/trigger_launcher.py
If all works fine, add it to your Startup Applications: Dash > Startup Applications > Add. Add the command:
/bin/bash -c "sleep 15&&python3 /path/to/trigger_launcher.py"
The script
#!/usr/bin/env python3
import subprocess
import time
# the script assumes the two screens are top-alligned (!)
#-- set the area to trigger the launcher (from left bottom of second screen) below:
vert_marge = 50
hor_marge = 200
#-- set the with of the left screen below:
width_screen1 = 1680
#-- set the height of the right screen below:
height_screen2 = 900
#--
vert_line = height_screen2-vert_marge
hor_line2 = width_screen1+hor_marge
k = [" org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ ",
"gsettings set ", "launcher-hide-mode 1", "launcher-hide-mode 0"]
hide = k[1]+k[0]+k[2]; show = k[1]+k[0]+k[3]
def set_launcher(command):
subprocess.Popen(["/bin/bash", "-c", command])
def get_mousepos():
curr = subprocess.check_output(["xdotool", "getmouselocation"]).decode("utf-8")
return [int(it.split(":")[1]) for it in curr.split()[:2]]
current1 = get_mousepos()
while True:
time.sleep(0.3)
current2 = get_mousepos()
if not current1 == current2:
test1 = [int(current1[1]) > vert_line, width_screen1 < int(current1[0]) < hor_line2]
test2 = [int(current2[1]) > vert_line, width_screen1 < int(current2[0]) < hor_line2]
test3 = any([int(current2[0]) > hor_line2, int(current2[0]) < width_screen1])
if (all(test1), all(test2)) == (False, True):
set_launcher(show)
elif test3 == True:
set_launcher(hide)
current1 = current2
Edit
Below a version with a time break of 3 seconds, instead of a "move area", as you mentioned in a comment.
#!/usr/bin/env python3
import subprocess
import time
# the script assumes the two screens are top-alligned (!)
#-- set the area to trigger the launcher (from left bottom of second screen) below:
vert_marge = 50
hor_marge = 200
#-- set the with of the left screen below:
width_screen1 = 1680
#-- set the height of the right screen below:
height_screen2 = 900
#--
vert_line = height_screen2-vert_marge
hor_line2 = width_screen1+hor_marge
k = [" org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ ",
"gsettings set ", "launcher-hide-mode 1", "launcher-hide-mode 0"]
hide = k[1]+k[0]+k[2]; show = k[1]+k[0]+k[3]
def set_launcher(command):
subprocess.Popen(["/bin/bash", "-c", command])
def get_mousepos():
curr = subprocess.check_output(["xdotool", "getmouselocation"]).decode("utf-8")
return [int(it.split(":")[1]) for it in curr.split()[:2]]
current1 = get_mousepos()
while True:
time.sleep(0.3)
current2 = get_mousepos()
if not current1 == current2:
test1 = [int(current1[1]) > vert_line, width_screen1 < int(current1[0]) < hor_line2]
test2 = [int(current2[1]) > vert_line, width_screen1 < int(current2[0]) < hor_line2]
if (all(test1), all(test2)) == (False, True):
set_launcher(show)
time.sleep(3)
set_launcher(hide)
current1 = current2