Showing posts with label Gnome. Show all posts
Showing posts with label Gnome. Show all posts

Friday, July 13, 2012

How to disable gnome-keyring in xubuntu

It seems like everytime I upgrade my computer, gnome keyring manager gets reinstalled. I don't want it. I can remember my passwords and I don't want the stupid keyring manager asking for a password everytime I try to do something simple, like commit a file with svn.

First, rename /usr/bin/gnome-keyring-daemon to /usr/bin/gnome-keyring-daemon.bak.

Find the running keyring daemon and kill it:
ps ax | grep keyring
kill -9 pid

Then remove the keyrings:
rm -rf ~/.gnome2/keyrings


Wednesday, June 2, 2010

Gnome and Aqualung keyboard shortcuts

Aqualung doesn't integrate into Gnome directly as far as keyboard shortcuts go.  What I want is to be able to press a key sequence and toggle pause and play.  It turns out to be pretty easy:

First, start Aqualung and make sure the pause and play buttons are combined.  There is a check box under Settings/General to combine them.

Then adjust Gnome:
1. Open gconf-editor
2. Drill down to apps/metacity/keybinding_commands
3. Double click on an empty command and enter:
aqualung -N0 --play
That is a zero.
4. Remember your command number, then go to apps/metacity/global_keybindings
5. Find the run_command that has the same number as your command number, then double click on it.
6. Type in the key sequence that you want for pause/play.  I used 
<Control><Alt>p


That's it.  

Update 26 May 2011: I've switched to using KDE rather than Gnome. Here's how to set up the same keyboard shortcut in KDE:

  1. Open the System Settings. On my installation, I click the "K", then Settings, then System Settings.
  2. Choose "Shortcuts and Gestures" from the Common Appearance and Behavior section.
  3. Select Custom Shortcuts.
  4. Click the Edit button (towards the bottom), then New, Global Shortcut, Command/URL.
  5. Enter a name for the new action, I used "Aqualung Pause/Play".
  6. On the Trigger tab, enter Ctrl+Alt+P by pressing those 3 buttons.
  7. On the Action tab, enter aqualung -N0 --play for the command.
  8. Click the Apply button at the bottom.
That's it.

Update 28 June 2011: I've dumped KDE and am now using Xubuntu. Here's how to set up the same keyboard shortcut for XFCE:

  1. Open the Settings Manager. On my installation, I click the gear in the panel, then Settings, then Settings Manager.
  2. Choose "Keyboard".
  3. Select the "Applications Shortcuts" tab.
  4. Click the "Add" button.
  5. Enter aqualung -N0 --play for the command, click the "OK" button.
  6. Press Ctrl+Alt+p.
That's it. 

Update 15 Dec 2011: I'm still using Xubuntu, but somewhere along the way something changed. For step 5 above, use this for the command:

aqualung -N0 --pause
 

Thursday, May 20, 2010

Ubuntu 10.04, how to fix the volume control

One more thing missing in Ubuntu 10.04: the volume control.  Apparently some knot-head at Canonical thought it would be a good idea to lump it in with the email/IM/Twitter notification applet, which I don't want to use.  I just want the volume control.  Here's how to put the old one back on the bar right now:

gnome-volume-control-applet &

To make it permanent, do this:

1. Go to System, Preferences, Startup Applications
2. Click Add
3. Enter these in the appropriate boxes:
Name: Volume Control
Command: gnome-volume-control-applet
Comment: Show desktop volume control
4. Save and close

Lots of whining about this screwup on the intertubes.

Friday, May 7, 2010

How to change password for Gnome Keyring Manager

I got a new laptop recently, then changed my login password shortly after installing Ubuntu. The Gnome keyring manager was still using the old password, so every time I restarted the machine, I was prompted for the keyring password. It isn't obvious how to change this. I did quite a bit of googling and found a lot of questions about it, but no solution that works for Ubuntu 10.04 with Gnome.

Here is the answer:

1. Log in as usual. Enter your old password in the keyring manager when it asks you to.
2. On the main Ubuntu menu, go to Accessories, Passwords and Encryption Keys.
3. On the Passwords tab, right click on "Passwords: login". This was the non-obvious part.
4. Choose "Change Password". Fill in your old password and your new password.

All done.

It looks like how this has been done has gone through a lot of changes over the past couple of years, so these instructions will likely be out of date when 10.10 comes out.

Wednesday, November 11, 2009

How to hide the drive icons on the Gnome desktop

By default, Gnome shows an icon on the desktop for each mounted partition. To hide these icons:

  1. Open a terminal.
  2. gconf-editor
  3. Drill down to /apps/nautilus/desktop
  4. Uncheck "volumes_visible"

Monday, November 9, 2009

Fixing AisleRiot

AisleRiot is a solitaire game that comes with Gnome. It's a lot like KPatience that comes with KDE. It provides a bunch of solitaire card games. However, the rules for Spider in AisleRiot are slightly different than the rules in Spider in KPatience. In KPatience, it is allowed to have an empty slot when laying out the next series of cards. In AisleRiot, this is not allowed. There are tactical advantages to allowing an empty slot, and the way I learned to play, it was allowed to leave one or more slots empty when turning up a new pile.

Here is how to make AisleRiot allow empty slots:
  1. sudo nano /usr/share/gnome-games/aisleriot/games/spider.scm
  2. Find this line:
    (define allow-empty-slots #f)
  3. Change #f to #t
  4. Save the file.
  5. Start the game.
This doesn't need to be done for the 3-deck version of Spider since it already allows empty slots.


 

Friday, November 6, 2009

How to run multiple instances of Firefox

So this issue is widely talked about on the internet with a lot of lame solutions involving creating multiple profiles. I don't want to create multiple profiles. I want to open new instances of Firefox at will. Not new windows, entirely new instances, and I want to use the same profile for all of them.

My situation is I installed Ubuntu 9.10 with Gnome. I don't particularly like Gnome, but I'll suffer it for a while, I suppose. In Gnome, you can add nifty application launchers so a single click will start the app. For Firefox, if you make the application launcher and click it once, Firefox opens. If you click it again, you get this dreaded message:

"Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system."

Big fat lie, that is. If I open a terminal window, and type "firefox", I get a new instance. I can do this over and over and create as many new instances as I want. But I can't do it from the launcher, which is annoying.

So here is how to do it:

  1. Create this script:

    #!/bin/bash
    nohup /usr/bin/firefox > /dev/null 2>&1 &
    sleep 2

    The 'nohup' line starts Firefox as a separate instance, the 'sleep' line gives that instance enough time to get started before the terminal exits.
  2. Save it somewhere and make it executable. I put it in my ~/bin directory and named it "firefox".
  3. Create an app launcher by right clicking on your panel and picking "Add to panel" from the menu.
  4. From Accessories, add Terminal (yes, Terminal, not Firefox).
  5. Right click on the terminal icon, and choose "Properties".
  6. In the "command" box, it says "gnome-terminal". Add a space and type in "--execute /home/danson/bin/firefox" or whatever the path is for where you saved the script in step 2.
  7. Change the icon to the firefox icon.
Multiple Firefoxes!

Making gnome-terminal start in home directory

I'd ran across this problem when running OpenBox, I think. The terminal would open in odd directories. After installing Ubuntu 9.10, the Gnome terminal would always open in / rather than in my home directory. Since terminal defaults to using bash as the shell, the fix is easy enough:

  1. Open ~/.bashrc in your favorite text editor.
  2. At the very bottom add this line: cd ~
  3. Save
Now every time you open a terminal, the starting directory will be your home directory.

Wednesday, July 22, 2009

Switched to LXDE

I took Openbox one step further and installed LXDE:

sudo apt-get install lxde

LXDE is a Lightweight X11 Desktop Environment. It looks pretty slick, and uses Openbox as the window manager. It also adds a few other things, like:

  • a session manager
  • a lightweight terminal
  • openbox for the window manager
  • a theme switcher
  • a network manager
  • a desktop panel
  • xscreensaver
I needed to do a little bit of customization right off the bat. The default web browser is "Web Browser", which is a Gnome project based on gecko. I prefer Firefox. The docs on lxpanel are pretty weak, so it's not obvious how to add things to it. You need a .desktop file, of which there are plenty in /usr/share/app-install and /usr/share/applications. It should be a matter of just point and click to pick the right desktop file, but it turns out lxpanel will only read desktop files from /usr/share/applications or /usr/local/share/applications. So I copied the firefox.desktop file from /usr/share/app-install to /usr/local/share/applications (this is a good place since this folder is likely empty or close to empty, so it is easy to figure out which desktop files are yours), then used the gui installer to add Firefox to the application launcher. I did the same with Thunderbird, and removed a couple of the pre-installed launchers.

The default install only creates 2 desktops, and I like 4. There is a nice gui configuration for Openbox, it allows changing the number of desktops to 4, but doesn't let you set wrapping, as in switching from desktop 1 to 2 to 3 to 4 to back to 1. To fix this, you need to edit the configuration file ~/.config/openbox/lxde-rc.xml. Find the keyboard bindings for "DesktopLeft" and "DesktopRight" and change the wrap element from "no" to "yes". You'll need to log out and back in for this to take effect, but prior to doing that, I want one more change.

In the past, I've always uninstalled Gnome's screensaver or KDE's screensaver and used xscreensaver. I've always used Ctrl-Alt-Delete to have xscreensaver lock the screen. To do that, edit lxde-rc.xml once again. There is already a keybinding setup that uses Ctrl-Alt-Delete, so I just replaced the command with "xscreensaver-command -lock". Now I log out and back in, and desktops wrap and xscreensaver locks.

There is probably a little more to configure, but the main things I want for usability are there.

I'm thinking seriously about uninstalling gnome altogether. I don't think I need it at all anymore.

Monday, July 20, 2009

Switched to Openbox

So apt-get told me I had a broken package, and recommended that I run apt-get with some parameters to clean things up. It said it would remove a bunch of packages, and the list looked okay to remove to me, mostly stuff that I didn't use anyway or I didn't know what was. Apparently, something in that list was essential, since Gnome disappeared. Hmm. A reboot left me at a command prompt. So I did "startx" and prayed, and did indeed at least get X to start.

I'd been wanting to try out Openbox anyway, so this seemed like a good time to do it. It turns out Openbox is probably the window manager I'd been looking for when I dumped KDE for Gnome. It is easy to install:

sudo apt-get install openbox

Add a line to your ~/.xinitrc file:
openbox-session

Then "startx" will start Openbox. Openbox is perhaps the most configurable window manager I've ever used. The downside is all the configuration is done by editing xml files by hand. For example, to get Open box to rotate from desktop 1 to 2 to 3 to 4 and back to 1, it was a simple matter of editing my ~/.config/openbox/rc.xml file to change <wrap>no</wrap> to <wrap>yes</wrap>, which was way easier than the scripts necessary to get Gnome to do the same thing.

There are a few things I'm missing that I haven't set up yet, but for the most part, I'm liking Openbox a lot.

Monday, May 11, 2009

Rotate desktops/workspaces in Gnome

I installed Ubuntu 9.04 on my work desktop computer with Gnome. It took me a while to figure out how to get more than 2 desktops to show:

1. Right click on the panel.
2. Choose "Add to panel"
3. Find "Workspace Switcher"
4. Click the "Add" button
5. In the panel, right click on the Workspace Switcher
6. Click "Preferences"
7. Adjust the number of workspaces

Apparently, multiple desktops are called "workspaces" in Gnome, where they are called "desktops" in KDE. Good to know.

After setting the number of desktops to 4, I removed the workspace switcher from the panel. I use keyboard shortcuts to switch, not point and click with the mouse.

Next, I realized that the keyboard shortcuts don't work as expected. I use Ctrl-Alt-Left and Ctrl-Alt-Right to move between desktops, but then I get to desktop #4, I expect that another Ctrl-Alt-Right will move to desktop #1. Not so. Much googling later, I found these instructions and scripts at

http://reachbeyondgrasp.blogspot.com/2008/01/wrapping-workspaces-in-gnome.html

I'll repeat the gist of that article here and add some additional detail. First, install wmctrl:

sudo apt-get install wmctrl

Then use the scripts. I'm posting the scripts here also for convenience. Just copy these scripts to two files, and make them executable:

------- ws_wrap_right.sh -----
#!/bin/bash

#ws_wrap_rt.sh

#get number of workspaces
ws=$(wmctrl -d | wc -l)

#current workspace index
cws=$(wmctrl -d | awk '/\*/ {print $1}')

#work space on right
rws=$(($cws+1))

#wrap if required
if [ $rws = $ws ]; then
rws=0
fi

#change to next workspace
wmctrl -s $rws


----- ws_wrap_left.sh -----
#!/bin/bash

#ws_wrap_lt.sh

#get number of workspaces
ws=$(wmctrl -d | wc -l)

#current workspace index
cws=$(wmctrl -d | awk '/\*/ {print $1}')

#work space on left
lws=$(($cws-1))

#wrap if required
if [ $lws = -1 ]; then
lws=$(($ws-1))
fi
echo $lws

#change to next workspace
wmctrl -s $lws

----- -----

Next, bind the keyboard shortcuts to these scripts:

1. Start gconf-editor (from a terminal or Alt-F2)
2. Drill down to /apps/metacity/keybinding_commands
3. Right click on command_1, select "Edit key"
4. Enter the full path to ws_wrap_left.sh
5. Click the "OK" button.
6. Right click on command_2, select "Edit key"
7. Enter the fuil path to ws_wrap_right.sh
8. Drill down to /apps/metacity/global_keybindings
9. Find run_command_1, right click, "Edit key", enter <control><alt>Left
10. Find run_command_2, right click, "Edit key", enter <control><alt>Right
11. Find switch_to_workspace_left, right click, "Edit key", clear the value
12. Find switch_to_workspace_right, right click, "Edit key", clear the value

Now workspaces should rotate completely, so when you're on desktop #4 and you press Ctrl-Alt-Right, you'll be on desktop #1.

Why does such a simple thing have to be so hard?

Saturday, April 25, 2009

Switched to Gnome

I tried to run KDE 4. It is nice looking, but just lacking features that used to be there in 3.5. The package manager is lame, Synaptic is better. The network configuration simply doesn't work, the Gnome Network Manager works well. The clock doesn't fit in it's allocated space, the first digit is hidden behind whatever is to the left of the clock. The last straw was Amarok. Version 2 totally sucks. I went ahead and installed Gnome, and it runs just as expected. It's still not as configurable as KDE 3.5, but it is more stable and the pieces fit and the pieces work. I installed Exaile to replace Amarok. It is nice and although it's a little unstable, it beats the abomination that Amarok has become.

I didn't make this decision lightly. I've used KDE for about 10 years, and instead of getting better, version 4 is worse. It's a good thing there are alternatives.