Plasma and Ansible on enterprise thin clients - changing default Plasma settings

I’m currently exploring replacing GNOME with KDE Plasma on thin clients when we transition from Ubuntu 20.04 to 22.04 (or 24.04 if HP Anywhere will have PCoIP ready by then).

With GNOME having the ability to use dconf to edit keybindings, default applications, favorite apps on the sidebar, etc., what’s the best & most efficient to do the same things with Plasma?

I found this Kconfig Ansible module from this post, and it seems a little sparse.

Here are some of the settings I wanna change by default:

  • Setting window rules for a specific application (HP Anywhere PCoIP) - do I just put that in /etc/skel? What if I wanna modify for other pre-existing users? Find all instances in /home? Anyway to make sure that non-admins can’t change it?
  • Change pinned applications on the task manager. I want to be able to keep some items pinned all the time (i.e. removed application comes back after next login)
  • Change default key-binding for a specific application for all users (i.e. I wanna assign Print Screen to Flameshot (did that for GNOME) or disable Meta key (just an example).
3 Likes

The title is oddly specific and doesnt describe your core issue here: how to change GUI settings through a terminal interface?

You may want to rephrase it.

I am also curious, as there seems to be no general interface.

I updated it. Hope it’s clearer?

1 Like

As of now, besides /etc/skel, there’s also KDE Kiosk framework which was mentioned by @David_Edmundson in the article “Trusting content on the KDE Store”

Relevant information (sorry, I can’t post links here):

  • Topic “KDE in the Ansible Community Collection” at discuss_kde_org, also the issue “Possible future tutorial: Deploy Plasma with Ansible” at the invent_kde_org)
  • Suggested KDE Goal " Simplify maintainance, automation and remote assistance for Sysadmin" (T17448 at phabricator_kde_org)
3 Likes

Just gonna add these for bookmarking purposes:

https://blog.davidedmundson.co.uk/blog/kde-store-content/

If I were to configure the default icon shortcuts in plasma-org.kde.plasma.desktop-appletsrc (placing it in /etc/xdg)

      [Containments][2][Applets][22][Configuration]
      localPath=/home/jgamao/.local/share/plasma_icons/firefox_firefox.desktop
      url=file:///var/lib/snapd/desktop/applications/firefox_firefox.desktop

      [Containments][2][Applets][23]
      immutability=1
      plugin=org.kde.plasma.icon

      [Containments][2][Applets][23][Configuration]
      localPath=/home/jgamao/.local/share/plasma_icons/google-chrome.desktop
      url=file:///usr/share/applications/google-chrome.desktop

      [Containments][2][Applets][24]
      immutability=1
      plugin=org.kde.plasma.icon

      [Containments][2][Applets][24][Configuration]
      localPath=/home/jgamao/.local/share/plasma_icons/org.kde.dolphin.desktop
      url=file:///usr/share/applications/org.kde.dolphin.desktop

what do I put instead in localPath?

- name: Setup KWin rules
  ansible.builtin.blockinfile:
    dest: /etc/xdg/kwinrulesrc
    create: true
    marker: "#### {mark}"
    mode: "0644"
    content: |
      [$Version]
      update_info=kwinrules.upd:replace-placement-string-to-enum,kwinrules.upd:use-virtual-desktop-ids

      [1]
      Description=PCoIP
      clientmachine=localhost
      clientmachinematch=0
      disableglobalshortcuts=true
      disableglobalshortcutsrule=2
      fpplevel=4
      fpplevelrule=2
      title=Anyware PCoIP Client
      titlematch=0
      wmclass=pcoip-client
      wmclasscomplete=false
      wmclassmatch=1

      [General]
      XftAntialias[$d]
      XftHintStyle[$d]
      XftSubPixel[$d]
      count=1
      rules=1

      [KDE]
      LookAndFeelPackage[$d]
      SingleClick[$d]

- name: Setup Plasma org.kde.panel
  ansible.builtin.blockinfile:
    dest: /etc/xdg/plasmashellrc
    create: true
    marker: "#### {mark}"
    mode: "0644"
    content: |
      [PlasmaViews][Panel 2][Defaults]
      floating=0
      thickness=28


- name: Setup Plasma layout
  ansible.builtin.blockinfile:
    dest: /etc/xdg/plasma-org.kde.plasma.desktop-appletsrc
    create: true
    marker: "#### {mark}"
    mode: "0644"
    content: |
      [ActionPlugins][0]
      MiddleButton;NoModifier=org.kde.paste
      RightButton;NoModifier=org.kde.contextmenu
      wheel:Vertical;NoModifier=org.kde.switchdesktop

      [ActionPlugins][1]
      RightButton;NoModifier=org.kde.contextmenu

      [Containments][2]
      activityId=
      formfactor=2
      immutability=1
      lastScreen=0
      location=4
      plugin=org.kde.panel
      wallpaperplugin=org.kde.image

      [Containments][2][Applets][22]
      immutability=1
      plugin=org.kde.plasma.icon

      [Containments][2][Applets][22][Configuration]
      url=file:///var/lib/snapd/desktop/applications/firefox_firefox.desktop

      [Containments][2][Applets][23]
      immutability=1
      plugin=org.kde.plasma.icon

      [Containments][2][Applets][23][Configuration]
      url=file:///usr/share/applications/google-chrome.desktop

      [Containments][2][Applets][24]
      immutability=1
      plugin=org.kde.plasma.icon

      [Containments][2][Applets][24][Configuration]
      url=file:///usr/share/applications/org.kde.dolphin.desktop

      [Containments][2][Applets][25]
      immutability=1
      plugin=org.kde.plasma.icon

      [Containments][2][Applets][25][Configuration]
      localPath=/home/jgamao/.local/share/plasma_icons/pcoip-client.desktop
      url=file:///usr/share/applications/pcoip-client.desktop

      [Containments][2][Applets][3]
      immutability=1
      plugin=org.kde.plasma.kickoff

      [Containments][2][Applets][3][Configuration]
      PreloadWeight=100

      [Containments][2][Applets][3][Configuration][Configuration/General]
      showAppsByName=true

      [Containments][2][Applets][3][Configuration][General]
      favorites=preferred://browser,org.kde.discover.desktop,org.kde.kontact.desktop,org.kde.kate.desktop,libreoffice-startcenter.desktop,org.kde.dolphin.desktop,org.kde.plasma-systemmonitor.desktop,systemsettings.desktop,org.kde.konsole.desktop
      favoritesPortedToKAstats=true

      [Containments][2][Applets][3][Configuration][Shortcuts]
      global=Alt+F1

      [Containments][2][Applets][3][Shortcuts]
      global=Alt+F1

      [Containments][2][Applets][4]
      immutability=1
      plugin=org.kde.plasma.pager

      [Containments][2][Applets][5]
      immutability=1
      plugin=org.kde.plasma.taskmanager

      [Containments][2][Applets][5][Configuration][General]
      launchers=

      [Containments][2][Applets][6]
      immutability=1
      plugin=org.kde.plasma.systemtray

      [Containments][2][Applets][6][Configuration]
      SystrayContainmentId=7

      [Containments][2][Applets][8]
      immutability=1
      plugin=org.kde.plasma.digitalclock

      [Containments][2][Applets][9]
      immutability=1
      plugin=org.kde.plasma.minimizeall

      [Containments][2][ConfigDialog]
      DialogHeight=84
      DialogWidth=1920

      [Containments][2][General]
      AppletOrder=3;4;22;23;24;25;5;6;8;9

      [Containments][21]
      ItemGeometries-1920x1080=
      ItemGeometriesHorizontal=
      activityId=48555a24-f062-4429-8ab6-bd50221ff2f3
      formfactor=0
      immutability=1
      lastScreen=0
      location=0
      plugin=org.kde.plasma.folder
      wallpaperplugin=org.kde.image

      [Containments][21][Wallpaper][org.kde.image][General]
      Image=file:///usr/share/wallpapers/Next/contents/images/1920x1080.jpg

      [Containments][7]
      activityId=
      formfactor=2
      immutability=1
      lastScreen=0
      location=4
      plugin=org.kde.plasma.private.systemtray
      wallpaperplugin=org.kde.image

      [Containments][7][Applets][10]
      immutability=1
      plugin=org.kde.plasma.volume

      [Containments][7][Applets][11]
      immutability=1
      plugin=org.kde.plasma.clipboard

      [Containments][7][Applets][12]
      immutability=1
      plugin=org.kde.plasma.devicenotifier

      [Containments][7][Applets][13]
      immutability=1
      plugin=org.kde.kdeconnect

      [Containments][7][Applets][14]
      immutability=1
      plugin=org.kde.plasma.keyboardindicator

      [Containments][7][Applets][15]
      immutability=1
      plugin=org.kde.plasma.nightcolorcontrol

      [Containments][7][Applets][16]
      immutability=1
      plugin=org.kde.plasma.notifications

      [Containments][7][Applets][17]
      immutability=1
      plugin=org.kde.plasma.printmanager

      [Containments][7][Applets][18]
      immutability=1
      plugin=org.kde.plasma.vault

      [Containments][7][Applets][19]
      immutability=1
      plugin=org.kde.plasma.battery

      [Containments][7][Applets][20]
      immutability=1
      plugin=org.kde.plasma.networkmanagement

      [Containments][7][Applets][21]
      immutability=1
      plugin=org.kde.plasma.bluetooth

      [Containments][7][General]
      extraItems=org.kde.plasma.devicenotifier,org.kde.plasma.printmanager,org.kde.plasma.networkmanagement,org.kde.plasma.bluetooth,org.kde.plasma.battery,org.kde.plasma.nightcolorcontrol,org.kde.plasma.vault,org.kde.plasma.notifications,org.kde.plasma.mediacontroller,org.kde.plasma.keyboardindicator,org.kde.plasma.volume,org.kde.plasma.clipboard,org.kde.plasma.manage-inputmethod,org.kde.kupapplet,org.kde.plasma.keyboardlayout
      knownItems=org.kde.plasma.devicenotifier,org.kde.plasma.printmanager,org.kde.plasma.networkmanagement,org.kde.plasma.bluetooth,org.kde.plasma.battery,org.kde.plasma.nightcolorcontrol,org.kde.plasma.vault,org.kde.plasma.notifications,org.kde.plasma.mediacontroller,org.kde.plasma.keyboardindicator,org.kde.plasma.volume,org.kde.plasma.clipboard,org.kde.plasma.manage-inputmethod,org.kde.kupapplet,org.kde.plasma.keyboardlayout

      [ScreenMapping]
      itemsOnDisabledScreens=

So far, only KWin rules applied.

the panel didn’t change

In case it might help, this is my Ansible playbook for KDE, described here:

I’m using community.general.ini_file for KDE configuration files.

I tried this documentation from KDE Developer website by using javascript, but no dice