Powered By

Powered by Blogger

Tampilkan postingan dengan label expo. Tampilkan semua postingan
Tampilkan postingan dengan label expo. Tampilkan semua postingan

Sabtu, 15 Januari 2011

Create A Gnome Panel Icon For Triggering The Compiz Expo Plugin (Like In Unity)

Expo Compiz

If you've tried (or seen some video) Unity, you've surely noticed the Compiz Expo icon on the Unity dock (launcher). There is no Gnome panel applet to do this but you can do this thanks to xautomation. Here is how to replicate this behavior in any Ubuntu version, using the normal Gnome desktop.


1. Install xautomation and CCSM:
sudo apt-get install compizconfig-settings-manager xautomation



2. Set a Compiz Expo plugin key binding:

Compiz expo plugin key binding


Go to System > Preferences > CompizConfig Settings Manager and enable the "Expo" plugin. Then click it and on the "Bindings" tab, set a keyboard shortcut for the "Expo key" (first item on the list) - I've set "e" so that's what I am going to use for the commands in this post.



3. Optional: multiple desktop rows:


Compiz expo multiple desktop rows

By default, expo displays one big wall, but if you want multiple rows (like in Unity - and in my screenshot), go to CompizConfig Settings Manager, click on "General options" and on the "Desktop Size" tab, set the "Vertical Virtual Size" to some number larger then 1. I've used "2" for both "Horizontal Vertical Size" and "Vertical Virtual Size".



4. Create a new custom application launcher:

Custom application launcher

Right click on a Gnome panel, select "Add to panel" and add a "Custom Application Launcher". Set the following image as its icon (this is the icon used in Unity, you can however use whatever icon you want):


Compiz expo
(save it to your computer)


For your custom launcher name enter whatever you want and under "Command", enter this:
xte 'keydown Super_L' 'key e' 'keyup Super_L'
(This assumes you've used "e" as the Expo key binding under step 2, if not, modify it to whatever custom keybinding you've used). 


That's it! Save the custom application launcher and try it out.


See also:



Post inspired by UbuntuLife, however the method used in this post is different.

Rabu, 18 Agustus 2010

How To Add / Delete Workspaces In Compiz Using Keyboard Shortcuts

Compiz expo screenshot

If you tried Gnome Shell, you probably noticed how cool it is to quickly add / delete workspaces using the + / - buttons. Deafiant @ Ubuntuforums wanted this for Compiz so he wrote a script which can be used to add or delete a workspace on the fly by using a keyboard shortcut (not using buttons like in Gnome Shell, but the result is pretty much the same). Can't wait to try this out? Read on!

Create the script

To use this script, create a file in your home folder (or anywhere else) and name it "workspace".

Then paste this in the newly created file:
#!/bin/bash
case $1 in
add) ACTION="+" ;;
del) ACTION="-" ;;
esac
WS=$(dbus-send --print-reply --type=method_call \
--dest=org.freedesktop.compiz /org/freedesktop/compiz/core/screen0/hsize \
org.freedesktop.compiz.get | tail -c -2)

dbus-send --type=method_call --dest=org.freedesktop.compiz \
/org/freedesktop/compiz/core/screen0/hsize \
org.freedesktop.compiz.set int32:$[ $WS $ACTION 1 ]
exit 0
And save the file.


Now you must make the script executable. If you created the file in your home folder and named it exactly like we wrote in this post, simply run the following command:
chmod +x ~/workspace

Assign Keyboard shortcuts to the script

We're almost done! Now you must bind this script to some keyboard shortcuts. Assuming you already have CCSM installed, go to System > Preferences > CompizConfig Settings Manager, under "General" make sure the "Commands" option is enabled and then click it.

If you don't have any other custom commands added on the "Commands" tab, under "Command line 0" add this: "~/workspace add" (without the quotes) and for "Command line 1", add: "~/workspace del" - if you followed our exact instructions; if not, use your script path. Here is a screenshot with how it should look:

compiz commands

Then switch to the "Key bindings" tab and assign a key combination for command 0 and command 1 such as "Ctrl Alt +" for adding a new workspace and "Ctrl Alt -" for deleting a workspace. Of course, you can add any other key combinations, just make sure nothing else uses the exact same shortcut. You can also assign it Button Bindings or Edge Bindings.

Try it out

Now you can try it out. Enable the "Expo" plugin in Compiz and press "Super + E" (where "Super" is the Windows logo button on the left of your keyboard) and then use the keyboard shortcut you've set up to add or delete a workspace.



Credits for the script: deafiant (many thanks!). Also thanks to Anno Nymus for the simplified script!