Category Archives: KDE

Sleep Button in KDE 4 Workaround

If you noticed that pushing the sleep button does nothing in KDE 4 (as of this writing <=4.3.3), this is because of a bug in KDEs’ power management tool Powerdevil. It appears that in most cases Powerdevil does not recognize the Xorg servers’ XF86Sleep key. To fix this, you may be able to rebind the sleep key in the KDE control panel.

Add a New Input Action

Open System Settings then Input Actions. Then add a new Global Shortcut:

Name it ‘Sleep’ or whatever you like. Add a Comment if you wish and in the Trigger tab select your hotkey. Try setting the sleep key first. For me, setting the hotkey to the sleep key didn’t work because I believe that Powerdevil already has it bound. There have been others though that look to have sucessfully done so.

Note: If someone knows of a way to decouple the Powerdevil sleep key please let me know.

I bound mine to Scroll Lock (hope I don’t need it anytime soon) then in the Action tab entere the dbus command to suspend to ram:

qdbus org.kde.kded /modules/powerdevil suspend 2

If this doesn’t work, try ‘suspend 1’. If you would like to suspend to disk:

qdbus org.kde.kded /modules/powerdevil suspend 4

Kwrite Setup

HeaderI love Kwrite. Basically when I do text things, I use vim for creation and Kwrite for editing. When it comes to moving large blocks of text and having to scroll quickly through a text file, a gui text editor is needed. Kwrite does good with syntax-highlighting and enables me to easily work on more than one text file at once. Although Kwrite is good by default, it takes a little setting up to get it to behave as expected. Here’s how I setup Kwrite.

Open up the configuration: Settings > Configure Editor


Turn on ‘Dynamic Word Wrap’. This allows words to be wrapped but doesn’t create a new line. This way you avoid having to scroll left and right to get to text.


Disable all borders. Line number isn’t really needed if you use the status bar (enabled by default), icon border I never really found a use for, and folding is nice but since Kwrite doesn’t remember this setting and going through file and collapsing everything, everytime, is more trouble than it’s worth.

Fonts and Colors

Kate’s built in color schema’s don’t have alot of options. I found someone who brought KDE 3.5 Kate’s color schema to Kwrite (I believe Kwrite is a trimmed down version of Kate). I wish I had the link, but I don’t so I’ll put it up here.

Additional Kwrite Color Schemas

You’ll need to put the files in ‘~/.kde4/share/config’ and change ownership of them. I’m not sure if the katepartscriptrc is needed but it’s not going to hurt to add it. Be sure to back up the originals first though. You can change the schema with the ‘Default schema for Kwrite’ dropbox.



For tabulators think about doing ‘Insert spaces instead of tabulators’. In some documents you’ll find people use a mix of space for tabs and tabs themselves which can make for some odd formatting depending if tab spacing is different. I also like to ‘Highlight tabulators’. For ‘Tab width’ I found that ‘2 characters’ works good for being able to scroll text easily and still have easily discerable indentations.

Static Word Wrap

Static word wrap I leave off. Static word wrap forces line breaks when you reach the end of the line. This is good if you are say writing a man page, but not so good if you are building a script.


In Misc I like to ‘Highlight trailing spaces’. Sometimes I’ll leave an empty space at the end of the line and have to edit something else. When I get back, it’s a nice reminder that I don’t have to enter a space again.

Intentation Tab

Indentation Actions

Having ‘Backspace key in leading blank space unindents’ checked is a good idea if you use spaces for tabs.

Auto Completion Tab

I’m not sure even how auto-completion in Kwrite even works. Supposedly you are able to Ctrl-Space when you see a popup and the word will be printed. It’s never worked for me though and I find the popups semi-distracting so I disable ‘Auto completion enabled’.


Automatic Cleanups on Load/Save

Though hardly necessary, it does make a nice clean document when you select ‘Remove trailing spaces’.

Advanced Tab – Backup on Save

Kwrite does the same thing as default Vim does and leaves a nice clutter of backup files all over your filesystem. Though it is nice enough to have a backup, I’m usually good enough to remember to backup important text files before I edit them. Uncheck ‘Local files’ to avoid a nice trail [A-Za-z0-9]~ files everywhere.

Kmix Gets Support for OSSv4

Up until now, KDE 4 users have had to use OSSv4 own sound mixer (ossxmix) to change volumes levels while within KDE. Recently though preliminary support for OSSv4 has been built into kmix.


The Open Source Sound system is a sound system for *nix operating systems built on the original OSS format. A number of users have requested OSSv4 support in kmix for the last year. OSSv4 has now been added to the trunk of the kmix svn. I compiled kmix and tested it.

And it works pretty good.

I’ve built a PKGBUILD for Arch linux. If you’d like to compile it take a look at that for instructions.

What doesn’t work

  • Multimedia keys won’t be able to change volume and if you push them enough kmix magically disappears.
  • No support for adjusting program volumes levels.

Thanks for the KDE developer(s) work for helping get OSS back into KDE 4.


Get every new post delivered to your Inbox.

Join 58 other followers