• # Ma solution

    Posté par (site web personnel) . En réponse au message Une console sur mon bureau GNOME. Évalué à 3.

    Je vais vous faire partager mes scripts. J'utilise devilspie1 patché2 que je lance avec mon ~/.Xsession. J'utilise aussi wmctrl3. J'utilise xbindkeys* pour associer la touche menu (remappée grace à xmodmap) pour lancer drop-down-console. Pour desktop-terminal, j'ai choisi de créer un terminal qui n'est pas partagé entre les différents bureaux et que je lance manuellement (avec une icone dans le gnome-panel). On verra si c'est le plus pratique à l'usage :)
    Notes:
    1 http://www.burtonini.com/blog/computers/devilspie
    2 http://bugzilla.gnome.org/show_bug.cgi?id=330067
    2 http://bugzilla.gnome.org/attachment.cgi?id=64351&action(...)
    3 http://www.sweb.cz/tripie/utils/wmctrl/
    * http://hocwp.free.fr/xbindkeys/xbindkeys.fr.html 
    fichier ~/.local/desktop-terminal
    #! /bin/sh
    class="desktop-terminal"
    profile="desktop"
    gnome-terminal --disable-factory --class="$class" --window-with-profile="$profile" "$@"
    exit $?
    
    fichier ~/.devilspie/desktop-terminal.ds
    (if
    	(is (window_class) "desktop-terminal")
    	(begin
    		(undecorate)
    		;(pin) ;; all workspaces ?
    		(skip_pager)
    		(skip_tasklist)
    ;; with this we can't have the nautilus desktop
    		(maximize)
    		;(above) ;; does nothing
    		(wintype "desktop")
    ;; with that we can have our desktop but the terminal
    ;; is hidden when we press the button 'show desktop'
    		;(below)
    		;(maximize_vertically)
    		;(geometry "-0+0")
    	))
    
    fichier ~/.local/bin/drop-down-terminal (pas parfait du aux limitations de wmctrl et a son incompatibilité avec devilspie)
    #! /bin/sh
    cmd="1ドル"
    [ -n "2ドル" ] && shift 1
    class="drop-down-terminal"
    profile="drop-down"
    hide_desktop=0
    shown_file="`dirname "0ドル"`-shown-`whoami`"
    debug(){
    	echo "$@"
    	return $?
    }
    exists(){
    	debug "check $class"
    	wmctrl -x -l | grep -q gnome-terminal."$class"
    	return $?
    }
    not_exists(){
    	debug "check $class"
    	wmctrl -x -l | grep -q gnome-terminal."$class" && return 1 || return 0
    }
    show(){
    	debug "show $class"
    	wmctrl -x -R gnome-terminal."$class" -b remove,below
    	wmctrl -x -R gnome-terminal."$class" -b remove,shaded,above
    	touch "$shown_file"
    	return $?
    }
    hide(){
    	debug "hide $class"
    	wmctrl -x -r gnome-terminal."$class" -b remove,above
    	wmctrl -x -r gnome-terminal."$class" -b add,shaded,below
    	wmctrl -x -r gnome-terminal."$class" -t $hide_desktop
    	rm -f "$shown_file"
    	return $?
    }
    toggle(){
    	debug "toggle $class"
    	#wmctrl -x -R gnome-terminal."$class" -b toggle,shaded
    	#wmctrl -x -R gnome-terminal."$class" -b toggle,above,below
    	if [ -e "$shown_file" ]; then
    		hide
    	else
    		show
    	fi
    	return $?
    }
    create(){
    	debug "create $class"
    	gnome-terminal \
    		--class="$class" \
    		--window-with-profile="$profile" \
    		--disable-factory "$@" &
    	res=$?
    	
    	touch "$shown_file"
    	
    	while not_exists; do echo -n; done
    	#while exists && false || true; do
    	#	wmctrl -x -l
    	#done
    	
    	wmctrl -x -R gnome-terminal."$class" -b add,maximized_horz,above
    	wmctrl -x -R gnome-terminal."$class" -e 0,0,0,-1,-1
    	
    	return $res
    }
    if [ "$cmd" = "show" ]; then
    	exists && show || create
    	exit $?
    elif [ "$cmd" = "hide" ]; then
    	hide
    	exit $?
    elif [ "$cmd" = "toggle" ]; then
    	exists && toggle || create
    	exit $?
    else
    	exists && toggle || create
    	exit $?
    fi