Skip to content

Commit b291237

Browse files
authored
[SpicesUpdate@claudiux] v7.4.7: Now compatible with Cinnamon on Gentoo (#6741)
* v7.4.7: Now compatible with Cinnamon on Gentoo * v7.4.7: Let the user enter commands when dependencies are missing * v7.4.7: Updates CHANGELOG
1 parent 6bdead2 commit b291237

File tree

5 files changed

+67
-22
lines changed

5 files changed

+67
-22
lines changed

SpicesUpdate@claudiux/files/SpicesUpdate@claudiux/6.0/applet.js

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,7 @@ class SpicesUpdate extends IconApplet {
12071207
file_new_for_path("/usr/share/fonts/TTF/Symbola.ttf").query_exists(null) ||
12081208
file_new_for_path("/usr/share/fonts/truetype/Symbola.ttf").query_exists(null) ||
12091209
file_new_for_path("/usr/share/fonts/gdouros-symbola/Symbola.ttf").query_exists(null) ||
1210+
file_new_for_path("/usr/share/fonts/ttf-ancient-fonts/Symbola_hint.ttf").query_exists(null) ||
12101211
file_new_for_path("%s/.local/share/fonts/Symbola_Hinted.ttf".format(HOME_DIR)).query_exists(null) ||
12111212
file_new_for_path("%s/.local/share/fonts/Symbola.ttf".format(HOME_DIR)).query_exists(null) ||
12121213
file_new_for_path("%s/.local/share/fonts/Symbola.otf".format(HOME_DIR)).query_exists(null);
@@ -1216,7 +1217,9 @@ class SpicesUpdate extends IconApplet {
12161217
let _isArchlinux = _ArchlinuxWitnessFile.query_exists(null);
12171218
let _openSUSEWitnessFile = file_new_for_path("/usr/share/licenses/openSUSE-release");
12181219
let _isopenSUSE = _openSUSEWitnessFile.query_exists(null);
1219-
if (_isArchlinux || _isopenSUSE) {
1220+
let _GentoWitnessFile = file_new_for_path("/etc/gentoo-release"); // Gentoo
1221+
let _isGentoo = _GentoWitnessFile.query_exists(null);
1222+
if (_isArchlinux || _isopenSUSE || _isGentoo) {
12201223
Util.spawnCommandLineAsync("/bin/sh -c \"%s/install_symbola_on_Arch.sh\"".format(SCRIPTS_DIR), null, null);
12211224
_fonts_installed = true
12221225
}
@@ -1227,19 +1230,43 @@ class SpicesUpdate extends IconApplet {
12271230
} // End of are_dependencies_installed
12281231

12291232
get_terminal() {
1233+
let _SETTINGS_SCHEMA = "org.cinnamon.desktop.default-applications.terminal";
1234+
let _SETTINGS_KEY = "exec";
1235+
let gsettings = new Settings({ schema_id: _SETTINGS_SCHEMA });
12301236
var term_found = "";
1231-
var _terminals = ["gnome-terminal", "tilix", "konsole", "guake", "qterminal", "terminator", "uxterm", "xterm"];
1232-
var t;
1233-
let _terminals_length = _terminals.length;
1234-
for (t=0; t < _terminals_length ; t++) {
1235-
if (find_program_in_path(_terminals[t])) {
1236-
term_found = find_program_in_path(_terminals[t]);
1237-
break
1237+
term_found = gsettings.get_string(_SETTINGS_KEY);
1238+
if (term_found.length === 0) {
1239+
var _terminals = ["gnome-terminal", "tilix", "konsole", "guake", "qterminal", "terminator", "uxterm", "xterm"];
1240+
var t;
1241+
let _terminals_length = _terminals.length;
1242+
for (t=0; t < _terminals_length ; t++) {
1243+
if (find_program_in_path(_terminals[t])) {
1244+
term_found = find_program_in_path(_terminals[t]);
1245+
break
1246+
}
12381247
}
12391248
}
12401249
return term_found;
12411250
} // End of get_terminal
12421251

1252+
get_terminal_separator() {
1253+
let _SETTINGS_SCHEMA = "org.cinnamon.desktop.default-applications.terminal";
1254+
let _SETTINGS_KEY = "exec-arg";
1255+
let gsettings = new Settings({ schema_id: _SETTINGS_SCHEMA });
1256+
var sep_found = "";
1257+
sep_found = gsettings.get_string(_SETTINGS_KEY);
1258+
if (sep_found.length === 0) {
1259+
const _terminals_with_double_dashes = ["gnome-terminal"];
1260+
const _terminals_with_e = ["tilix", "konsole", "guake", "qterminal", "terminator", "uxterm", "xterm"];
1261+
let terminal = this.get_terminal();
1262+
if (_terminals_with_double_dashes.indexOf(terminal) > -1)
1263+
return "--";
1264+
if (_terminals_with_e.indexOf(terminal) > -1)
1265+
return "-e";
1266+
}
1267+
return sep_found;
1268+
} // End of get_terminal_separator
1269+
12431270
check_dependencies() {
12441271
if (!this.dependenciesMet && this.are_dependencies_installed()) {
12451272
// At this time, the user just finished to install all dependencies.
@@ -1266,8 +1293,9 @@ class SpicesUpdate extends IconApplet {
12661293
icon_size: 36 });
12671294
// Got a terminal used on this system:
12681295
let terminal = this.get_terminal();
1269-
// apturl is it present?
1270-
let _is_apturl_present = find_program_in_path("apturl");
1296+
let term_sep = this.get_terminal_separator();
1297+
// xdg-open is it present?
1298+
let _is_xdg_open_present = find_program_in_path("xdg-open");
12711299
// Detects the distrib in use and make adapted message and notification:
12721300
let _isFedora = find_program_in_path("dnf");
12731301
let _ArchlinuxWitnessFile = file_new_for_path("/etc/arch-release");
@@ -1281,22 +1309,26 @@ class SpicesUpdate extends IconApplet {
12811309
//var _apt_install = _isFedora ? "sudo dnf install libnotify gdouros-symbola-fonts" : _isArchlinux ? "sudo pacman -Syu libnotify" : _isDebian ? "apt install fonts-symbola" : "sudo apt install fonts-symbola";
12821310
var _apt_install = _isFedora ? "sudo dnf install gdouros-symbola-fonts" : _isArchlinux ? "" : _isDebian ? "apt install fonts-symbola" : _isopenSUSE ? "sudo yast2 --install gdouros-symbola-fonts" : "sudo apt install fonts-symbola";
12831311
let criticalMessagePart1 = _("You appear to be missing some of the programs required for this applet to have all its features.");
1284-
let criticalMessage = _is_apturl_present ? criticalMessagePart1 : criticalMessagePart1+"\n\n"+_("Please execute, in the just opened terminal, the commands:")+"\n "+ _apt_update +" \n "+ _apt_install +"\n\n";
1312+
let criticalMessage = _is_xdg_open_present ? criticalMessagePart1 : criticalMessagePart1+"\n\n"+_("Please execute, in the just opened terminal, the commands:")+"\n "+ _apt_update +" \n "+ _apt_install +"\n\n";
12851313
this.notification = criticalNotify(_("Some dependencies are not installed!"), criticalMessage, icon);
12861314

1287-
if (!_is_apturl_present) {
1288-
if (terminal != "") {
1315+
if (!_is_xdg_open_present) {
1316+
if (terminal.length > 0) {
1317+
Util.spawnCommandLineAsync(terminal);
12891318
// TRANSLATORS: The next messages should not be translated.
1290-
if (_isDebian === true) {
1291-
Util.spawnCommandLineAsync(terminal + " -e '/bin/sh -c \"echo Spices Update message: Some packages needed!; echo To complete the installation, please become root with su then execute the command: ; echo "+ _apt_update + _and + _apt_install + "; sleep 1; exec bash\"'", null, null);
1292-
} else {
1293-
Util.spawnCommandLineAsync(terminal + " -e '/bin/sh -c \"echo Spices Update message: Some packages needed!; echo To complete the installation, please enter and execute the command: ; echo "+ _apt_update + _and + _apt_install + "; sleep 1; exec bash\"'", null, null);
1294-
}
1319+
//~ if (_isDebian === true) {
1320+
//~ Util.spawnCommandLineAsync(terminal + " " + term_sep + " " + " '/bin/bash -c \"echo Spices Update message: Some packages needed!; echo To complete the installation, please become root with su then execute the command: ; echo "+ _apt_update + _and + _apt_install + "; sleep 1; exec bash\"'", null, null);
1321+
//~ } else {
1322+
//~ Util.spawnCommandLineAsync(terminal + " " + term_sep + " " + `'/bin/bash -c \"echo Spices Update message: Some packages needed!; echo To complete the installation, please enter and execute the command: ; echo ${_apt_update} ${_and} ${_apt_install}; sleep 1; exec bash\"'`, null, null);
1323+
//~ }
12951324
}
12961325
} else {
12971326
if (!this.fonts_installed)
1298-
Util.spawnCommandLineAsync("/usr/bin/apturl apt://fonts-symbola");
1327+
Util.spawnCommandLineAsync("/usr/bin/xdg-open apt://fonts-symbola");
12991328
}
1329+
//~ if (_is_xdg_open_present && !this.fonts_installed) {
1330+
//~ Util.spawnCommandLineAsync("/usr/bin/xdg-open apt://fonts-symbola");
1331+
//~ }
13001332
this.dependenciesMet = false;
13011333
}
13021334
// End of check_dependencies

SpicesUpdate@claudiux/files/SpicesUpdate@claudiux/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### v7.4.7~20250105
2+
* Now compatible with Cinnamon on Gentoo.
3+
* Replaces apturl with xdg-open.
4+
* Lets the user enter commands when dependencies are missing.
5+
16
### v7.4.6~20241230
27
* Spices not selected in the lists of settings are displayed first.
38

SpicesUpdate@claudiux/files/SpicesUpdate@claudiux/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ So you should not have to run any of the commands listed below.
6969
|Linux Mint, Ubuntu|`sudo apt install fonts-symbola`|`sudo apt install libnotify-bin`|
7070
|Debian (with root rights)|`apt install fonts-symbola`|`apt install libnotify-bin`|
7171
|openSUSE|`sudo yast2 --install gdouros-symbola-fonts`|`sudo yast2 --install libnotify-tools`|
72+
|Gentoo|`sudo emerge media-fonts/ttf-ancient-fonts::guru`|`sudo emerge x11-libs/libnotify`|
7273

73-
**(*) Useless for Spices Update version 6.0.0 and more.**
74+
**(*) Not required for Spices Update version 6.0.0 and higher, except for Gentoo.**
7475

7576
## Settings
7677

SpicesUpdate@claudiux/files/SpicesUpdate@claudiux/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "Spices Update",
44
"max-instances": "1",
55
"hide-configuration": false,
6-
"version": "7.4.6",
6+
"version": "7.4.7",
77
"description": "Warns you when installed Spices (actions, applets, desklets, extensions, themes) require an update or new Spices are available.",
88
"multiversion": true,
99
"cinnamon-version": [

SpicesUpdate@claudiux/files/SpicesUpdate@claudiux/scripts/install_symbola_on_Arch.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,16 @@ then
1212
curl -s -o Symbola.tar.gz ${URLDOWNLOAD} && {
1313
tar xzf Symbola.tar.gz
1414
cp "Symbola.otf" "${USRFONTSDIR}"
15-
fc-cache -f
15+
[[ -f /etc/gentoo-release ]] || {
16+
fc-cache -f
17+
}
1618
rm -f Symbola.tar.gz
1719
}
1820
fi
1921

22+
if [ -f /etc/gentoo-release ]
23+
then
24+
fc-cache -f
25+
fi
26+
2027
exit 0

0 commit comments

Comments
 (0)