Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tuneit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
tuneit
Commits
30d749b6
Commit
30d749b6
authored
Jan 20, 2025
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
icons can now be assigned to categories
parent
a826b552
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
122 deletions
+28
-122
exampleplug.yml
modules/exampleplug.yml
+18
-107
main.py
src/settings/main.py
+10
-15
No files found.
modules/exampleplug.yml
View file @
30d749b6
-
name
:
"
Example"
-
name
:
"
Gnome"
icon
:
preferences-desktop-display-symbolic
weight
:
30
weight
:
30
sections
:
sections
:
-
name
:
Themes
-
name
:
Themes
...
@@ -62,6 +63,7 @@
...
@@ -62,6 +63,7 @@
backend
:
gsettings
backend
:
gsettings
key
:
org.gnome.desktop.interface.enable-animations
key
:
org.gnome.desktop.interface.enable-animations
-
name
:
"
Fonts"
-
name
:
"
Fonts"
icon
:
font-x-generic-symbolic
weight
:
1
weight
:
1
sections
:
sections
:
-
name
:
Main
-
name
:
Main
...
@@ -101,117 +103,26 @@
...
@@ -101,117 +103,26 @@
lower
:
0.5
lower
:
0.5
step
:
0.01
step
:
0.01
digits
:
2
digits
:
2
-
name
:
"
Example2"
-
name
:
"
GRUB"
weight
:
30
icon
:
system-reboot-symbolic
sections
:
-
name
:
Themes2
type
:
classic
weight
:
0
settings
:
-
name
:
IconTheme
type
:
entry
gtype
:
string
backend
:
gsettings
key
:
org.gnome.desktop.interface.icon-theme
-
name
:
Style
type
:
choice
gtype
:
string
help
:
Prefer dark or light for Adwaita applications
backend
:
gsettings
key
:
org.gnome.desktop.interface.color-scheme
default
:
"
default"
map
:
Default
:
default
Light
:
prefer-light
Dark
:
prefer-dark
-
name
:
Clock
weight
:
10
settings
:
-
name
:
Weekday
type
:
boolean
gtype
:
boolean
backend
:
gsettings
key
:
org.gnome.desktop.interface.clock-show-weekday
-
name
:
Date
type
:
boolean
gtype
:
boolean
backend
:
gsettings
key
:
org.gnome.desktop.interface.clock-show-date
-
name
:
Seconds
type
:
boolean
gtype
:
boolean
backend
:
gsettings
key
:
org.gnome.desktop.interface.clock-show-seconds
-
name
:
Battery
weight
:
10
settings
:
-
name
:
Show percentage
type
:
boolean
gtype
:
boolean
backend
:
gsettings
key
:
org.gnome.desktop.interface.show-battery-percentage
-
name
:
Performance
weight
:
20
settings
:
-
name
:
Animations
help
:
Animations can be disabled for performance
type
:
boolean
gtype
:
boolean
backend
:
gsettings
key
:
org.gnome.desktop.interface.enable-animations
-
name
:
"
ThemeSwitcher"
weight
:
25
weight
:
25
sections
:
sections
:
-
name
:
Themes
-
name
:
Main
type
:
classic
type
:
classic
weight
:
0
weight
:
0
settings
:
settings
:
-
name
:
KV Light Theme
-
name
:
Timeout
type
:
entry
root
:
true
gtype
:
string
type
:
number
backend
:
file
gtype
:
i
key
:
KV_LIGHT_THEME
help
:
Select the Kvantum light theme
default
:
KvLibadwaita
params
:
file_path
:
"
~/.config/ximper-unified-theme-switcher/themes"
-
name
:
KV Dark Theme
type
:
entry
gtype
:
string
backend
:
file
key
:
KV_DARK_THEME
help
:
Select the Kvantum dark theme
default
:
KvLibadwaitaDark
params
:
file_path
:
"
~/.config/ximper-unified-theme-switcher/themes"
-
name
:
GTK3 Light Theme
type
:
entry
gtype
:
string
backend
:
file
key
:
GTK3_LIGHT_THEME
help
:
Select the GTK3 light theme
default
:
adw-gtk3
params
:
file_path
:
"
~/.config/ximper-unified-theme-switcher/themes"
-
name
:
GTK3 Dark Theme
type
:
entry
gtype
:
string
backend
:
file
backend
:
file
key
:
GTK3_DARK_THEME
key
:
GRUB_TIMEOUT
help
:
Select the GTK3 dark theme
help
:
Select the GRUB2 timeout
default
:
adw-gtk3-dark
params
:
params
:
file_path
:
"
~/.config/ximper-unified-theme-switcher/themes"
file_path
:
"
/etc/sysconfig/grub2"
-
name
:
Current Theme
default
:
5
type
:
choice
gtype
:
string
backend
:
file
key
:
CURRENT_THEME
help
:
Define the current theme preference
default
:
"
prefer-dark"
map
:
map
:
Prefer Dark
:
prefer-dark
upper
:
999
Prefer Light
:
prefer-light
lower
:
0
Default
:
default
step
:
1
params
:
digits
:
0
file_path
:
"
~/.config/ximper-unified-theme-switcher/themes"
src/settings/main.py
View file @
30d749b6
...
@@ -188,10 +188,11 @@ class SectionFactory:
...
@@ -188,10 +188,11 @@ class SectionFactory:
class
Category
:
class
Category
:
def
__init__
(
self
,
category_data
,
section_factory
:
SectionFactory
):
def
__init__
(
self
,
category_data
,
section_factory
:
SectionFactory
):
self
.
name
=
category_data
[
'name'
]
self
.
name
=
category_data
[
'name'
]
self
.
icon_name
=
category_data
.
get
(
'icon'
,
'preferences-system'
)
self
.
weight
=
category_data
.
get
(
'weight'
,
0
)
self
.
weight
=
category_data
.
get
(
'weight'
,
0
)
self
.
sections
=
[
section_factory
.
create_section
(
s
)
for
s
in
category_data
.
get
(
'sections'
,
[])]
self
.
sections
=
[
section_factory
.
create_section
(
s
)
for
s
in
category_data
.
get
(
'sections'
,
[])]
def
create_stack_page
(
self
,
stack
):
def
create_stack_page
(
self
,
stack
,
listbox
):
box
=
Gtk
.
ScrolledWindow
()
box
=
Gtk
.
ScrolledWindow
()
pref_page
=
Adw
.
PreferencesPage
()
pref_page
=
Adw
.
PreferencesPage
()
clamp
=
Adw
.
Clamp
()
clamp
=
Adw
.
Clamp
()
...
@@ -212,6 +213,12 @@ class Category:
...
@@ -212,6 +213,12 @@ class Category:
stack_page
=
stack
.
add_child
(
box
)
stack_page
=
stack
.
add_child
(
box
)
stack_page
.
set_title
(
self
.
name
)
stack_page
.
set_title
(
self
.
name
)
stack_page
.
set_name
(
self
.
name
)
stack_page
.
set_name
(
self
.
name
)
row
=
TuneItPanelRow
()
row
.
set_name
(
self
.
name
)
row
.
set_title
(
self
.
name
)
row
.
icon_name
=
self
.
icon_name
listbox
.
append
(
row
)
else
:
else
:
print
(
f
"the category {self.name} is empty, ignored"
)
print
(
f
"the category {self.name} is empty, ignored"
)
...
@@ -232,22 +239,11 @@ def init_settings_stack(stack, listbox, split_view):
...
@@ -232,22 +239,11 @@ def init_settings_stack(stack, listbox, split_view):
categories
=
[
Category
(
c
,
section_factory
)
for
c
in
merged_data
]
categories
=
[
Category
(
c
,
section_factory
)
for
c
in
merged_data
]
for
category
in
categories
:
for
category
in
categories
:
category
.
create_stack_page
(
stack
)
category
.
create_stack_page
(
stack
,
listbox
)
if
not
stack
:
if
not
stack
:
print
(
"Ошибка: settings_pagestack не найден."
)
print
(
"Ошибка: settings_pagestack не найден."
)
def
populate_listbox_from_stack
():
pages
=
stack
.
get_pages
()
for
i
in
range
(
pages
.
get_n_items
()):
page
=
pages
.
get_item
(
i
)
row
=
TuneItPanelRow
()
row
.
set_name
(
page
.
get_name
())
row
.
set_title
(
page
.
get_title
())
row
.
icon_name
=
"preferences-system"
listbox
.
append
(
row
)
def
on_row_selected
(
listbox
,
row
):
def
on_row_selected
(
listbox
,
row
):
if
row
:
if
row
:
page_id
=
row
.
get_name
()
page_id
=
row
.
get_name
()
...
@@ -259,4 +255,3 @@ def init_settings_stack(stack, listbox, split_view):
...
@@ -259,4 +255,3 @@ def init_settings_stack(stack, listbox, split_view):
split_view
.
set_show_content
(
True
)
split_view
.
set_show_content
(
True
)
listbox
.
connect
(
"row-selected"
,
on_row_selected
)
listbox
.
connect
(
"row-selected"
,
on_row_selected
)
populate_listbox_from_stack
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment