Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unique desktop folders per workspace in KDE?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
JD.Thompson
n00b
n00b


Joined: 18 May 2005
Posts: 13

PostPosted: Fri Sep 02, 2005 9:12 pm    Post subject: Unique desktop folders per workspace in KDE? Reply with quote

Greetings,

I'd like to be able to set unique icons for each desktop/workspace in kde (like Fluxspace in Fluxbox). The problem is kde keeps all desktop files in /home/$user/Desktop and doesnt appear to allow me to separate the workspaces. Am I missing something? Or, is there something like Fluxspace for KDE? Has someone created a script to symlink Desktop0, Desktop1, Desktop2, etc etc.. to /home/$user/Desktop depending on which workspace I am in?

Thanks in advance,
Jack Thompson


Last edited by JD.Thompson on Sat Sep 03, 2005 10:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
JD.Thompson
n00b
n00b


Joined: 18 May 2005
Posts: 13

PostPosted: Sat Sep 03, 2005 10:18 pm    Post subject: Reply with quote

Well, kde does not treat symlinked files as normal files on the desktop. Is it possible to change this behavior? If not, I'd have to actually move the files to the Desktop folder when I change workspaces and I'm thinking that would be a bit to resource intensive.

I'm still getting the hang of linux/gentoo/kde so any help would be greatly appreciated.

Edit: I was trying to symlink individual files which wasnt working but symlinking the entire desktop directory did work. However, I found a way to make kdesktop change its path.
Back to top
View user's profile Send private message
JD.Thompson
n00b
n00b


Joined: 18 May 2005
Posts: 13

PostPosted: Sun Sep 11, 2005 7:35 am    Post subject: Reply with quote

After endless google searches and no respsonse on this forum I decided to write my own script. I have things working like I wanted but I figured I'd post what I figured out just incase someone else is interested.

The main problem is to my knowledge kdesktop does not provide a way to tell it to reload its desktop path via dcop or some other way. I found a patch to kdesktop that makes it reload kdeglobals when a configure dcop call is sent to it and when this is done it also reloads the desktop path it finds in kdeglobals. You can find that patch here http://aseigo.bddf.ca/cms/1048 (thanks/credit to Aaron J. Seigo for making the patch :)). So armed with my patched kdesktop I made a script that sends the setCurrentDesktop dcop, edits kdeglobals and then sends that configure dcop.

Here is the script... name it "udesk":

Code:

#!/bin/bash

# udesk - A script for unique desktops in kde created by Jack Thompson

#############################################################
# Set the desktop path and maybe other settings. Settings the location of kdeglobals is a must
#############################################################

# Desktop path Note: The desktop number will be added to this path so be
# sure to create the required directorys or set auto_make to 1.. IE $HOME/Desktop1
desktop="$HOME/Desktop"

# Auto create directorys.. yes=1 no=0
auto_make=1

# Location of kdeglobals
kdeglobals="$HOME/.kde3.4/share/config/kdeglobals"

# Where to save the tmp file. Note: This is created when updating kdeglobals.
tmp="/tmp/udesk_kdeglobals.tmp"

#############################################
# The following should not need to be changed
#############################################

# Give usage help
function usage
{
   echo "Usage: udesk [[-d <number> ] | [-h]]"
   echo "Look at the config part of this script if you havent yet."
}

# Get input
while [ "$1" != "" ]; do
   case $1 in
      -d | --desk )   shift
            num=$1
            ;;
      -h | --help )   usage
            exit
            ;;
      * )      usage
            exit 1
   esac
   shift
done

# Check to see if the directory exists if not create it
if [ -d $desktop$num ]; then
   deskpath=$desktop$num
else
   if [ "$auto_make" = "1" ]; then
      echo "udesk - Making Directory"
      mkdir $desktop$num
      if [ -d $desktop$num ]; then
         deskpath=$desktop$num
      else
         echo "Error: udesk - Unable to create the directory $desktop$num." >&2
         exit 1
      fi
   else
      echo "Error: udesk - The directory $desktop$num does not exists. Set auto_make=1 or
      manually create $desktop$num." >&2
      exit 1
   fi
fi

# Change the desktop, update kdeglobals and then refresh kdesktop
if [ "$deskpath" ]; then
   if [ "$(dcop kwin KWinInterface setCurrentDesktop $num)" = "true" ]; then
      if [ "$(sed -e 's#^Desktop=.*#'"Desktop=$deskpath#" $kdeglobals > $tmp)" = "" ]; then
         if [ "$(mv $tmp $kdeglobals)" = "" ]; then
            if [ "$(dcop kdesktop KDesktopIface configure)" = "" ]; then
               exit 0
            else
               echo "Error: udesk - Unable to use configure(). Make sure KDE is running :).">&2
               exit 1
            fi
         else
            echo "Error: udesk - Unable to write to kdeglobals.">&2
            exit 1
         fi
      else
         echo "Error: udesk - An unknown error has occured. The most likely cause is the kdeglobals location is not set">&2
         exit 1
      fi
   else
      echo "Error: udesk - Kdesktop is unable to change to the desktop number specified. Make sure it is enabled in KDE.">&2
   fi
fi


If anyone needs step by step instructions I'd be happy to help. After 330+ views without a reply I suspect no one cares so I'm not going to waste my time unless someone shows interest.
Back to top
View user's profile Send private message
RandyBurgess
n00b
n00b


Joined: 15 Dec 2005
Posts: 30

PostPosted: Sat Sep 01, 2007 1:54 pm    Post subject: Reply with quote

I just implemented this same patch in kdesktop-3.5.7, and the script works great, once I added an entry for the desktop path in kdeglobals (wasn't there by default). Who knows what will happen with KDE 4.0, but for now I'm enjoying virtual desktops with different icons.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum