Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-unified-theme-switcher
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
1
Merge Requests
1
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
ximper-unified-theme-switcher
Commits
94cf1411
Commit
94cf1411
authored
Jun 16, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renaming functions and variables (for standardization)
parent
2070a5f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
ximper-unified-theme-switcher-service.sh
ximper-unified-theme-switcher-service.sh
+19
-19
No files found.
ximper-unified-theme-switcher-service.sh
View file @
94cf1411
#!/bin/bash
update
KvantumT
heme
()
{
update
_kv_t
heme
()
{
echo
"Updating Kvantum theme to
$1
..."
if
[
"
$1
"
==
"light"
]
;
then
kvantummanager
--set
KvGnome
...
...
@@ -9,7 +9,7 @@ updateKvantumTheme() {
fi
}
update
GTK3T
heme
()
{
update
_gtk3_t
heme
()
{
echo
"Updating GTK3 theme to
$1
..."
if
[
"
$1
"
==
"light"
]
;
then
gsettings
set
org.gnome.desktop.interface gtk-theme
'adw-gtk3'
...
...
@@ -19,34 +19,34 @@ updateGTK3Theme() {
}
# Function to check and update the theme
check
AndUpdateTheme
()
{
currentTheme
=
$(
gsettings get org.gnome.desktop.interface color-scheme |
awk
-F
"'"
'{print $2}'
)
check
_and_update_themes
()
{
CURRENT_THEME
=
$(
gsettings get org.gnome.desktop.interface color-scheme |
awk
-F
"'"
'{print $2}'
)
if
[
"
$
currentTheme
"
==
"default"
]
;
then
update
KvantumT
heme
"light"
update
GTK3T
heme
"light"
if
[
"
$
CURRENT_THEME
"
==
"default"
]
;
then
update
_kv_t
heme
"light"
update
_gtk3_t
heme
"light"
else
update
KvantumT
heme
"dark"
update
GTK3T
heme
"dark"
update
_kv_t
heme
"dark"
update
_gtk3_t
heme
"dark"
fi
}
# Initial check and update
check
AndUpdateTheme
check
_and_update_themes
count
=
0
COUNT
=
0
dbus-monitor
"interface='org.freedesktop.portal.Settings',member=SettingChanged"
|
\
while
IFS
=
read
-r
line
;
do
theme
=
$(
echo
"
$line
"
|
grep
-E
-o
'string "(prefer-dark|default)"'
)
while
IFS
=
read
-r
LINE
;
do
THEME
=
$(
echo
"
$LINE
"
|
grep
-E
-o
'string "(prefer-dark|default)"'
)
if
[
-n
"
$
theme
"
]
;
then
((
count
++
))
if
[
-n
"
$
THEME
"
]
;
then
((
COUNT
++
))
if
[
$((
$
count
%
2
))
=
0
]
;
then
echo
"
$
theme
"
check
AndUpdateTheme
count
=
0
if
[
$((
$
COUNT
%
2
))
=
0
]
;
then
echo
"
$
THEME
"
check
_and_update_themes
COUNT
=
0
fi
fi
done
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