GithubHelp home page GithubHelp logo

Comments (5)

toast003 avatar toast003 commented on August 10, 2024 2

Imo the best way to do this would be to have the widgets accept either a string with the widget name, or a submodule with the name and the config for that widget, kinda like this:

panels = [
  {
    location = "bottom";
    widgets = [
      {
        name = "org.kde.plasma.kickoff";
        config = {
          General.icon = "nix-snowflake-white";
        };
      }
      "org.kde.plasma.icontasks"
      "org.kde.plasma.marignsseperator"
      "org.kde.plasma.systemtray"
      "org.kde.plasma.digitalclock"
    ]
  }
];

from plasma-manager.

martijnboers avatar martijnboers commented on August 10, 2024 1

Ow nice that will work! I noticed that the widget number varies on installs so I'll try this out. No worries about not having time, I might have a jab at implementing something but it's a relatively niche project. All the effort is very welcome

from plasma-manager.

martijnboers avatar martijnboers commented on August 10, 2024

This would be great, I only have one widget I'd like to configure and now every-time my system restarts the widget setting is reset.

from plasma-manager.

toast003 avatar toast003 commented on August 10, 2024

Sorry for not doing anything about this, I want it too but I have been pretty busy lately

I did remember I was trying to see how I would do this and I managed to get it working with this

panels = [
  {
    location = "top";
    extraSettings = ''
      for (i = 0; i < panel.widgetIds.length; i++ ) {
        currentWidget = panel.widgetById(panel.widgetIds[i])
        if (currentWidget.type == "org.kde.plasma.kickoff" ) {
          // You can change the config here 
          currentWidget.currentConfigGroup = ["General"]
          currentWidget.writeConfig("icon", "nix-snowflake-white")
        }
      }
    '';
  }
];

This is not per panel and changes every widget but I hope it's good enough until I can get back to doing stuff @martijnboers

from plasma-manager.

magnouvean avatar magnouvean commented on August 10, 2024

Do note that the above for-loop should not be neccesary as all the widgets are saved in a panelWidgets dictionary, so you should be able to use currentWidget = panelWidgets["org.kde.plasma.kickoff"]. That said there a.t.m. is no proper nix interface for the writeConfig thing above (I'll see if I can add this in the weekend, as it should be quite a simple tweak).

from plasma-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.