Skip to content

Commit f8840ea

Browse files
Discojapiluisbocanegra
Discojapi
authored andcommitted
feat: add option to enable konsole blur
Adds `--konsole-blur`in backend and `konsole_blur` in config and widget Blur is applied to the generated Konsole color scheme
1 parent f102fed commit f8840ea

File tree

6 files changed

+33
-0
lines changed

6 files changed

+33
-0
lines changed

src/kde_material_you_colors/apply_themes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def apply(config: Configs, wallpaper: WallpaperReader, dark_light):
7171
konsole_opacity=config.read("konsole_opacity"),
7272
konsole_opacity_dark=config.read("konsole_opacity_dark"),
7373
dark_light=dark_light,
74+
blur=config.read("konsole_blur"),
7475
)
7576
if config.read("disable_konsole") is not True:
7677
konsole_utils.apply_color_scheme()

src/kde_material_you_colors/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ def defaults(self):
159159
"toolbar_opacity_dark": [args.toolbar_opacity_dark, None, 1],
160160
"konsole_opacity": [args.konsole_opacity, None, 1],
161161
"konsole_opacity_dark": [args.konsole_opacity_dark, None, 1],
162+
"konsole_blur": [args.konsole_blur, False, 0],
162163
"color": [args.color, None, 3],
163164
"klassy_windeco_outline": [args.klassy_windeco_outline, None, 0],
164165
"custom_colors_list": [args.custom_colors_list, None, 3],

src/kde_material_you_colors/data/sample_config.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ ncolor = 0
9090
#konsole_opacity = 85
9191
#konsole_opacity_dark = 85
9292

93+
# Konsole background blur
94+
# Accepted values are True or False
95+
# Default is commented (False)
96+
#konsole_blur = False
97+
9398
# Title Bar opacity (normal and dark mode)
9499
# Requires one of the following window decorations:
95100
# Klassy https://github.com/paulmcauley/klassy || Sierra Breeze Enhanced https://github.com/kupiqu/SierraBreezeEnhanced

src/kde_material_you_colors/main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,13 @@ def main():
230230
metavar="<integer>",
231231
)
232232

233+
parser.add_argument (
234+
"--konsole-blur",
235+
action="store_true",
236+
help="Apply blur to Konsole background.",
237+
default=None,
238+
)
239+
233240
parser.add_argument(
234241
"--stop",
235242
action="store_true",

src/kde_material_you_colors/utils/konsole_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def export_scheme(
1717
konsole_opacity=100,
1818
konsole_opacity_dark=100,
1919
dark_light=False,
20+
blur=False,
2021
):
2122
"""Exports the color scheme files to the konsole configuration folder
2223
@@ -25,6 +26,7 @@ def export_scheme(
2526
pywal_light (_type_, optional): Light mode from pywal setting. Defaults to None.
2627
schemes (ThemeConfig, optional): Theme configuration. Defaults to None.
2728
konsole_opacity (int, optional): Konsole background opacity. Defaults to 100.
29+
blur (bool, optional): Applies blur to Konsole background. Defaults to False.
2830
"""
2931
# Make sure the konsole config path exists
3032
if not os.path.exists(settings.KONSOLE_DIR):
@@ -109,6 +111,7 @@ def export_scheme(
109111

110112
config["General"]["Description"] = "MaterialYou"
111113
config["General"]["Opacity"] = str(opacity)
114+
config["General"]["Blur"] = str(blur).lower()
112115

113116
with open(settings.KONSOLE_COLOR_SCHEME_PATH, "w", encoding="utf-8") as configfile:
114117
config.write(configfile, space_around_delimiters=False)

src/plasmoid/package/contents/ui/FullRepresentation.qml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ ColumnLayout {
529529
property string iconsdark; \
530530
property int konsole_opacity: 100; \
531531
property int konsole_opacity_dark: 100; \
532+
property bool konsole_blur: false; \
532533
property int titlebar_opacity: 100; \
533534
property int titlebar_opacity_dark: 100; \
534535
property int toolbar_opacity: 100; \
@@ -1420,6 +1421,21 @@ ColumnLayout {
14201421
}
14211422
}
14221423
}
1424+
RowLayout {
1425+
PlasmaComponents3.Label {
1426+
text: "Apply blur to background"
1427+
Layout.alignment: Qt.AlignLeft
1428+
}
1429+
1430+
PlasmaComponents3.CheckBox {
1431+
checked: settings.konsole_blur
1432+
1433+
onCheckedChanged: {
1434+
settings.konsole_blur = checked
1435+
}
1436+
}
1437+
1438+
}
14231439

14241440
Rectangle {
14251441
Layout.preferredWidth: mainLayout.width

0 commit comments

Comments
 (0)