Pages: [1]
  Print  
Author Topic: UT shortcuts in KDE  (Read 2252 times)
rork
Guest
« on: February 14, 2011, 11:27:00 am »

'In earlier posts I wrote about how to load Unreal Tournament maps and servers from the commandline and url's. However it's even easier to load maps directly from the file browser.

As I'm using KDE as a desktop and I'm going to show how to setup Unreal Tournament to load maps straight from Dolphin. I'm still a server admin and have to compress ut packages every now and then so I'll also add a shortcut for this but this will be added to the rightclick compress menu. The first can be done trough a graphical user interface, the seconds requires a file being written. I'm using KDE 4.4.6 for this tutorial.



Map shortcut
For the shortcut to work you'll have to use this fix. In KDE filename patterns (normally extensions) can be linked to mime-types and software to open them. Go to "System Settings > (Advanced) > File Associations" and click "Add" below the list of known types. You can now select a group and type a name. Set group application and name "ut-map".


In the right column add a filename patern "*.unr" and an icon if you want one. KDE only supports png, xpm, svg and svgz here so you'll have to convert or find an icon. Now the mime-type is set it's time to associate an application with it: Unreal Tournament.

Under "Application preference order" click add, select a file and browse to your modified ut init script. Press ok and you're done. You can add a fancier name with the edit button. That's all.

Compression shortcut
It's possible to add a shortcut to `ucc compress ` in a similar way but Dolphin has a compress menu when you right click a file. It's fancier to add a link here but only for UT packages. The right-click menu is controlled by file associations and services. I haven't found a graphical editor for these services but there is a set of desktop files in $KDEHOME/share/services/ServiceMenus, in my case /usr/share/kde4/services/ServiceMenus. It's also possible to add the menu in your home direcory, in my case ~/.kde/share/services/ServiceMenus/.

I want the uz compression option for ut packages only so we'll need another mime-type. Add the mime-type ut-pkg and add the filename patterns *.u, *.uax, *.umx and *.utx. For maps we can use the mime-type created before. In the servicemenu directory create a file: ucc.desktop and copy paste the following:
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/ut-pkg;application/ut-map;
Actions=compressASuz;
X-KDE-Submenu=Compress
X-KDE-StartupNotify=false
X-KDE-Priority=TopLevel

[Desktop Action compressASuz]
Name=As UZ Archive
Icon=utilities-file-archiver
Exec=/home/me/Games/ut/ucc compress %F --nohomedir

You'll have to change Exec= in the last line to your own UT installation. Because --nohomedir is set the compressed file will be created in the current directory rather then ~/.loki/ut/System. Restart Dolphin and you can use your new compression option.'
Logged
Pages: [1]
  Print  
 
Jump to: