Allora ragazzi, ben tornato a me, finalmente dopo molte vicissitudini posso riusare il mio amato Manjaro dove dire che è stata un pò un Odissea ma alla fine sono riuscito a rimettere la mia distro preferita.....
Comunque quest'oggi vi voglio illustrare come abilitare gli angoli in Manjaro XFCE e comunque in una qualsiasi distro che usi come DE XFCE la cosa è molto semplice e non prevede l'utilizzo di compiz, quindi c'è anche meno pesantezza nel sistema.
Partiamo:
Per abilitare gli angoli in xfce come come nei Desktop-environment tipo GNOME e Cinnamon è molto semplice, basta eseguire questa semplice procedura per creare uno script di esecuzione che gira sotto Python.
Per prima cosa installiamo i seguenti pacchetti da terminale:
sudo pacman -S python python-xlib wmctrl xdotool
NB:Nel caso usiate Debian based basta sostituire "pacman -S" con "apt install"
Molto probabilmente il pacchetto python risulterà già installato nel caso fosse cosi e non facesse installare nulla ripetere il comando eliminando la voce “python”.
Una volta fatto questo creiamo un file di testo semplice nella nostra home e chiamiamolo “bl-hotcorners” fatto ciò apriamo il nostro file e al suo interno copiamo il testo seguente:
#!/usr/bin/env python2.7
#
# bl-hotcorners: a script for adding hot corners to Openbox.
# Copyright (C) 2012 Philip Newborough <corenominal@corenominal.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Renamed for BunsenLabs
from Xlib import display
from Xlib.ext.xtest import fake_input
from Xlib import X
from subprocess import Popen, PIPE, STDOUT
import sys, time, os, ConfigParser, re
import argparse
check_intervall = 0.2
ap = argparse.ArgumentParser(description="Hotcorners")
ap.add_argument("-k", "--kill", help="attempt to kill any runnng instances",
action="store_true")
ap.add_argument("-d", "--daemon", help="run daemon and listen for cursor triggers",
action="store_true")
opts = ap.parse_args(sys.argv[1:])
p = Popen(['xdotool','getdisplaygeometry'], stdout=PIPE, stderr=STDOUT)
Dimensions = p.communicate()
Dimensions = Dimensions[0].replace('\n', '')
Dimensions = Dimensions.split(' ')
width = int(Dimensions[0])
height = int(Dimensions[1])
hw = width / 2
rt = width - 1
bt = height - 1
if opts.kill:
print "Attempting to kill any running instances..."
os.system('pkill -9 -f bl-hotcorners')
exit()
elif opts.daemon:
Config = ConfigParser.ConfigParser()
cfgdir = os.getenv("HOME")+"/.config/bl-hotcorners"
rcfile = cfgdir+"/bl-hotcornersrc"
bounce = 40
disp = display.Display()
root=display.Display().screen().root
def mousepos():
data = root.query_pointer()._data
return data["root_x"], data["root_y"], data["mask"]
def mousemove(x, y):
fake_input(disp, X.MotionNotify, x=x, y=y)
disp.sync()
try:
cfgfile = open(rcfile)
except IOError as e:
if not os.path.exists(cfgdir):
os.makedirs(cfgdir)
cfgfile = open(rcfile,'w')
Config.add_section('Hot Corners')
Config.set('Hot Corners','top_left_corner_command', 'gmrun')
Config.set('Hot Corners','top_right_corner_command', '')
Config.set('Hot Corners','bottom_left_corner_command', '')
Config.set('Hot Corners','bottom_right_corner_command', '')
Config.write(cfgfile)
cfgfile.close()
while True:
Config.read(rcfile)
time.sleep(check_intervall)
pos = mousepos()
if pos[0] == 0 and pos[1] == 0:
if Config.get('Hot Corners','top_left_corner_command') != '':
time.sleep(0.2)
pos = mousepos()
if pos[0] == 0 and pos[1] == 0:
mousemove(pos[0] + bounce, pos[1] + bounce)
os.system('(' + Config.get('Hot Corners','top_left_corner_command') + ') &')
mousemove(pos[0] + bounce, pos[1] + bounce)
time.sleep(2)
elif pos[0] == rt and pos[1] == 0:
if Config.get('Hot Corners','top_right_corner_command') != '':
time.sleep(0.2)
pos = mousepos()
if pos[0] == rt and pos[1] == 0 :
mousemove(pos[0] - bounce, pos[1] + bounce)
os.system('(' + Config.get('Hot Corners','top_right_corner_command') + ') &')
mousemove(pos[0] - bounce, pos[1] + bounce)
time.sleep(2)
elif pos[0] == 0 and pos[1] == bt:
if Config.get('Hot Corners','bottom_left_corner_command') != '':
time.sleep(0.2)
pos = mousepos()
if pos[0] == 0 and pos[1] == bt:
mousemove(pos[0] + bounce, pos[1] - bounce)
os.system('(' + Config.get('Hot Corners','bottom_left_corner_command') + ') &')
mousemove(pos[0] + bounce, pos[1] - bounce)
time.sleep(2)
elif pos[0] == rt and pos[1] == bt:
if Config.get('Hot Corners','bottom_right_corner_command') != '':
time.sleep(0.2)
pos = mousepos()
if pos[0] == rt and pos[1] == bt:
mousemove(pos[0] - bounce, pos[1] - bounce)
os.system('(' + Config.get('Hot Corners','bottom_right_corner_command') + ') &')
mousemove(pos[0] - bounce, pos[1] - bounce)
time.sleep(2)
Salviamo e chiudiamo, detto ciò col tasto destro sempre sul nostro file andiamo in proprietà e da qui nella finestra che si apre clicchiamo su “Permessi” e qui mettiamo la spunta a “Permetti di eseguire il file come un programma”, fatto questo chiudiamo tutto e apriamo il terminale nella nostra home con il tasto destro e diamo il seguente comando:
sudo mv bl-hotcorners /usr/bin
Fatto questo chiudiamo e riapriamo il terminale e diamo questo comando:
bl-hotcorners --daemon
Ora abbiamo abilitato i nostri angoli e abbiamo creato il nostro file di configurazione che troveremo abilitando la visione dei file nascosti e andando in /home/vostro nome utente/.config/bl-hotcorners
dentro questa cartella troveremo un file di testo che se andremo ad aprire potremmo modificare per aggiungere le applicazioni che vorremmo aprire nei nostri angoli, ecco un esempio:
[Hot Corners]
top_left_corner_command = xfdashboard
top_right_corner_command = skippy-xd
bottom_left_corner_command =
bottom_right_corner_command =
Nel mio caso ho abilitato xfdashboard nell’angolo alto sinistro e skippy-xd nell'angolo destro.
Detto ciò chiudiamo tutto e facciamo in modo che all’avvio il nostro sistema avvii in automatico bl-hotcorners senza tener per forza aperto il terminale, andiamo in “impostazioni” e qui apriamo “sessione e avvio” .
In avvio automatico clicchiamo su aggiungi e scriviamo le seguenti cose:
Nome:Angoli attivi
Descrizione:
Comando:bl-hotcorners -d
Clicchiamo su ok e il gioco è fatto, al prossimo riavvio avremo i nostri angoli attivi.
NB:skippy-xd deve essere abilitato in avvio altrimenti non funziona.
Ragazzi spero che questo piccolo tutorial vi sia piaciuto.....
Un saluto a tutti.....