Skip to content

[OTHER]-[GUIDE] Ultimate BASH script for switching Plasma styles, Window decoration, Cursors and Konsole theme (KDE Plasma 6) #120

Description

@oplovyk

I have been searching for BASH script for auto-switching of Plasma styles, Window decoration, Konsole profile and cursor, so you don`t have to for now:

  1. You need to install themes you want (works both for installed from settings and installed from kde store) and check if they`re in right folder:
  • for Plasma style you need (your theme should be folder, not archived folder! It should contain folders such as widgets/ and dialogs/ and metadata file): ~/.local/share/plasma/desktoptheme//
  • for Window decoration you need (your theme should be folder, not archived folder! It should contain metadata file): ~/.local/share/kwin/decorations/ or ~/.local/share/aurorae/themes/
  • for Cursors (also folder) you need: /home/.icons/
  1. To make a Konsole profile you need to:
    A. Open Konsole
    B. Click at three dots -> Settings -> Configure Konsole / or just press Ctrl+Shift+grave accent (Sorry, I cant write this symbol here)
    C. Choose "Profiles" tab
    D. Click "New"
    E. Name it (for first time i choose dark theme)
    F. Choose "Appearance"
    G. Choose theme (optionally you can choose specific cursor)
    H. Click OK
    I. Repeat same with other theme (for me it`s light theme)

  2. Now find those folders in: ~/.local/share/konsole/ (themes also should be text documents)

  3. you need to install Kate, kwriteconfig, qdbus (or maybe you need kwriteconfig 6 and qdbus 6 if just kwriteconfig qdbus doesn`t work): Open Konsole and enter: sudo dnf install kate kwriteconfig qdbus (or sudo dnf install kate kwriteconfig6 qdbus6)

  4. Find some folder and Right-click -> Create New -> Empty file; Now you need to name it with .sh ending (for example light.sh) and make same with other theme (for example dark.sh)

  5. Open light.sh text and paste this (instead of bold italic font phrases you should insert your theme names):

plasma-apply-desktoptheme Name of your light theme plasma style (just name)

sed -i "s/^theme=aurorae__svg.*$/theme=aurorae__svg__Name of your light theme window decoration (just name)/g" "$HOME/.config/kwinrc"
qdbus org.kde.KWin /KWin org.kde.KWin.reconfigure

kwriteconfig6 --file kcminputrc --group Mouse --key cursorTheme "Name of your light theme cursor theme (just name)"
plasma-apply-cursortheme Name of your light theme cursor theme (just name)

kwriteconfig6 --file konsolerc --group "Desktop Entry" --key DefaultProfile "Name of your konsole light theme.profile"

  1. Save it

  2. Now repeat with your dark themes in dark.sh

  3. Now open Konsole in folder where your scripts are stored (by pressing Alt+Shift+F4) and enter: chmod +x light.sh

  4. After that enter: chmod +x dark.sh

  5. After that enter in Konsole:
    ./light.sh
    ./dark.sh
    (Theme should change)

  6. Now open Koi -> Preferences -> Custom BASH Script and place light.sh to LIGHT: find a path in your file manager and select light.sh and dark.sh to DARK: same thing

That`s all! This worked for me.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Added/Changed Features/OptionsNewly added or changed features, instructions and/or optionsSuggestionAll kinds of suggestions

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions