File tree Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- sed -i " s/firefox/google-chrome/" /etc/dconf/db/os2borgerpc.d/02-launcher-favorites
3
+ if [ -d " /snap/firefox" ]; then
4
+ sed -i " s/firefox_firefox/google-chrome/" /etc/dconf/db/os2borgerpc.d/02-launcher-favorites
5
+ else
6
+ sed -i " s/firefox/google-chrome/" /etc/dconf/db/os2borgerpc.d/02-launcher-favorites
7
+ fi
4
8
5
9
dconf update
Original file line number Diff line number Diff line change 10
10
ADD=$1
11
11
PROGRAM=$2
12
12
13
+ if [ -f " /var/lib/snapd/desktop/applications/${PROGRAM} _$PROGRAM .desktop" ]; then
14
+ PROGRAM=" ${PROGRAM} _$PROGRAM "
15
+ fi
16
+
13
17
if [ " $ADD " = " True" ]; then
14
18
15
19
# Append the program specified above to the menu/launcher
Original file line number Diff line number Diff line change @@ -22,8 +22,16 @@ SHADOW=.skjult
22
22
23
23
if [ " $ADD " = ' True' ]; then
24
24
mkdir --parents /home/$SHADOW /Skrivebord
25
- cp " /usr/share/applications/$PROGRAM .desktop" /home/$SHADOW /Skrivebord/
25
+ if [ -f " /var/lib/snapd/desktop/applications/${PROGRAM} _$PROGRAM .desktop" ]; then
26
+ cp " /var/lib/snapd/desktop/applications/${PROGRAM} _$PROGRAM .desktop" /home/$SHADOW /Skrivebord/
27
+ else
28
+ cp " /usr/share/applications/$PROGRAM .desktop" /home/$SHADOW /Skrivebord/
29
+ fi
26
30
else
27
31
echo " Forsøger at slette programmet $PROGRAM "
28
- rm " /home/$SHADOW /Skrivebord/$PROGRAM .desktop"
32
+ if [ -f " /home/$SHADOW /Skrivebord/${PROGRAM} _$PROGRAM .desktop" ]; then
33
+ rm " /home/$SHADOW /Skrivebord/${PROGRAM} _$PROGRAM .desktop"
34
+ else
35
+ rm " /home/$SHADOW /Skrivebord/$PROGRAM .desktop"
36
+ fi
29
37
fi
Original file line number Diff line number Diff line change @@ -17,7 +17,11 @@ BROWSER="$(lower "$1")"
17
17
FILE=" /usr/share/applications/defaults.list"
18
18
19
19
if [ " $BROWSER " = " firefox" ]; then
20
- DESKTOP_FILE=firefox.desktop
20
+ if [ -d " /snap/firefox" ]; then
21
+ DESKTOP_FILE=firefox_firefox.desktop
22
+ else
23
+ DESKTOP_FILE=firefox.desktop
24
+ fi
21
25
else
22
26
DESKTOP_FILE=google-chrome.desktop
23
27
fi
You can’t perform that action at this time.
0 commit comments