I have an extension gdm-extension GitHub - PRATAP-KUMAR/gdm-extension: GDM Extension - Tweak few things of GDM Login Screen from the login screen itself.
Recently I got a request to add a feature for choosing fonts, same as shell-themes and icon-themes from the above extension.
For this I need to get all .ttf
and .otf
file names from two folders
[/usr/local/share/fonts, /usr/share/fonts]
after searching for 2 days, I decided to use this documentation. File Operations | GNOME JavaScript
when I try to use the code it as it is to delete files, It seems to work.
Gio.IOErrorEnum: Error removing file /usr/share/fonts/cantarell/Cantarell-VF.otf: Permission denied
Stack trace:
recursiveDeleteCallback@file:///home/admin/.local/share/gnome-shell/extensions/recursive/extension.js:50:18
recursiveFileOperation@file:///home/admin/.local/share/gnome-shell/extensions/recursive/extension.js:104:44
async*recursiveDeleteCallback@file:///home/admin/.local/share/gnome-shell/extensions/recursive/extension.js:55:20
recursiveFileOperation@file:///home/admin/.local/share/gnome-shell/extensions/recursive/extension.js:104:44
async*myPatch@file:///home/admin/.local/share/gnome-shell/extensions/recursive/extension.js:143:19
enable@file:///home/admin/.local/share/gnome-shell/extensions/recursive/extension.js:128:14
_callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:266:38
_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:798:24
async*_sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:827:20
async*ExtensionManager/<@resource:///org/gnome/shell/ui/extensionSystem.js:48:18
_callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
_sync@resource:///org/gnome/shell/ui/sessionMode.js:207:14
popMode@resource:///org/gnome/shell/ui/sessionMode.js:178:14
_continueDeactivate@resource:///org/gnome/shell/ui/screenShield.js:543:30
deactivate/<@resource:///org/gnome/shell/ui/screenShield.js:534:44
finish@resource:///org/gnome/shell/gdm/authPrompt.js:688:13
finish@resource:///org/gnome/shell/ui/unlockDialog.js:882:26
deactivate@resource:///org/gnome/shell/ui/screenShield.js:534:26
_getLoginSession/<@resource:///org/gnome/shell/ui/screenShield.js:152:24
_callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
_convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
@resource:///org/gnome/shell/ui/init.js:21:20
Gio.IOErrorEnum: Error removing file /usr/share/fonts/encodings/viscii1.1-1.enc.gz: Permission denied
This line from above, indicates that the recursion is working
Gio.IOErrorEnum: Error removing file /usr/share/fonts/cantarell/Cantarell-VF.otf: Permission denied
When I replace file.delete(cancellable)
with names.push(file)
nothing working.
Please help.