Unity add/delete workspaces

Workspaces Unity

There’s no easy way to modify the number of workspaces in Unity – there is an option in Gconf but that’s not exactly user-friendly -, so MrChrisDruif has created an Unity icon (with quicklists) to easily add or remove workspaces rows/columns.

To download and copy the required files to the right locations, copy/paste the following commands in a terminal:

 wget http://webupd8.googlecode.com/files/workspaces.tar.gz tar -xvf workspaces.tar.gz chmod +x workspaces-shortcuts mv workspaces.desktop ~/.local/share/applications/ sudo mv workspaces-shortcuts /usr/local/bin/

Then, open Nautilus and navigate to ~/.local/share/applications/ (".local" is a hidden directory in your home folder so press CTRL + H to see it) and drag the "Workspaces" icon to the Unity launcher.

That’s it!

Unity workspaces quicklists

超炫的桌面

Unity + Cairo Doc,又实用又漂亮!

8 Useful Ubuntu Unity Quicklists

One of the useful features in Unity (Ubuntu Natty) is the adding of quicklists to the application icons in the launcher. For example, you can right click on the Google Chrome icon and access the option to open an incognito window, or right click the Gmail icon and select “Compose New Email” option. For those who came from the Windows background, this is very similar to the Windows 7′s taskbar jumplist.

How to add Unity Quicklists?

Ubuntu came out with an API for the Unity launcher and anyone can create their own quicklists with a different modification of the configuration file. Currently there is no easy way to add a quicklist item. The following is the summary of the steps required to add a quicklist item:

1. Copy the desktop configuration file to your home folder.
2. Open the desktop configuration file with gedit.
3. Add the quicklist code to the file. The syntax is as follow:

 #adapted from Ubuntu wiki. Example is for gnome-screenshot X-Ayatana-Desktop-Shortcuts=Screen;Window [Screen Shortcut Group] Name=Take a screenshot of the whole screen Exec=gnome-screenshot TargetEnvironment=Unity [Window Shortcut Group] Name=Take a screenshot of the current window Exec=gnome-screenshot -w TargetEnvironment=Unity

The X-Ayatana-Desktop-Shortcuts code refers to the entries that appear when you right click on the app icon. The following [XXX shortcut Group] is the action for each entry.

Some of the most useful Unity Quicklists

1. Add Private/Safe mode, Profile Manager and your frequently accessed site to Firefox icon.

unity-firefox

Copy the Firefox desktop configuration file to your home folder.

 sudo cp /usr/share/applications/firefox.desktop ~/.local/share/applications

Open the file with gedit.

 gedit ~/.local/share/applications/firefox.desktop

Replace the line

 X-Ayatana-Desktop-Shortcuts=NewWindow;

with

 X-Ayatana-Desktop-Shortcuts=NewWindow;Private;Safe;ProfileManager;MakeTechEasier #feel free to change the name of your frequently accessed site

Next, add the following code to the end of the file:

 [Private Shortcut Group] Name=Private Mode Exec=firefox -private-toggle TargetEnvironment=Unity [Safe Shortcut Group] Name=Safe Mode Exec=firefox -safe-mode TargetEnvironment=Unity [ProfileManager Shortcut Group] Name=Start Profile Manager Exec=firefox -ProfileManager TargetEnvironment=Unity [MakeTechEasier Shortcut Group] Name=Launch MakeTechEasier Exec=firefox "maketecheasier.com" TargetEnvironment=Unity

Save and close the file. Lastly, restart Unity

 unity --replace

2. Add New Window and Incognito Mode to Google Chrome

This is assuming that you have installed Google Chrome in your Ubuntu.

unity-google-chrome

Run the command:

 sudo cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications gedit ~/.local/share/applications/google-chrome.desktop

Add the following code to the end of the file:

 X-Ayatana-Desktop-Shortcuts=NewWindow;Incognito [NewWindow Shortcut Group] Name=Open New Window Exec=google-chrome TargetEnvironment=Unity [Incognito Shortcut Group] Name=Incognito Mode Exec=google-chrome --incognito TargetEnvironment=Unity

Save and close the file. Restart Unity

 unity --replace

3. Add Favorite and Bookmarks to Home Folder

This will allow you to access the various folders directly from the launcher.

unity-nautilus

Run the command:

 sudo cp /usr/share/applications/nautilus-home.desktop ~/.local/share/applications gedit ~/.local/share/applications/nautilus-home.desktop

Scroll down the file and replace the line:

 OnlyShowIn=GNOME;

with

 OnlyShowIn=GNOME;Unity;

Add the following code to the end of the file:

 X-Ayatana-Desktop-Shortcuts=Videos;Documents;Music;Pictures;Downloads;Dropbox [Videos Shortcut Group] Name=Videos Exec=nautilus Videos TargetEnvironment=Unity [Documents Shortcut Group] Name=Documents Exec=nautilus Documents TargetEnvironment=Unity [Music Shortcut Group] Name=Music Exec=nautilus Music TargetEnvironment=Unity [Pictures Shortcut Group] Name=Pictures Exec=nautilus Pictures TargetEnvironment=Unity [Downloads Shortcut Group] Name=Downloads Exec=nautilus Downloads TargetEnvironment=Unity [Dropbox Shortcut Group] Name=Dropbox Exec=nautilus Dropbox TargetEnvironment=Unity

Save and close the file. Restart Unity

 unity --replace

4. Make the LibreOffice Start Center More Useful

unity-libreoffice

Run the command:

 sudo cp /usr/share/applications/libreoffice-startcenter.desktop ~/.local/share/applications gedit ~/.local/share/applications/libreoffice-startcenter.desktop

Add the following code to the end of the file:

 X-Ayatana-Desktop-Shortcuts=Writer;Impress;Calc;Math;Draw [Writer Shortcut Group] Name=Writer Exec=libreoffice -writer %U TargetEnvironment=Unity [Impress Shortcut Group] Name=Impress Exec=libreoffice -impress %U TargetEnvironment=Unity [Calc Shortcut Group] Name=Calc Exec=libreoffice -calc %U TargetEnvironment=Unity [Math Shortcut Group] Name=Math Exec=libreoffice -math %U TargetEnvironment=Unity [Draw Shortcut Group] Name=Draw Exec=libreoffice -draw %U TargetEnvironment=Unity

Save and close the file. Restart Unity

 unity --replace

5. Add Custom Commands to the Terminal

The terminal is not an application that you will use frequently, but if you do, there will always be a few commands that you use regularly. You can add these commands to the quicklist for quick access.

unity-terminal

Run the command:

 sudo cp /usr/share/applications/gnome-terminal.desktop ~/.local/share/applications gedit ~/.local/share/applications/gnome-terminal.desktop

Scroll down the file and replace the line:

 OnlyShowIn=GNOME;

with

 OnlyShowIn=GNOME;Unity;

Next, add the following code to the end of the file:

 X-Ayatana-Desktop-Shortcuts=UpdateUpgrade;XamppStart;XamppStop; [UpdateUpgrade Shortcut Group] Name=Update and Upgrade System Exec=gnome-terminal --command "sudo apt-get update && sudo apt-get upgrade" TargetEnvironment=Unity [XamppStart Shortcut Group] Name=Xampp Start Exec=gnome-terminal --command "sudo /opt/lampp/lampp start" TargetEnvironment=Unity [XamppStop Shortcut Group] Name=Xampp Stop Exec=gnome-terminal --command "sudo /opt/lampp/lampp stop" TargetEnvironment=Unity

Save and close the file. Restart Unity

 unity --replace

6. Create a Google Services Center

If you use Google services as much as I do, this is going to be very useful to you.

unity-google-services

Open a text editor and copy/paste the following code:

 [Desktop Entry] Version=1.0 Name=Google Services Exec=/opt/google/chrome/google-chrome Icon=/filepath/to/google-icon.png #change this filepath to the actual icon filepath Terminal=false Type=Application Categories=Network;WebBrowser; X-Ayatana-Desktop-Shortcuts=Gmail;Contacts;Calendar;Docs;Reader; [Gmail Shortcut Group] Name=Gmail Exec=xdg-open https://gmail.com TargetEnvironment=Unity [Contacts Shortcut Group] Name=Gmail Contacts Exec=xdg-open https://www.google.com/contacts TargetEnvironment=Unity [Calendar Shortcut Group] Name=Google Calendar Exec=xdg-open https://calendar.google.com TargetEnvironment=Unity [Docs Shortcut Group] Name=Google Docs Exec=xdg-open https://docs.google.com TargetEnvironment=Unity [Reader Shortcut Group] Name=Google Reader Exec=xdg-open https://google.com/reader TargetEnvironment=Unity

Remember to change the icon file path (You can download the Google icon that I used here.) The code above uses Google Chrome. You can change it to use Firefox or your favorite browser.

Save the file with the name “google-services.desktop” in the folder “/home/username/.local/share/applications folder

Next, drag this file to the launcher.

7. Add Google Shortcut

Instead of accessing the Google services, if what you want is to have quick access to the various tasks in Google, like composing new email, adding a calendar, open a new doc etc, this is how you can do it.

unity-google-shortcuts

Open a text editor and copy/paste the following code:

 [Desktop Entry] Version=1.0 Name=Google Shortcuts Exec=/opt/google/chrome/google-chrome Icon=/filepath/to/google-icon.png #change this filepath to the actual icon filepath Terminal=false Type=Application Categories=Network;WebBrowser; X-Ayatana-Desktop-Shortcuts=Gmail;Calendar;Docs;Spreadsheet;Presentation; [Gmail Shortcut Group] Name=Compose New Mail Exec=xdg-open https://mail.google.com/mail/?shva=1#compose TargetEnvironment=Unity [Calendar Shortcut Group] Name=Create New Event Exec=xdg-open https://www.google.com/calendar/event?action=TEMPLATE TargetEnvironment=Unity [Docs Shortcut Group] Name=Create New Document Exec=xdg-open https://docs.google.com/document/create?hl=en TargetEnvironment=Unity [Spreadsheet Shortcut Group] Name=Create New Spreadsheet Exec=xdg-open https://spreadsheets.google.com/ccc?new&hl=en TargetEnvironment=Unity [Presentation Shortcut Group] Name=Create New Presentation Exec=xdg-open https://docs.google.com/present/create?hl=en TargetEnvironment=Unity

Remember to change the icon file path.

Save the file with the name “google-shortcuts.desktop” in the folder “/home/username/.local/share/applications folder

Next, drag this file to the launcher.

8. Quick Add PPA in Ubuntu Software Center

Our usual method of adding PPA is via the terminal, but this could be a more efficient way.

unity-usc

Run the command:

 sudo cp /usr/share/applications/ubuntu-software-center.desktop ~/.local/share/applications gedit ~/.local/share/applications/ubuntu-software-center.desktop

Add the following code to the end of the file.

 X-Ayatana-Desktop-Shortcuts=SoftwareProperties;SoftwareSources; [SoftwareProperties Shortcut Group] Name=Update Manager Exec=update-manager -c %u TargetEnvironment=Unity [SoftwareSources Shortcut Group] Name=Add/Edit PPAs Exec=gksu software-properties-gtk TargetEnvironment=Unity

Save and close the file. Restart Unity

 unity --replace

The above are only a small fraction of what you can do with the Unity quicklists. You can also checkout AskUbuntu for more quicklists.

Note: If after adding the quicklist code and it causes problems to your system, you can easily restore your system by deleting the respective .desktop file from /home/username/.local/share/applicationsfolder and restart unity.

Display Gnome system monitor in Unity

System Load Indicator Ubuntu

Yet another much requested AppIndicator is now available for Ubuntu 11.04: an indicator to display the network speed as well as CPU, Memory usage and more called System Load Indicator (or "Indicator Multiload").

This is a port of the original System Monitor GNOME Panel applet to appindicators and Vala. This means it has most of the features the System Monitor Applet had: display processor, memory, network, swap space, load or hard disk activity, change the colors and so on using an Ubuntu indicator..

There’s one catch though: because Ubuntu appindicators can’t display a tooltip, you won’t be able to see the actual network speed, CPU and Memory usage and so on but only a graph. For a more detailed CPU / memory Ubuntu AppIndicator, see: System Monitor Indicator Puts The CPU And Memory Usage On Your Panel

 sudo add-apt-repository ppa:indicator-multiload/stable-daily sudo apt-get update sudo apt-get install indicator-multiload

Once installed, launch System Load Indicator from Dash.

$> indicator-multiload

Dell XPS 15 Ubuntu 11.04 nVidia driver install

使用这个方法,显卡终于驱动了!!!注意,安装bumblebee 之前最好重新安装显卡驱动,并且删除xorg.conf文件

$ sudo apt-get purge nvidia-current
$ sudo apt-get install nvidia-current
$ sudo rm /etc/X11/xorg.conf

然后执行下面的步骤安装bumblebee,设置的时候忘记选哪个了,但应该都好使。

Dell XPS 15 (L502X)running linux (ubuntu 11.04) with nvidia optimus support

with 2 comments

I ended up with a snazzy new Dell XPS for my birthday. A dream laptop for me, it even included a fancy 2 gig video card.

It came with Windows 7 (which I don’t have a direct problem with) but my preference when I compute at home is to use linux. I partitioned part of it off and loaded up the new lubuntu. Install went fine but the sucker ran hot, loud, sucked the battery and the gpu seemed to be on but not in use. Something definitely seemed off.

This lead me on a search which explained about the nvidia Optimus GPU and people struggling with this on linux.

What is Optimus?

This is a technology created by Nvidia to switch off the power hungry GPU when not needed. On my laptop it switchs from the beefy 2 gig Nvidia GPU to the onboard Intel GPU. So when not gaming or doing graphic intense work, the system is running on less power (thus longer battery, less fan noise, heat, etc).

The problem?

Nvidia did not produce any Optimus drivers for linux and has stated that there are no plans to support it on linux. Typically in the past Nvidia has supplied some closed source drivers for their nvidia cards.

The solution?

The Bumblebee Project! After digging around on the ubuntu forums, I was ready to give up. Many people stated that nvidia would not be writing this driver and there is no current solution. Then murmurs of the Bumblebee project came about. A bit buggy at first, it has really started to gain steam. I’ve been using it error free for a while and really am happy to have my laptop running somewhat smooth.

And it just got easier to install if you are using debian/ubuntu. Bumblebee has now been packaged into a PPA @ Launchpad.

First thing you’ll want to do is add the repository:

sudo apt-add-repository ppa:mj-casalogic/bumblebee

Then update and install:

sudo apt-get update && sudo apt-get install bumblebee

It’ll take you through the installer which will ask you which profile you want to use. At this point from what I understand these are successful profiles submitted. All of the ones for my laptop have worked just fine.

After the install you can launch a program using the command optirun

Example: optirun java -jar ~/Downloads/minecraft.jar

This will launch minecraft using the nvidia card.

At the time of writing there is also:

Arch, OpenSuSE, Fedora, Mint support.

Ubuntu 11.04: Add the classic Gnome Menu to Unity Panel System Tray

Ubuntu 11.04 Fix: Add the Classic Gnome Menu (Applications/System/Wine) to the Unity Panel System Tray

While Ubuntu‘s new Unity interface has been designed for less clutter, and generally makes getting to common tasks a breeze, many have found navigating through the rest a bit of a nightmare. While everything is supposed to be more simplified, some would argue having all your launchers accessible via categories in the old Applications menu was actually simpler and quicker.

But you can actually have the best of both worlds, so if you’re avoiding Unity and using the Classic Desktop simply for access to the Applications and System (orWine) menus, read ahead.

While you can’t actually add the old menu system to the Unity panel, since it is notgnome-panel that is running, there is actually an “indicator” available for Unitythat will do the same thing. So while this new (or old?) menu won’t replace Unity‘s “Dash“, you will see an Ubuntu icon in your system tray’s notification area. Click that, and you will see the old familiar Applications menu, with all the categories you’re used to.

To install Classic Menu Indicator, enter the following commands in sequence in a terminal:

sudo add-apt-repository ppa:diesch/testing

sudo apt-get update

sudo apt-get install classicmenu-indicator

Once installed, hit Alt+F2 and enter classicmenu-indicator as the command to run.

Apart from easy access to all your launchers, you’ll find your old System menu is there too, split into the familiar Preferences and Administration sub-menus.

More importantly for many, you will also have your old Wine menu back forrunning Windows programs. Unity‘s Dash menu system does not currently show a Wine section, and finding those apps can be near-impossible, butclassicmenu-indicator will rectify this.

If you find that this menu/indicator does not automatically run upon your next boot (which it should), simply add classicmenu-indicator to your Startup Applications, and it will be forced to load from then onwards (it should already be in there, so check it isn’t disabled).