Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Sunday, 31 May 2026

I just want to paste something - Ubuntu keyboard shortcuts

Last time, I wrote about wrestling with the Ubuntu display server, Wayland, to get a clipboard manager working. This involved a lot of research and fiddling with settings I'd forgotten existed.

So we're coming back to this (and this series is building to a point, I promise) because important keyboard shortcuts weren't working, and I couldn't figure out why.

Again, for credit - I used ChatGPT and Claude to help investigate everything, as well as lots of The Internet of course.

The setup

Specifically, I noticed that Ctrl+Shift+V (paste without formatting) had stopped working - nothing happened at all. Right-clicking and selecting "Paste without formatting" from the menu worked fine, so the clipboard itself was functioning correctly.

None of the obvious things seemed to work, so in we go.

Tally ho

Yeah so clearly something had broken - presumably something was capturing the keyboard event somewhere. But where to start? I can debug Ubuntu, but it's not a forte of mine so let's start with Claude.

According to Claude, the first suspect was IBus, Ubuntu's input method framework, which is known to grab Ctrl+Shift+V for Unicode character entry. Killing the IBus daemon ruled it out.

Next I checked GNOME's built-in keyboard shortcuts using gsettings:

gsettings list-recursively | grep -i "ctrl.*shift.*v\|<Primary><Shift>v"
gsettings list-recursively org.gnome.shell.keybindings | grep -i shift
gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys | grep -i shift

Lo and behold - nothing useful came back.

A test in Firefox showed this wasn't a Chrome anomaly, which made it likely the interception was happening at the OS level, not in the browser.

So where is it?

Claude had me go looking for a running clipboard manager (which was odd, since it knew GPaste was running having just helped me get it working) but a process grep "revealed" GPaste (shock):

ps aux | grep -iE "copyq|gpaste|autokey|xbindkeys|keyd|espanso|ulauncher|albert"

GPaste does grab paste-related shortcuts, although I'd previously manually checked through the shortcuts. Re-inspecting its own settings showed Ctrl+Shift+V wasn't listed there.

The real breakthrough came from using wev, a Wayland event viewer:

wev | grep -A2 "sym\|state"

This showed that when pressing Ctrl+Shift+V, the V key only ever produced a release event, never a press. Something was consuming the keypress at the GNOME Shell level, before it ever reached Wayland or the browser.

Claude went back to GPaste at this point, and the GPaste GNOME Shell extension. It does operate at exactly that level, but disabling it and logging out didn't fix the problem - the keydown event was still being swallowed.

No really, where is it?

A final breakthrough came from querying dconf directly, which shows much lower level configuration than gsettings:

dconf dump / | grep -i "shift.*v\|ctrl.*v" | grep -iv "audio\|volume\|XF86"

This revealed a custom keybinding with Ctrl+Shift+V. Inspecting it further:

dconf dump / | grep -B5 "Shift><Control>v"
dconf dump /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/

Showed this:

binding='<Shift><Control>v'
command='/usr/bin/diodon'
name='Diodon'

Oh hello Diodon - you're still here. Apparently, despite being uninstalled months ago, my old clipboard manager did not clear up properly when it was uninstalled. Or possibly I'd written an extra shortcut and forgotten? Either way, there was a leftover GNOME keybinding, orphaned but causing problems. The binary was gone, so the shortcut did absolutely nothing, but it was still intercepting the keypress at the Shell level and swallowing it.

Execute Order 66

dconf reset -f /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/

One command, instant fix, no restart required.

Conclusion

This was interesting. I did essentially end up editing the blasted registry again, which is a really poor state of affairs and as I said before, something I thought Linux had moved past. But here we are.

More interesting was the journey Claude and I went on together. I could have debugged this myself, but this isn't information I retain in my brain, so I'd have been looking everything up. By letting Claude take the lead, the investigation was certainly quicker, but also took a very different path.

Instead of methodically isolating the exact place where the keypress event was being intercepted, I would have gone to dconf sooner, and without a detour through gsettings. I'd have used my experience and intuition to bypass some stages of diagnosis. If I remembered all the relevant commands, that probably would have been quicker.

That said, if that intuitive guess had proven wrong I'd have been much more lost. I hadn't used wev before, so I'd have been starting from scratch entirely there. Plus I actually fixed this alongside doing something else, whereas working solo would have required direct focus and likely I'd have put it off for much longer.

So was Claude helpful here? Undoubtedly yes, but not quite in the way I expected - and here we are getting to the point of this trilogy (oh yes - there is a point) which is about how we work collaboratively with AI, and how we learn through this process. But that's next time!


This post is part of a series:

Monday, 27 April 2026

I just want to paste something - Ubuntu clipboard managers

Every so often I need to remind myself I can still do technical things. Then I feel the urge to write about it. This time, the rabbit hole starts with Ubuntu clipboard managers, and leads to debugging the desktop itself.

Digging into the nuts and bolts of the desktop is something I don't do very often, so I'm keeping some notes for posterity.

Credit - I used ChatGPT and Claude to help investigate everything, as well as lots of The Internet of course.

The setup

I've run Ubuntu on my laptop for many years. Ubuntu is great, but for some reason it doesn't come with a built-in clipboard manager. I ran Diodon for a long, long time - simple and handled everything I needed. Sadly, it stopped working a while back so I removed it and tried other options - none of which worked.

More setup

After lots of digging, plus some conversations with Claude, it became clear the problem was with the display server, Wayland. This has an enhanced security model over X11 which stops many of the top listed clipboard managers working - presumably including Diodon, back in the day. The solution was either to switch back to X11 (which then breaks support for touchpad swipes between desktops) or to use GPaste. Which also doesn't work.

Sigh

Yeah it's one of those problems. So down the rabbithole we go...

So, by default GPaste is blocked by the same security as the others. We can register it as a trusted shell extension ... if we have the extensions app installed... which we don't by default...

sudo apt install gnome-shell-extension-prefs

Ok, back on track. We can register it as a trusted shell extension with the extensions app:

gnome-extensions enable GPaste@gnome-shell-extensions.gnome.org

Which allows it to load properly (appears top right). Copy also now adds things to the clipboard list. If you're following along at home and it doesn't, turn on "Track changes" in the UI and all should be well.

Pasting from history?

Now you're able to click on the manager, look at the list and pick the entry you want to be on the clipboard. For me, doing this with the mouse destroys about 2/3 of the point of a clipboard manager - may as well just navigate back to the original data and copy from there. I need a keyboard shortcut to open the history except... the keyboard shortcuts don't seem to work.

Hhgggnnnn.

No matter - I can just change the binding to something. Except the rebinding screens don't work. Can't type into the boxes, and it doesn't capture keypress.

Argh.

This is, according to Claude, a "known quirk" with GPaste's settings UI. Which seems a polite way of saying "it's broken". Claude recommends setting it directly from the command line:

gpaste-client settings --set-string shortcuts-show-history "<Ctrl><Shift>H"

Yeah, that didn't work either. Silently ignored.

Now we're breaking out dconf-editor (which also needed installing) and navigating to:

/org/gnome/gpaste

and editing directly there.

And finally, finally it's working.

Conclusion

Well, this was frustrating. A stupidly long runaround to get to something that even Windows has built-in by default now. And the fixes are exactly the kind of thing that put normal people off using Linux - the kind of thing I thought we'd moved past a long time ago. Breaking out dconf-editor is the equivalent of having to use regedit for crying out loud.

On the Wayland / X11 choice, the touchpad gestures were fixable in X11 with some work. The real reason I didn't switch back was because I try to keep my Linux desktop as vanilla as possible. It seems likely that Wayland is the future for Ubuntu, so unless I want to change distro I may as well accept that.

Right, enough of this for the moment. More coming...


This post is part of a series:

Saturday, 27 December 2014

Ubuntu 14.10, finally

I seem to have gotten into the habit of writing a post each time I do an upgrade, so here is the one for Ubuntu 14.10. It's really easy - by far the simplest upgrade I can remember. This, I'm sure, is partly because the changes behind the scenes this time are more about stability than new features but it's a welcome change. Nothing, and I mean nothing has broken for me either on my desktop install or this laptop.

I can't say I'm immediately noticing many improvements either, other than the latest packages. Not that I'm complaining - mostly, an obvious improvement means a change and frankly I like Ubuntu 14.04 enough as it was that it didn't need another overhaul to make me happy. Some minor bugs have been ironed out - the big one is that it no longer randomly forgets my keyboard language preferences.

So, don't fear this one. For me, this is the perfect upgrade - nothing broken and no major changes to learn.

Wednesday, 23 July 2014

Ubuntu 14.04 - here we go

Quick post about the upgrade from Ubuntu 13.10 to 14.04. It went ahead without any real problems. For the first time my decision to disable the utterly horrible "shopping" lens in Unity was honoured over an upgrade (well done - finally).

Bad things: the window close buttons have wandered over to the left AGAIN. This time apparently Canonical have removed the all of the options to move them back (well, someone is recommending recompiling the window manager but there is no way I'm doing that). Thanks guys, that's really helpful.

Further bad things: synaptiks is currently missing from the Ubuntu repositories so if you want a middle mouse click on your touchpad you're out of luck. Fortunately there is a way around that - you can install it from the debian repository:

sudo apt-get update
sudo apt-get install wget gdebi
wget http://http.us.debian.org/debian/pool/main/s/synaptiks/kde-config-touchpad_0.8.1-2_all.deb
sudo gdebi kde-config-touchpad_0.8.1-2_all.deb

That solution pulled from here.

Now to man up and do this on my work machine...

Tuesday, 23 October 2012

Quantal Quetzal - second impressions

Printing has broken. Sigh.

This is actually a cups issue, not an Ubuntu one - Ubuntu has simply included the latest version of cups in its repositories. Sadly, cups 1.6 removes the network discovery feature so if you're using it, your printer list post-upgrade will look rather barren.

There are an assortment of bugs opened about this issue. Here's hoping someone forks or patches the project.

Monday, 22 October 2012

Quantal Quetzal - upgrade and first impressions

The new version of Ubuntu is out. In a fit of enthusiasm I upgraded my work machine this morning. Turns out that although the new version is out, it hasn't been out long enough for the packages to all make their way across - consequently I'm without my ldap browser of choice, luma. Sigh. Hopefully this will resolve itself in the not too distant future.

Mostly a simple upgrade otherwise. Just a couple of things broken:
  • autofs now needs to restart on network up instead of reload else it doesn't mount properly
  • needed a new method for moving the window close buttons
  • some glitches with the window manager (which seem to have gone away on their own)
  • slower boot times
  • keyboard shortcuts reset (thanks...)
  • shopping in lens (remove with "sudo apt-get remove unity-lens-shopping" although you'll need to restart your window manager)
Fairly painless all in. I just don't recommend doing it for a week or two. The lack of a decent ldap browser wont bother most people but the Unity config tools we've all come to depend upon have also yet to make the jump and their absence will be more annoying.

New things? Well, there is the incredibly annoying shopping integration in the Unity lens which presented me with something that looked suspiciously like porn for the 30 seconds it survived before I killed it. Upgrades? I'm sure there are some of those too.

Friday, 6 July 2012

Nautilus since Ubuntu 12.04

For the record, a collection of things I've had to learn about nautilus since Ubuntu 12.04:
  • alt + up / down (or alt + left / right) navigate the breadcrumb trail from the keyboard
  • ctrl + l switches the breadcrumb trail for a more traditional address box and gives focus
  • F9 disables / restores the left panel
  • apt-get install nautilus-open-terminal provides an "open terminal" option in the right click menu
Not very exciting, but at least I'll remember it next time I have to install a system now...

Friday, 1 June 2012

Configure the window close buttons in Ubuntu 12.04

One thing I really don't like about Ubuntu if the insistence in putting the close window button in the top left. I don't know if this is a Linux thing, but I'm sure older versions defaulted to close in the top right.

Anyway, you can easily change it.

* install gconf-editor
* navigate to /apps/metacity/general/
* find button_layout and change it to whatever you like

The key to the positioning of the buttons is the colon. I went with:
:minimize,close
because I don't really care about maximize. Everything to the right of the colon is floated right.

Another tweak worth considering if you're a keyboard shortcut person is rebinding "Key to show HUD" in the Keyboard config screen. That is the one which, if your experience is anything like mine, is capturing your keypress when you try and alt-tab around.

Edit:
Since 12.10 it seems the gconf-editor setting is sometimes ignored. You can move everything by running this on the command line:
sudo gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"

Friday, 18 May 2012

Restore u300s touchpad on resume in Ubuntu

I have finally found the time to fix the touchpad on my u300s. It was causing problems on resume from hibernate (as per notes from before). After a bit of poking around I've found a work-around.

I have synaptics which applies its changes on boot, however I have a problem with resume. Solution is this script:
#!/bin/sh

# Restore three finger tapping

case "${1}" in
    resume|thaw)
        # faster speed and acceleration
        DISPLAY=:0.0 su  -c "/usr/bin/synclient MinSpeed=1 MaxSpeed=2.81 AccelFactor=0.13"
        # 2 fingers scroll
        DISPLAY=:0.0 su  -c "/usr/bin/synclient VertTwoFingerScroll=1 HorizTwoFingerScroll=1"
        # enable tap to click (2 fingers for middle click, 3 fingers for right click)
        DISPLAY=:0.0 su -c "/usr/bin/synclient TapButton1=1 TapButton2=2 TapButton3=3"
        ;;
esac
Put in /etc/pm/sleep.d/ called something like 80_touchpad_restore and remember to make it executable. Done - mouse settings will be set as per this script on resume from hibernate.

Solution was cobbled together from here, here and here.

Playing with <audio>

I was looking for a better option than directory listings for making a folder of mp3 files accessible on a website so I wrote a very simple php loop.
Initially I omitted the firefox support (firefox doesn't play mp3 files) then, when adding it, I needed to convert my mp3 files into oggs. Step forward dir2ogg which is completely perfect:
dir2ogg -d .
Will quite happily convert all the mp3 files in the current dir to oggs. What more could you ask for?

Getting it on ubuntu is as simple as:
apt-get install dir2ogg

Friday, 11 May 2012

How to play Star Wars - Harmy's Despecialised Edition

Are you one of those fans who think the Star Wars original trilogy has gotten worse with each successive release? Do you get angry watching Han Solo step on Jabba's tail and not get his face shot off? Do you go on about Han shooting first? Or wonder where the mountain went in the twin sun sunset?

In short, are you a human being?

Help is at hand, from a chap named Harmy. This colossus of a man has created a "despecialized" edition - basically an upscaling with all the new additions taken out. You can find the iso files here.

Actually playing them is a bit of a trick. The first (platform non-specific) tip is:

Make sure your files are not corrupted.

Seriously. That cost me a couple of evenings.

Windows 7

* mount the iso as a drive using daemon tools
* download vlc - I have this running with version 2.1
* in vlc do media -> open file -> select your virtual drive -> bdmv -> stream -> m2ts file

Et voila!

Linux

* mount the drive thus:
sudo mount -o loop -t udf $path_to_iso/ANH.ISO $mountpoint
* download vlc or pull it from a repository (package name vlc in ubuntu)
* in vlc do media -> open file -> mountpoint -> bdmv -> stream -> m2ts file

Suddenly you're back in the past, watching Star Wars version awesome.

Thursday, 10 May 2012

Installing Ubuntu 12.04 on a Lenovo u300s

After a bit of faffing I have Ubuntu 12.04 running on my Lenovo u300s.

Important info:

* You can build a usb installer using the utility here
* It is possible to keep One Touch restore working and nuke all of Windows if you're brave with the partition table
* Windows will keep booting until you remove the small partition no matter how many times you think you've deleted it - presumably the mbr is in there?
* The touchpad is a pain - you need to install the synaptics drivers and tune it there, but it will reset when you wake from hibernate. Found a fix for this.
* Hibernate and Suspend are easy to fix using this script
* Hibernate can be re-enabled in the power menus using this fix
* To save battery power, Bluetooth can be disabled on startup using the first answer here
Don't forget to install build-essential and synaptic packet manager. You want also probably want rcconf to update applications running at startup (command line tool). Finally, you might want to move the window buttons.

Unity seems quite good on the u300s. This isn't the first time I've encountered this environment but it's the first time I've not utterly hated it. The extra width on the laptops screen (over a standard 4:3 ratio screen) makes the left menu bar work - especially once it has been shrunk as far as it will go. There are a couple of oddities (such as some programs sometimes not appearing in the alt-tab list) which I hope will be fixed soon.

Note about the touchpad. This is the first modern (ie less than 7 years old) touchpad I've used and it took some getting used to. Sensitivity and cursor speed can all be configured in the synaptics driver menu obviously but it's worth mentioning the "disable touchpad on keyboard use" option. If you're using the keyboard to navigate (such as alt-tab) you will find this triggers the mouse disable regardless of the "ignore multiplier combinations" setting which is really annoying. Also, the mouse responds to taps thus:

* one finger tap - left click
* two finger tap - right click
* three finger tap - middle click (needs enabling)

Horizontal and vertical two finger scrolling can be enabled in the synaptics interface.

Wednesday, 9 July 2008

Upgrading to Hardy Heron

Finally, mere months behind the rest of humanity, I have upgraded my machine at work to the latest release of Ubuntu. It's too early for any fair impressions but there is one thing that has come up that has annoyed me a great deal and I thought I'd share a solution for it. For some reason the gnome devs have seen fit to remove Multimedia tab from the Removable Drives and Media Preferences window in the Preferences menu which prevents you changing your default actions for when (for example) a CD is inserted. Strangely the icon is still CD, but that's another annoyance.

So how to make this change in Hardy? These options have been moved to the Nautilus Preferences menu (Edit -> Preferences -> Media tab) but thanks to a change in the way mime types are handled in Gnome you may well find your favourite applications are not listed in the drop down lists provided. For some reason you can't manually specify a program to run (thanks guys) so until the various package applications catch up with Gnome and this is done automatically we'll need to make changes to the application's description file.

So:
  • Go to /usr/share/applications (or /usr/share/applications/kde for a kde app)
  • sudo vi $application.desktop
  • Add the appropriate MIME types. I used this line:
MimeType=application/x-ogg;application/ogg;audio/x-scpls;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-mpegurl;application/x-flac;x-content/audio-cdda;x-content/audio-player;

(I was playing with grip in this case and there is almost certainly more than I need here, but I was in a hurry)
  • sudo update-desktop-database
  • sudo update-mime-database /usr/share/mime
Bingo. When you open Nautilus and look at the options menu you should see your application in the list.

Credits:
The solution came from here, I am merely distilling it to avoid having to hunt through pages of comments

Thursday, 13 December 2007

Compiz-fusion is a nice place to visit, but i wouldn't want to live there

Gutsy Ubuntu then (yes I know, not exactly cutting edge). Is it exciting and are the new desktop effects going to usher in a new era of cooperation between man and computer? Hmm, probably not.

It looks great, make no mistake about it. The way windows bounce around and beam into existence is suitably pleasing. I especially like the mammoth number of options which make your desktop anything from mildly annoying to utterly impossible to use. For most fun try turning down friction on the windows and watch as the slightest twitch of the mouse sends your window shooting off into the distance.

There are clearly more options than any sane human being could possibly want, but this is a new feature so they'll be playing with them and then removing them as you'd expect in gnome. Problem is the defaults - they don't really replicate the existing desktop but with added whiz. Try using the mouse wheel to switch between desktops for instance. The poor old wheel seems to have been neglected throughout in fact. I'm reliably informed these options can be turned on but either these people are lying to me or I don't have the patience to hunt through a million menus trying to find the option that makes my desktop behave as it did before.

I'm willing to believe the fault is with me here, but patience is something that's sadly lacking when I'm using a computer. It's a tool - I don't want it to get between be and what I'm trying to do, in the same way I don't want to spend an hour gently stroking a hammer before hitting a nail with it. Especially when, in this case, it's just garnish that slows things down. When I hit a key I want a response now, not half a second later when the graphics card has finished rendering everything or the desktops have finished scrolling around or
whatever.

I have to say I'm somewhat disappointed, but again I suspect the fault is mine. I was hoping for a great leap forward in usability. Something that makes the computer a joy to use. Something different, like the glove things in Minority Report. Instead I got the same thing as before but slower and with the ability to add fire trails to my desktop. Thanks, but I'll be switching this off for a while I think.