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
9a8bd5e2
Commit
9a8bd5e2
authored
Jul 27, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added detection of desktop environment
parent
f3490af4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
ximper-unified-theme-switcher-service
service/bin/ximper-unified-theme-switcher-service
+25
-4
No files found.
service/bin/ximper-unified-theme-switcher-service
View file @
9a8bd5e2
...
...
@@ -100,19 +100,40 @@ check_and_update_themes
main
()
{
if
check_gsettings_schema
;
then
echo
"reaction mode: after dbus signal"
local
COUNT
=
0
case
"
$XDG_SESSION_DESKTOP
"
in
gnome
*
)
echo
"GNOME DETECTED"
local
GNOME_DE
=
True
;;
Hyprland
*
)
echo
"HYPRLAND DETECTED"
;;
*
)
;;
esac
if
[
"
$GNOME_DE
"
=
True
]
;
then
local
COUNT
=
0
fi
dbus-monitor
"interface='org.freedesktop.portal.Settings',member=SettingChanged"
|
\
while
IFS
=
read
-r
LINE
;
do
local
THEME
THEME
=
$(
echo
"
$LINE
"
|
grep
-E
-o
'string "(prefer-dark|default)"'
)
if
[
-n
"
$THEME
"
]
;
then
((
COUNT++
))
if
[
$((
$COUNT
%
2
))
=
0
]
;
then
if
[
"
$GNOME_DE
"
=
True
]
;
then
((
COUNT++
))
if
[
$((
$COUNT
%
2
))
=
0
]
;
then
echo
"
$THEME
"
check_and_update_themes
COUNT
=
0
fi
else
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