This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to make Pager Widget tweaks?

Tags: None
(comma "," separated)
mj17
Registered Member
Posts
6
Karma
0

How to make Pager Widget tweaks?

Wed May 03, 2017 7:43 pm
Hi all,

I'm running the following:

CentOS v7.3
Qt: 4.8.5
KDE Development Platform: 4.14.8

That's the newest KDE I could find via yum :(

I have looked in the KDE Store, but so far I have not yet been able to find a Pager widget (or desktop theme) that does not include outlines of windows. I find that extremely annoying because all I want to see in the Pager widget of my panel is the name of the virtual desktop. Furthermore, I would like to accentuate the desktop I'm in via a different color for that desktop in the Pager.

I've done Google searches, *played* with inkscape, but as a beginner KDE tweaker I cannot find how I can make the desired changes.

Guidance would be most appreciated.
User avatar
Zren
Registered Member
Posts
41
Karma
1
OS
We can skim the source code of the pager:
https://github.com/KDE/plasma-desktop/b ... n.qml#L361

It uses the svg element with "active-" for the selected desktop.

The desktoptheme svg you need to edit is
Code: Select all
/usr/share/plasma/desktoptheme/default/widgets/pager.svgz

That's the location of the breeze svg, but you could easily edit your theme's pager.svgz in
Code: Select all
~/.local/share/plasma/desktoptheme/

Just copy the breeze svg to your desktop theme if it's missing.

In order to make the window's invisible...

The code looks like it's drawing a Rectangle instead of using the svg.
https://github.com/KDE/plasma-desktop/b ... n.qml#L414

This means we need to edit the pager's source. It's fairly easy to do actually.

Notice the line with
Code: Select all
visible: model.IsMinimized !== true

we can easily change that to
Code: Select all
visible: false

and make all windows not show up!

The file you need to edit is
Code: Select all
/usr/share/plasma/plasmoids/org.kde.plasma.pager/contents/ui/main.qml


I should note that you'll want to write what you do down, as this file will be overwriten when plasma updates.

I'm not sure if the reason for not using svgs for that though it might be for performance? Iunno. Anyways, if you can't see a feature request here, you can submit a feature request for a checkbox for turning off windows in the pager here:
https://bugs.kde.org/enter_bug.cgi?prod ... nent=Pager


User avatar
Zren
Registered Member
Posts
41
Karma
1
OS
I forgot to mention that after your edits you'll need to:

* Change to another desktop theme and back to your edited one to show changes
* Run
Code: Select all
killall plasmashell; kstart5 plasmashell
to restart plasma (and specifically the pager) to have it use your modified code.


mj17
Registered Member
Posts
6
Karma
0
Hi Zren,

Thanks for the very thorough reply! However, due to my novice nature regarding KDE, I have a few follow-up questions.

Firstly, note that I did not have a ~/.local/share/plasma directory for whatever reason. Therefore, I created one. Then, I copied the /usr/share/kde4/apps/desktoptheme/default/widgets/pager.svgz file into ~/.local/share/plasma/desktoptheme. Is it okay to only have the pager.svgz file in there? Or do I need to download an entire theme before making any modifications?

At this point, I hit a roadblock because I don't know how to uncompress the pager.svgz file. I opened pager.svgz in inkscape hoping there may be some kind of text editor built-in; but if there is, I couldn't find it. Do you have any recommendations to open/uncompress the pager.svgz file?

Is changing the color of the "active" and "hover" elements straightforward as well within the pager.svgz file?

Thanks again for taking the time to provide such a detailed reply!
mj17
Registered Member
Posts
6
Karma
0
Ok, I just realized that zcat will open the pager.svgz file. However, after doing so, I did not find the "IsMinimized" string. Sigh.
User avatar
Zren
Registered Member
Posts
41
Karma
1
OS
Oh ****, I didn't notice this was for kde4. Sorry, I only started using kde with kde5, so I've no idea how much has changed.
Not sure, but I'd assume it would be
Code: Select all
~/.local/share/kde4/apps/desktoptheme/


pager.svgz should be readable by inkscape. It's basically ".svg.gz", where it's a gzipped text file (svg is just xml).

isMinimized will not be in the svg, it will be in the pager's source code, which I've no idea where it will be. Sorry.


wolfi323
Registered Member
Posts
1129
Karma
11
OS

Re: How to make Pager Widget tweaks?

Fri May 05, 2017 10:56 pm
Zren wrote:Oh ****, I didn't notice this was for kde4. Sorry, I only started using kde with kde5, so I've no idea how much has changed.
Not sure, but I'd assume it would be
Code: Select all
~/.local/share/kde4/apps/desktoptheme/


No, it would be ~/.kde4/share/apps/desktoptheme/ in this case.

But yes, this would only change the look.

If you want to change the *behaviour*, you'd have to make code changes.

The pager is (partly) written in QML, the files are in /usr/share/kde4/apps/plasma/packages/org.kde.pager/contents/ (here on openSUSE at least).
As QML is a script language (similar/equal to JavaScript), you can just change the files and don't have to recompile anything.
I am not sure if you can override that on a user level though.

And I am not sure at the moment if you can achieve what you want by just modifying the QML code, or you'd have to modify the C++ code too.
mj17
Registered Member
Posts
6
Karma
0
I'm only wanting to change the look, not the behavior. I'll see if I can decode enough of the svg file to make the requisite changes. Although, I was hoping there would be a tool of some sort to assist with the changes.

Thanks for the replies!
wolfi323
Registered Member
Posts
1129
Karma
11
OS

Re: How to make Pager Widget tweaks?

Tue May 09, 2017 12:41 pm
mj17 wrote:I'm only wanting to change the look, not the behavior. I'll see if I can decode enough of the svg file to make the requisite changes. Although, I was hoping there would be a tool of some sort to assist with the changes.

There is, inkscape as mentioned (or probably any other graphics application that can read/write SVG files).
Plasma themes only consist of SVG graphics files.

"accentuate the desktop I'm in via a different color" should be doable by just changing the theme's SVG files I suppose (the active desktop is already highlighted), but I'm not sure.
Removing the window previews is definitely a change in behavior though... ;)


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]