Skip to content

Commit

Permalink
fixed some issues with gnome
Browse files Browse the repository at this point in the history
  • Loading branch information
lunarcloud committed Jun 8, 2024
1 parent 9b2f68c commit 6f3501f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 72 deletions.
87 changes: 16 additions & 71 deletions script-dialog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ elif [ "$XDG_CURRENT_DESKTOP" != "" ]; then
elif [ "$XDG_DATA_DIRS" != "" ]; then
# shellcheck disable=SC2001
desktop=$(echo "$XDG_DATA_DIRS" | sed 's/.*\(xfce\|kde\|gnome\).*/\1/')
elif pgrep -l "mutter" > /dev/null; then
desktop="gnome"
elif pgrep -l "kwin" > /dev/null; then
desktop="kde"
else
desktop="unknown"
fi
Expand Down Expand Up @@ -221,103 +225,44 @@ function relaunchIfNotVisible() {

#standard window icons
function standardIconInfo() {
if [ "$INTERFACE" == "zenity" ]; then
echo "info"
elif [ "$INTERFACE" == "kdialog" ]; then
echo "dialog-information"
else
echo ""
fi
echo "dialog-information"
}
function standardIconQuestion() {
if [ "$INTERFACE" == "zenity" ]; then
echo "question"
elif [ "$INTERFACE" == "kdialog" ]; then
echo "dialog-question"
else
echo ""
fi
echo "dialog-question"
}
function standardIconError() {
if [ "$INTERFACE" == "zenity" ]; then
echo "error"
elif [ "$INTERFACE" == "kdialog" ]; then
echo "dialog-error"
else
echo ""
fi
echo "dialog-error"
}
function standardIconWarning() {
if [ "$INTERFACE" == "zenity" ]; then
echo "warning"
elif [ "$INTERFACE" == "kdialog" ]; then
echo "dialog-warning"
else
echo ""
fi
echo "dialog-warning"
}
function standardIconFolderOpen() {
if [ "$INTERFACE" == "zenity" ]; then
echo "info"
elif [ "$INTERFACE" == "kdialog" ]; then
echo "folder-open"
else
echo ""
fi
echo "folder-open"
}
function standardIconFolderSave() {
if [ "$INTERFACE" == "zenity" ]; then
echo "info"
echo "document-save"
elif [ "$INTERFACE" == "kdialog" ]; then
echo "folder-save"
else
echo ""
fi
}
function standardIconFileOpen() {
if [ "$INTERFACE" == "zenity" ]; then
echo "info"
elif [ "$INTERFACE" == "kdialog" ]; then
echo "document-open"
else
echo ""
fi
echo "document-open"
}
function standardIconFileSave() {
if [ "$INTERFACE" == "zenity" ]; then
echo "info"
elif [ "$INTERFACE" == "kdialog" ]; then
echo "document-save"
else
echo ""
fi
echo "document-save"
}
function standardIconPassword() {
if [ "$INTERFACE" == "zenity" ]; then
echo "question"
elif [ "$INTERFACE" == "kdialog" ]; then
echo "dialog-password"
else
echo ""
fi
echo "dialog-password"
}

function standardIconCalendar() {
if [ "$INTERFACE" == "zenity" ]; then
echo "question"
elif [ "$INTERFACE" == "kdialog" ]; then
echo "x-office-calendar"
else
echo ""
fi
echo "x-office-calendar"
}
function standardIconDocument() {
if [ "$INTERFACE" == "zenity" ]; then
echo "info"
elif [ "$INTERFACE" == "kdialog" ]; then
echo "x-office-document"
else
echo ""
fi
echo "x-office-document"
}
#end standard icons

Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ relaunchIfNotVisible

APP_NAME="Test Script"
#WINDOW_ICON="$SCRIPT_DIR/icon.png" # if not set, it'll use standard ones
#INTERFACE="kdialog" #force an interface, but only do this for testing
#INTERFACE="zenity" #force an interface, but only do this for testing

if [ "$NO_SUDO" == true ]; then
messagebox "No SUDO is available on this system."
Expand Down

0 comments on commit 6f3501f

Please sign in to comment.