Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I hide the apps without icons and It does not detect ~/.local/share/applications/*.desktop files #4

Closed
gusbemacbe opened this issue Jun 26, 2021 · 36 comments · Fixed by #19

Comments

@gusbemacbe
Copy link

Hello,

I want to hide these apps without icon:

imagem

And it does not detect the desktop configuration files from ~/.local/share/applications where VSCode desktop files are located and are not found in the nwg-drawer.

@gusbemacbe
Copy link
Author

Observe that nw-drawer crashes just after three seconds.

@nwg-piotr
Copy link
Owner

nwg-piotr commented Jun 26, 2021

I use many .desktop files in ~/.local/share/applications, either to hide them with NoDisplay=true or to run them in a non-standard way, and it works here.

Please run the drawer from the terminal and show me the output. Also tell me more about your system.

@gusbemacbe
Copy link
Author

Hello,

  • Log:
nwg-drawer -c 10 -fm dolphin -is 128 -lang en_GB
lang: en_GB
Found 215 desktop files
Skipped 2 duplicates; 49 .desktop entries hidden by "NoDisplay=true"
Using style from /home/gusbemacbe/.config/nwg-panel/drawer.css
Using XDG user dirs from /home/gusbemacbe/.config/user-dirs.dirs

** (nwg-drawer:420834): WARNING **: 19:51:41.784: gtk-layer-shell v0.6.0 may not work on GTK v3.24.29. If you experience crashes, check https://github.com/wmww/gtk-layer-shell/blob/master/compatibility.md
UI created in 276 ms. Thank you for your patience.
env vars: []; command: ''; args: []
  • neofetch:
neofetch
██████████████████  ████████   gusbemacbe@manjaro 
██████████████████  ████████   ------------------ 
██████████████████  ████████   OS: Manjaro Linux x86_64 
██████████████████  ████████   Host: X370GT7 
████████            ████████   Kernel: 5.9.16-1-MANJARO 
████████  ████████  ████████   Uptime: 8 hours, 22 mins 
████████  ████████  ████████   Packages: 1973 (pacman) 
████████  ████████  ████████   Shell: zsh 5.8 
████████  ████████  ████████   Resolution: 2560x1080 
████████  ████████  ████████   WM: sway 
████████  ████████  ████████   Theme: Matcha-dark-sea [GTK2/3] 
████████  ████████  ████████   Icons: Papirus-Dark-Maia [GTK2/3] 
████████  ████████  ████████   Terminal: kitty 
████████  ████████  ████████   Terminal Font: RobotoMonoNerdFontCompleteM-Regular 
                               CPU: AMD Ryzen 7 2700X (16) @ 3.700GHz 
                               GPU: AMD ATI Radeon RX 5600 OEM/5600 XT / 5700/5700 XT 
                               Memory: 3802MiB / 16025MiB 

@nwg-piotr
Copy link
Owner

I see no crash in the terminal. What do you mean by "nw-drawer crashes just after three seconds"? The window gets closed a second after moving the cursor outside it. Could it be this?

@gusbemacbe
Copy link
Author

I have tested. It is the search box that the nw-drawer crashing. I was about to search, but it crashed before I was about to type.

@gusbemacbe
Copy link
Author

The apps without icons did not tell their names for me to hide. They are still displayed.

@nwg-piotr
Copy link
Owner

They are still displayed

I'm looking for a possible reason.

I need to know more about the crash. Please run from terminal again, let the app crash and show me the output.

@gusbemacbe
Copy link
Author

After I added NoDisplay to the apps, the apps without icons number increased in the nwg-drawer, then I understood now why the apps without icons are displayed. The apps without icons are still displayed because of NoDisplay. If I removed NoDisplay, the apps without icons would disappear.

@gusbemacbe
Copy link
Author

Another log, but still the same. I ran the app from the terminal, searched and typed, then it crashed:

nwg-drawer -c 10 -fm dolphin -is 128 -lang en_GB
lang: en_GB
Found 227 desktop files
Skipped 14 duplicates; 44 .desktop entries hidden by "NoDisplay=true"
Using style from /home/gusbemacbe/.config/nwg-panel/drawer.css
Using XDG user dirs from /home/gusbemacbe/.config/user-dirs.dirs

** (nwg-drawer:444007): WARNING **: 20:17:40.564: gtk-layer-shell v0.6.0 may not work on GTK v3.24.29. If you experience crashes, check https://github.com/wmww/gtk-layer-shell/blob/master/compatibility.md
UI created in 325 ms. Thank you for your patience.

TL:R: ** (nwg-drawer:444007): WARNING **: 20:17:40.564: gtk-layer-shell v0.6.0 may not work on GTK v3.24.29. If you experience crashes, check https://github.com/wmww/gtk-layer-shell/blob/master/compatibility.md

@nwg-piotr
Copy link
Owner

The warning is just a warning. The gtk-layer-shell library had no updates for several months, and it warns it could behave improperly with the current GTK version. But it behaves well.

I still see no crash.

@gusbemacbe
Copy link
Author

I tried to debug the crash from different terminals – alacritty, etc. It always crashes when I click and type in the search box.

@gusbemacbe
Copy link
Author

I tested with nwggrid and it gave the log:

WM: sway
Locale: pt
terminate called after throwing an instance of 'Gtk::CssProviderError'
zsh: abort (core dumped)  nwggrid

Is it this case that caused nwg-drawer to crash, not just nwggrid?

@nwg-piotr
Copy link
Owner

Well, no idea. The drawer has been coded from scratch and shares no code with nwggrid. However, nwggrid should work on Manjaro... It seems I need to set up Manjaro somewhere, and try to debug it locally.

@gusbemacbe
Copy link
Author

@nwg-piotr
Copy link
Owner

Give me some time. I need to take a closer look at the possible NoDisplay=true bug earlier.

@nwg-piotr
Copy link
Owner

It seems to work perfectly well. Are you sure you added NoDisplay=true inside the [Desktop Entry] section?

@gusbemacbe
Copy link
Author

Yes, see the screenshot:

imagem

Compare the first screenshot of the first comment to the last, as you can see the app without icon number increased:

imagem

Observe that I added NoDisplay=true to VSCode desktop file at ~/.local/share/applications, it became an app without icon added to nwg-drawer.

If I copied it to /usr/share/applications, it is hidden.

@nwg-piotr
Copy link
Owner

I'm installing Manjaro on my testing laptop.

@nwg-piotr
Copy link
Owner

Well, I'm not. The ISO seems to be corrupted. It's not being seen by the ImageWriter, and the checksum is different.

@nwg-piotr
Copy link
Owner

BTW: could I see your printenv output?

@gusbemacbe
Copy link
Author

SHELL=/usr/bin/zsh
QT_WAYLAND_DISABLE_WINDOWDECORATION=1
I3SOCK=/run/user/1000/sway-ipc.1000.2003.sock
LC_ADDRESS=pt_PT.UTF-8
DOTNET_ROOT=/usr/share/dotnet
LC_NAME=pt_PT.UTF-8
LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video1
LIBVA_DRIVER_NAME=v4l2_request
LC_MONETARY=pt_PT.UTF-8
MOZ_DBUS_REMOTE=1
XCURSOR_SIZE=24
EDITOR=nvim
XDG_SEAT=seat0
PWD=/home/gusbemacbe
LOGNAME=gusbemacbe
QT_QPA_PLATFORMTHEME=qt5ct
XDG_SESSION_TYPE=wayland
GIT_SUBREPO_ROOT=/home/gusbemacbe/GitHub/Outros/git-subrepo
MOTD_SHOWN=pam
HOME=/home/gusbemacbe
LANG=pt_PT.UTF-8
LC_PAPER=pt_PT.UTF-8
XDG_CURRENT_DESKTOP=sway
SWAYSOCK=/run/user/1000/sway-ipc.1000.2003.sock
WAYLAND_DISPLAY=wayland-1
TERMINAL_COMMAND=/usr/share/sway/scripts/terminal.sh
GTK_CSD=0
DOTNET_BUNDLE_EXTRACT_BASE_DIR=/home/gusbemacbe/.cache/dotnet_bundle_extract
QT_QPA_PLATFORM=wayland
XDG_SESSION_CLASS=user
TERM=xterm-kitty
LC_IDENTIFICATION=pt_PT.UTF-8
GLYPH_DESKTOP=󰄶 
USER=gusbemacbe
DISPLAY=:0
SHLVL=1
MOZ_ENABLE_WAYLAND=1
LC_TELEPHONE=pt_PT.UTF-8
LC_MEASUREMENT=pt_PT.UTF-8
XDG_VTNR=2
XDG_SESSION_ID=3
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
GLYPH_COMMAND=󰆍 
XDG_RUNTIME_DIR=/run/user/1000
LC_TIME=pt_PT.UTF-8
GREETD_SOCK=/run/greetd-738.sock
XDG_DATA_DIRS=/home/gusbemacbe/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
PATH=/home/gusbemacbe/.poetry/bin:/home/gusbemacbe/GitHub/Outros/git-subrepo/lib:/home/gusbemacbe/.config/composer/vendor/bin:/home/gusbemacbe/.rbenv/shims:/home/gusbemacbe/.rbenv/bin:/home/gusbemacbe/.nvm/versions/node/v15.8.0/bin:/home/gusbemacbe/.poetry/bin:/home/gusbemacbe/.local/bin:/opt/git-subrepo/lib:/usr/local/sbin:/usr/local/bin:/usr/bin:/home/gusbemacbe/.dotnet/tools:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/gusbemacbe/Android/SDK/emulator:/home/gusbemacbe/Android/SDK/tools:/home/gusbemacbe/Android/SDK/tools/bin:/home/gusbemacbe/Android/SDK/platform-tools:/home/gusbemacbe/Aplicativos/Fontes/Android Studio/bin:/home/gusbemacbe/Aplicativos/Fontes/Flutter/bin:/home/gusbemacbe/Aplicativos/Fontes/Flutter/.pub-cache/bin:/home/gusbemacbe/.pub-cache/bin
QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/qt/plugins
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
MAIL=/var/spool/mail/gusbemacbe
LC_NUMERIC=pt_PT.UTF-8
_=/usr/bin/printenv
KITTY_WINDOW_ID=1
COLORTERM=truecolor
TERMINFO=/usr/lib/kitty/terminfo
OLDPWD=/home/gusbemacbe
ZDOTDIR=/home/gusbemacbe/.config/zsh
P9K_TTY=old
_P9K_TTY=/dev/pts/1
P9K_SSH=0
LESS_TERMCAP_mb=
LESS_TERMCAP_md=
LESS_TERMCAP_me=
LESS_TERMCAP_se=
LESS_TERMCAP_so=
LESS_TERMCAP_ue=
LESS_TERMCAP_us=
LESS=-R
PKGFILE_PROMPT_INSTALL_MISSING=1
NVM_DIR=/home/gusbemacbe/.nvm
NVM_CD_FLAGS=-q
NVM_BIN=/home/gusbemacbe/.nvm/versions/node/v15.8.0/bin
NVM_INC=/home/gusbemacbe/.nvm/versions/node/v15.8.0/include/node
RBENV_SHELL=zsh
GTK_USE_PORTAL=1
MANPATH=/home/gusbemacbe/GitHub/Outros/git-subrepo/man:
ANDROID_HOME=/home/gusbemacbe/Android/SDK
_JAVA_AWT_WM_NONREPARENTING=1
JAVA_HOME=/usr/lib/jvm/java-11-openjdk
JDK_HOME=/etc/java-openjdk
STUDIO_JDK=/usr/lib/jvm/java-11-openjdk
CHROME_EXECUTABLE=/usr/bin/google-chrome-unstable

@gusbemacbe
Copy link
Author

Well, I'm not. The ISO seems to be corrupted. It's not being seen by the ImageWriter, and the checksum is different.

Try from https://github.com/Manjaro-Sway/manjaro-sway

@nwg-piotr
Copy link
Owner

OK, got it. Will try to install.

@gusbemacbe
Copy link
Author

I figured out. The problem was not DNoDisplay = true. The nwg-drawer does not recognise the desktop files that have spaces between equal (=) and displayed them as app without icons. For example:

[Desktop Entry]
Categories = Debugger; Development; Git; IDE; Programming; TextEditor; 
Comment = Editor for building and debugging modern web and cloud applications
Exec = bash -c "code-insiders ~/Workspaces/Linux/Flutter.code-workspace"
GenericName = Text Editor
Icon = vscode-flutter
Keywords = editor; IDE; plaintext; text; write; 
MimeType = application/x-shellscript; inode/directory; text/english; text/plain; text/x-c; text/x-c++; text/x-c++hdr; text/x-c++src; text/x-chdr; text/x-csrc; text/x-java; text/x-makefile; text/x-moc; text/x-pascal; text/x-tcl; text/x-tex; 
Name = VSCode Insiders with Flutter
Name[pt] = VSCode Insiders com Flutter
StartupNotify = true
StartupWMClass = code - insiders
Terminal = false
Type = Application
Version = 1.0

But Drun, nwggrid, Rofi and Wofi recognise perfectly my totally customised desktop files.

After I removed all the spaces between = in this desktop file, nwg-drawer recognised it now.

But curiously, nwggrid recognised perfectly the desktop files that have spaces between =, while nwg-drawer does not recognise.

I observed that after fixing it, nwg-drawer does not display the desktop files icons that are saved in ~/.local/share/icons/hicolor/scalable/.

After renaming the folder application to application-backup, I tested the nwg-drawer, all app without icons disappeared. The problem was = with spaces that nwg-drawer does not recognise or support, but nwggrid does recognise or support.

Then I tested the search box, it really crashed when I typed the search box.

@nwg-piotr
Copy link
Owner

You should not use spaces. I do no trim while parsing .desktop files. Surely it could be done, but I skipped all not really necessary lines, as the time of parsing is crucial.

Then I tested the search box, it really crashed when I typed the search box.

I'm not sure what you mean.

@gusbemacbe
Copy link
Author

I'm not sure what you mean.

When you click the search box and are typing any word, it just crashes.

@gusbemacbe
Copy link
Author

I tried to record the crash, the screenshot is black, I'll seek how to record the crash.

@nwg-piotr
Copy link
Owner

OK, I'll have Manjaro installed sooner or later. Just need on more free ethernet port in my router.

@nwg-piotr
Copy link
Owner

I don't confirm the issue. The search entry works as it should on Manjaro sway (latest Release 202106270235). BTW: the Manjaro implementation of sway is the least comfortable I've ever seen.

2021-06-27-044638_screenshot.png

james-lawrence added a commit to james-lawrence/nwg-drawer that referenced this issue Aug 31, 2021
- speed up parsing by not creating nearly as many strings.
- fix basic whitespace handling. fixes nwg-piotr#4

goos: linux
goarch: amd64
pkg: github.com/nwg-piotr/nwg-drawer
cpu: AMD Ryzen 7 1800X Eight-Core Processor
BenchmarkDesktopEntryParserOld-16    	   10000	    146094 ns/op
BenchmarkDesktopEntryParser-16       	   26097	     43303 ns/op
PASS
ok  	github.com/nwg-piotr/nwg-drawer	3.090s
james-lawrence added a commit to james-lawrence/nwg-drawer that referenced this issue Aug 31, 2021
- speed up parsing by not creating nearly as many strings.
- fix basic whitespace handling. fixes nwg-piotr#4

goos: linux
goarch: amd64
pkg: github.com/nwg-piotr/nwg-drawer
cpu: AMD Ryzen 7 1800X Eight-Core Processor
BenchmarkDesktopEntryParserOld-16    	   10000	    146094 ns/op
BenchmarkDesktopEntryParser-16       	   26097	     43303 ns/op
PASS
ok  	github.com/nwg-piotr/nwg-drawer	3.090s
james-lawrence added a commit to james-lawrence/nwg-drawer that referenced this issue Aug 31, 2021
- speed up parsing by not creating nearly as many strings.
- fix basic whitespace handling. fixes nwg-piotr#4

goos: linux
goarch: amd64
pkg: github.com/nwg-piotr/nwg-drawer
cpu: AMD Ryzen 7 1800X Eight-Core Processor
BenchmarkDesktopEntryParserOld-16    	   10000	    146094 ns/op
BenchmarkDesktopEntryParser-16       	   26097	     43303 ns/op
PASS
ok  	github.com/nwg-piotr/nwg-drawer	3.090s
@boredland
Copy link

I don't confirm the issue. The search entry works as it should on Manjaro sway (latest Release 202106270235). BTW: the Manjaro implementation of sway is the least comfortable I've ever seen.

Since I am very open to feedback, I'd be interested if you could elaborate a bit on that. Wdym with comfortable?

@nwg-piotr
Copy link
Owner

You mean the issue? Couldn't reproduce it in any way on any machine. It just works.

@boredland
Copy link

Nah, not the issue, but the harsh criticism of manjaro sway edition ;-)

@nwg-piotr
Copy link
Owner

LOL, I thought so. :) Sorry, I haven't seen Manjaro for months. I bet it must be much more comfortable nowadays.

@boredland
Copy link

LOL, I thought so. :) Sorry, I haven't seen Manjaro for months. I bet it must be much more comfortable nowadays.

Since comfortable is a very general assessment, it is pretty hard to argue with that. We certainly did not Garuda it up in any way.

@nwg-piotr
Copy link
Owner

Sure. I'm a GUI guy, and my vision of sway is a bit unorthodox. ;)

@boredland
Copy link

Sure. I'm a GUI guy, and my vision of sway is a bit unorthodox. ;)

I know ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants