Announcement

Collapse
No announcement yet.

widgets have limited options and behaviors in plasma 5

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    widgets have limited options and behaviors in plasma 5

    Hi,

    I've been using plasma 4 desktops for a while, and have been testing the new plasma 5 systems, currently with 16.04 LTS.

    There are a couple differences in the widgets from plasma 4 to plasma 5 that to me seem a bit of a step backwards.

    There are three system monitoring widgets that I use to provide information on the system - and I do enjoy knowing what is happening with my system - these are CPU Temp, CPU activity and Network Monitor.

    In plasma 4, each pixel represented a set time, and was adjustable. For example, Network Monitor can be set to update every 2 seconds, as can the others. So if I stretch the widgets across the screen, it shows me data for the last hour, which is good for seeing any unexpected activities or to just seeing how things correlate, and can be seen a a glance just by showing the desktop.

    In plasma 5 with Kubuntu 16.04, the widgets are set to a constant total time. No matter how much of the screen the widget takes, it only displays a set time - for example, with Network Monitor, the graph only covers about 35 seconds. I like to step away from my computer for longer than 35 seconds usually

    In addition, for plasma 5, there isn't an option for how often to update the Network Monitor, it is set at 2 seconds. The CPU activity also is set for a fixed duration, and stretching the widget across the screen doesn't change the time, the graph stretches to fill the fixed duration time into that window.

    Also in plasma 5, it seems that widgets are not allowed to overlap anymore. Widgets either resize or move to be out of the way of each other.

    I'm wondering if there are ways to adjust these properties with some code, although I have never done widget coding. To me the time duration setup is more important than the overlap, but ideally, customizing both would be nice.

    I am using the stock widgets with a standard install/live dvd of 16.04, so if there are other widgets that have more options, those would also be great to hear about.

    Thanks

    #2
    KDE plotter sample size and interval

    Getting things back: System Monitor: http://notmart.org/blog/2015/02/gett...ystem-monitor/

    The KDE plotter is part of the KDE Frameworks 5 - kdeclarative:

    Sample size

    With the KF 5.27.0 - kdeclarative-5.27.0/src/qmlcontrols/kquickcontrolsaddons/plotter.cpp:
    Code:
    //completely arbitrary
    static int s_defaultSampleSize = 40;
    After the sample size change the rebuild of the kdeclarative is needed !

    Interval

    With the Plasma 5.8.0 - Network Monitor widget - /usr/share/plasma/plasmoids/org.kde.plasma.systemmonitor.net/contents/ui/Applet.qml:
    Code:
        PlasmaCore.DataSource {
            id: smSource
    
            engine: "systemmonitor"
            interval: 2000
    Default interval is 2000 milliseconds.

    After the interval change the plasmashell restart is needed.


    Network monitor with the default settings - 40 samples & 2 second interval:




    Network monitor with 100 samples and 2 second interval:




    Alternatives

    KDE System Monitor: https://userbase.kde.org/KSysGuard

    KNemo - Network Monitor: https://www.kde.org/applications/internet/knemo/
    --> Thread: compiling KNemo: https://www.kubuntuforums.net/showth...ompiling-KNemo

    KDE Store: https://store.kde.org -> Plasma extensions: https://store.kde.org/browse/cat/105/
    - Netspeed Widget: https://store.kde.org/p/998895/
    - Network Monitor: https://store.kde.org/p/998914/

    Conky: http://conky.sourceforge.net/documentation.html
    Last edited by Rog131; Oct 10, 2016, 02:22 PM.
    Before you edit, BACKUP !

    Why there are dead links ?
    1. Thread: Please explain how to access old kubuntu forum posts
    2. Thread: Lost Information

    Comment


      #3
      Thanks for the reply Rog131.

      This will be good stuff to play with. My problem now is that I can't seem to figure out the proper steps, or if I created a big mess by cobbling together files with no cohesion.

      I installed the kdevelop environment and I found the qmlcontrols/kquickcontrolsaddons directory, but no plotter.cpp file, and that whole directly was almost empty.

      I found the git for kdeclarative (5.28 version) and downloaded that to a local ~/kde/src and now I have all of the files, and then made the change to the plotter.cpp file.

      Now I don't know what to do. I don't know how to proceed and build the rest. I found a tutorial on installing kdevelop locally in from https://community.kde.org/Guidelines...ld_from_source and followed the instructions for a local install to keep from messing with the whole system by sandboxing plasma. I'm not sure if that is going to work or not, considering that the plotter.cpp was not found anywhere until I added to the home directory install of kdeclarative sources.

      Questions at this point would be:
      1) is the install complete or will a fresh install of all the packages be needed/helpful? or What packages are needed to do plasma widget development and where do they need to be?
      2) will using the local install of kdeclarative to ~/kde/src work to change the global properties of plotter.cpp for regular plasmoids?
      3) what are the instructions for a make of the kdeclarative to make a global widget change, if necessary to start from scratch?

      These might be basic questions, but after searching for more than a day trying to get any examples of how to make the changes to kdeclarative was fruitless, and all this is quite confusing and somewhat non-intuitive to me. So any help would be greatly appreciated.

      thanks

      Comment


        #4
        I made a bit of headway, but no luck getting any change in behavior for the monitors.

        I downloaded the kdeclarative version 5.18, to get the stock 15.04 KF5 to match versions, and changed the plotter.cpp value.

        I made the new kdeclarative-export.h in the home directory build: ~/kde/build/kdeclarative and then copied it to the /usr/include/KF5/KDeclarative/kdeclarative directory which is where i found the old version. I also copied the kdeclarative-version.h to /usr/include/KF5 which is where that file was located.

        During this process I also updated to the backports ppa of KDE to get the latest plasma 5.6, just to make sure there was no issue with that and rebooted.

        Upon the reboot the new desktop was apparent, but the network monitor still slid by in 40 seconds. I went back into both directories and checked the date of the files and they were both today's date, so the files were the from the latest build. The build process could have been done wrong - I'm still not sure if the process is the correct one, but I was encouraged by creating new .h files.

        Comment


          #5
          Another update which might help with understanding where I am lacking knowledge:

          after building the kdeclarative .h files, the make install puts everything in /usr/local/include/KF5/KDeclarative, where previously I only found the kdeclarative files in the /usr/include/KF5/KDeclarative directories.

          The make install also placed files in /usr/local/lib/x86-64-linux-gnu/ and /usr/local/bin

          These may or may not have alternate locations, since I didn't check before to see if these files existed prior to any activity.

          I did copy all of the /usr/local/include/KF5/KDeclarative files into the /usr/include/KF5/KDeclarative directories and restarted plasmashell, but no change was detected.

          It could be I am doing the process wrong, or I am missing a file from the rebuild because things are ending up in different locations.

          Comment


            #6
            You don't need the kdevelop. You are changing a line - any text editor will fine.

            The safest way, I think. is to use the distribution sources, make the edit and rebuild the packages. The Ubuntu is a Debian based so: BuildingTutorial - https://wiki.debian.org/BuildingTutorial
            This tutorial is about taking an existing package, re-building it, applying changes to it,...]
            If you are using the Ubuntu Xenia packages (not PPA) then you could download the sources from the:

            http://packages.ubuntu.com/xenial/qm...controlsaddons
            Last edited by Rog131; Oct 15, 2016, 06:37 AM.
            Before you edit, BACKUP !

            Why there are dead links ?
            1. Thread: Please explain how to access old kubuntu forum posts
            2. Thread: Lost Information

            Comment


              #7
              Thanks again for the reply.

              I looked at the download of the kdeclarative package and it didn't add the plotter.cpp file - which is why I downloaded the entire kdeclarative stuff before. I don't know where or how to find the file otherwise. Any help would be greatly appreciated.

              Comment


                #8
                I quickly scanned ploter.cpp here: https://api.kde.org/frameworks/kdecl...pp_source.html

                I think that plotter.setSampleSize(size) could be called from org.kde.plasma.systemmonitor.net/contents/ui/DoublePlotter.qml before plotter.addSample([data1.value, data2.value]).

                Comment


                  #9
                  I think I got it, but probably created some extra problems.

                  Steps that got me to a workable conclusion:

                  1) following the tutorial recommended by Rog131, I installed the build-essential fakeroot devscripts packages
                  2) created the new directories for the source files exactly as mentioned in the tutorial
                  3) apt-get source kdeclarative [with no escalated privileges, just standard user]
                  4) ran sudo apt-get build-dep kdeclarative
                  5) cd kdeclarative directory, and ran debuild -b -uc -us to build it
                  6) it gave no errors, so I changed the plotter.cpp line to 100
                  7) reran debuild -b -uc -us, ran with no errors
                  8) now I am left with a bunch of .deb files, but no kdeclarative.deb to install.

                  I now have:
                  kdeclarative_5.18.0-0ubuntu1_amd64.build
                  kdeclarative_5.18.0-0ubuntu1_amd64.changes
                  kdeclarative_5.18.0-0ubuntu1.debian.tar.xz
                  kdeclarative_5.18.0-0ubuntu1.dsc
                  kdeclarative_5.18.0.orig.tar.xz
                  kpackagelauncherqml_5.18.0-0ubuntu1_amd64.deb
                  libkf5calendarevents5_5.18.0-0ubuntu1_amd64.deb
                  libkf5declarative5_5.18.0-0ubuntu1_amd64.deb
                  libkf5declarative5-dbg_5.18.0-0ubuntu1_amd64.deb
                  libkf5declarative-data_5.18.0-0ubuntu1_all.deb
                  libkf5declarative-dev_5.18.0-0ubuntu1_amd64.deb
                  libkf5quickaddons5_5.18.0-0ubuntu1_amd64.deb
                  qml-module-org-kde-draganddrop_5.18.0-0ubuntu1_amd64.deb
                  qml-module-org-kde-kcoreaddons_5.18.0-0ubuntu1_amd64.deb
                  qml-module-org-kde-kio_5.18.0-0ubuntu1_amd64.deb
                  qml-module-org-kde-kquickcontrols_5.18.0-0ubuntu1_amd64.deb
                  qml-module-org-kde-kquickcontrolsaddons_5.18.0-0ubuntu1_amd64.deb
                  qml-module-org-kde-kwindowsystem_5.18.0-0ubuntu1_amd64.deb
                  qtdeclarative5-kf5declarative_5.18.0-0ubuntu1_all.deb

                  and when i try to install the .deb files with QApt I get a warning about "newer version installed", probably since I upgraded with the backport ppa to the new 5.23 frameworks? I can't seem to find the kdeclarative 5.23 package for 16.04, although the packages for 16.10 is there.

                  Ignoring the warning about a newer version, I installed all of the .deb files with dpkg -i *.deb [I did it in batches to see if any errors popped up, but none did] and then restarted plasmashell running as user:
                  killall plasmashell
                  kstart plasmashell

                  and it seems to have worked.

                  My system may be a bit wonky after mixing the 5.23 framework with 5.18 compiled sources, but it at least let me figure out how to do it.

                  The only caveat with this fix is it makes every monitoring widget have the same display scope, so changing the size of the monitor window doesn't change how long the display is, which was the behavior in the plasma4 widgets. for example, on plasma4 there could be one network monitor on display1 stretched across the entire screen to display 1 hour, and then a smaller window on display 2 that is only 1/4 of the way to show 15 min. That was a time based graph that just filled up the window.

                  In plasma 5, the window is set to display X points no matter how wide it gets, so 100 points in 1/4 of the screen shows the same data as 100 points in the full screen, just stretched.

                  Thanks Rog131, this information was very informative and I can now set it for 1800 points at 2 seconds each and watch all of the monitors for 1 hour

                  Comment


                    #10
                    Sasha,

                    Thanks for the reply. It is an interesting idea. Would that statement go in the main loop or would it need to appear in the Connections loop? I would imagine it wouldn't have to be called each time, but just once - although I'm not familiar with these commands.

                    Comment


                      #11
                      Sasha,

                      It was a good try, but plotter.setSampleSize(size) is an unrecognized command in DoublePlotter.qml

                      Comment


                        #12
                        Another update with interesting behavior

                        I added CPU monitor and Network Monitor full screen at 1800 samples across the screen.
                        The larger number of points works to make it slower, but it is weird that Network Monitor is faster than the CPU monitor. Network Monitor takes about 30 minutes to move across the entire screen, while CPU Monitor takes twice as long, and ends up at the hour mark.

                        Not sure why, I might reinstall and start with the standard kdeclarative 5.18 with matching framework.

                        Comment


                          #13
                          Reinstall update:

                          I did a fresh install of 16.04 and followed the same steps as before on a clean KF5.18 setup. The behavior of the CPU monitor is a full screen graph of 1800 points takes just over an hour to run, whereas a full screen Network Monitor graph takes about 30 minutes.

                          The Network Monitor plasmoid plots 2 data points for every measurement - upload and download - so I am wondering if that might be the difference. The DoublePlotter.qml only has one addSample command though, so I don't know how it is calculating sample points to make it twice as fast.

                          The benefit of coordinated plots is that if cpu activity spikes and it can be tied to network activity it is easier to narrow down the process occurring.
                          Last edited by suplero; Oct 15, 2016, 07:52 PM. Reason: changed seconds to minutes, oops

                          Comment


                            #14
                            I did confirm the reason that Network Monitor takes half the time as the CPU Monitor is the double plot point from upload and download plotting.

                            I went into /usr/share/plasma/plasmoid/org.kde.plasma.systemmonitor.net/contents/ui/net.qml and at the very bottom it calls DoublePlotter.qml using

                            delegate: DoublePlotter {}

                            I changed the call to delegate: SinglePlotter {} as sudo, then restarted plasmashell and now the Network Monitor and CPU Monitor stay locked together as they scroll across the screen. I don't have upload and download however, so that isn't the best option, but it does narrow down the reason for why the two monitors had different graphing times.

                            I am not sure which part of the plasmoid code counts the horizontal data points, so going any deeper will be a bit of a challenge for me.
                            I initially tried to just drop the second value from the plot, but with DoublePlotter.qml it needs two data values to correctly display anything.

                            Comment


                              #15
                              Bug 353063 - Update interval setting for system monitor plasmoids : https://bugs.kde.org/show_bug.cgi?id=353063
                              -> [System Monitor Applet] Add setting for update interval: https://phabricator.kde.org/D6864
                              Before you edit, BACKUP !

                              Why there are dead links ?
                              1. Thread: Please explain how to access old kubuntu forum posts
                              2. Thread: Lost Information

                              Comment

                              Working...
                              X