Skip to content

Commit

Permalink
windowControlSide now works in Gnome
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbruno committed May 24, 2024
1 parent ae92e9d commit 42f63f9
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions usr/share/bigbashview/framework/shell/windowControlSide.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/usr/bin/env bash

# Execute command to obtain left-side button configuration
buttonsLeft=$(kreadconfig6 --group "org.kde.kdecoration2" --key "ButtonsOnLeft" --file "$HOME/.config/kwinrc")

# Execute command to obtain right-side button configuration
buttonsRight=$(kreadconfig6 --group "org.kde.kdecoration2" --key "ButtonsOnRight" --file "$HOME/.config/kwinrc")

minimizeButton="
<a id=\"minimize-btn\" onclick=\"windowControl.minimize()\">
<div class=\"window-control-btn-box\">
Expand Down Expand Up @@ -37,6 +31,22 @@ closeButton="
</a>
"

if [[ $XDG_CURRENT_DESKTOP == 'GNOME' ]]; then

if grep -q ':.*close' <(gsettings get org.gnome.desktop.wm.preferences button-layout); then
buttonsRight='IAX'
else
buttonsLeft='XIA'
fi

else
# Execute command to obtain left-side button configuration
buttonsLeft=$(kreadconfig6 --group "org.kde.kdecoration2" --key "ButtonsOnLeft" --file "$HOME/.config/kwinrc")

# Execute command to obtain right-side button configuration
buttonsRight=$(kreadconfig6 --group "org.kde.kdecoration2" --key "ButtonsOnRight" --file "$HOME/.config/kwinrc")
fi

if [[ "$buttonsLeft" =~ [XAI] ]]; then

echo '<div id="window-controls-left" class="window-controls no-drag">'
Expand Down

0 comments on commit 42f63f9

Please sign in to comment.