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

[Bug] ^term() not closed when parsing Terminal=true in .desktop files #187

Open
tkapias opened this issue Nov 3, 2022 · 4 comments
Open

Comments

@tkapias
Copy link

tkapias commented Nov 3, 2022

For .desktop entries with Terminal=true, jgmenu does not close the bracket.

Then it fail to use the variable for jgmenurc and can fail some runs.

jgmenu-apps parsed .desktop

They all match Terminal=true applications and miss a closing bracket.

CSV export:

neomutt,^term(neomutt,neomutt,,#Office#Network#Email
btop (System Monitor),^term(btop,btop,,#System#Monitor#ConsoleOnly
Htop (Visualiseur de processus),^term(htop,htop,,#System#Monitor#ConsoleOnly
Vifm (File Manager),^term(vifm,vifm,,#System#FileTools#FileManager#Utility#ConsoleOnly 

Luckily they are still somehow launched and nobody noticed.

Notable issue

But yesterday I had a game that needed to run from a working dir. I wrote a launching script. But because of the missing bracket it would not launch.

I had to use Terminal=false and add ^term() in the .desktop file.

[Desktop Entry]
Name=A Game
Comment=Play this game
Exec=^term(/home/user/folder/start.sh)
Icon=/home/user/folder/icon.png
Terminal=false
Type=Application
Categories=Game;

CSV export:

A Game,^term(/home/user/folder/start.sh),/home/user/folder/icon.png,,#Game

Version - Apt

Package: jgmenu                                                                                                                                          
Version: 4.4.1-1                                                            
Depends: libc6 (>= 2.34), libcairo2 (>= 1.2.4), libglib2.0-0 (>= 2.12.0), libmenu-cache3 (>= 1.1.0), libpango-1.0-0 (>= 1.14.0), libpangocairo-1.0-0 (>= 1.14.0), libpng16-16 (>= 1.6.2-1), librsvg2-2 (>= 2.46.0), libx11-6, libxml2 (>= 2.7.4), libxrandr2 (>= 2:1.2.99.2), python3
@tkapias tkapias changed the title [Bug] ^term() not closed when parsing Termial=true in .desktop files [Bug] ^term() not closed when parsing Terminal=true in .desktop files Nov 3, 2022
@tkapias
Copy link
Author

tkapias commented Nov 3, 2022

I add my jgmenurc too if it could affect the generation:

stay_alive           = 1
verbosity            = 0
tint2_look           = 0
position_mode        = fixed
menu_margin_x        = 2
menu_margin_y        = 27
menu_valign          = top
edge_snap_x          = 0
terminal_exec        = urxvtc
terminal_args        = -e sh -c
menu_width           = 200
menu_padding_top     = 36
menu_padding_right   = 2
menu_padding_bottom  = 5
menu_padding_left    = 2
menu_radius          = 4
menu_border          = 0
sub_hover_action     = 1
item_margin_y        = 2
item_height          = 24
item_padding_x       = 8
item_radius          = 4
item_border          = 0
sep_height           = 12
font                 = IBMNerdMono Regular 9
icon_size            = 16
color_menu_bg        = #2b303b 85
color_norm_bg        = #2b303b 0
color_norm_fg        = #eaeaea 90
color_sel_bg         = #f45100 60
color_sel_fg         = #eaeaea 100
color_sep_fg         = #8fa1b3 40
csv_single_window    = 0
csv_name_format      = %n (%g)

@johanmalm
Copy link
Collaborator

For .desktop entries with Terminal=true, jgmenu does not close the bracket.

I don’t think it matters, but will fix.

Then it fail to use the variable for jgmenurc and can fail some runs.

Are you able to explain in more detail what goes wrong.
Does it segfault?

@tkapias
Copy link
Author

tkapias commented Nov 4, 2022

I'll debug this in more detail, but basically when the ^term() stays open I think it does nothing and the execution falls back to system default terminal.

But I'm not sure yet.

In any case the program I had a problem with is a Steam binary adapted from Windows.
It looks for an .ini file in the binary's execution directory.

  • It works in a terminal if I run the binary from the directory in question.
  • It also works with a shell script that cd's into that directory before execution, if I use ^term() on the script.

But with an open ^term(), the program gives me an error that it has not found the .ini file in the user's root, apparently the PWD was not exported and it looks in the wrong place. So something is different.

@mckaygerhard
Copy link
Contributor

mckaygerhard commented Nov 27, 2023

@tkapias as the line

/* ^term() closing bracket is not needed */
seem that is not affected

i guess the problem is the context execution directory.. seems when jlauncher comes in action it doe sno thcnage to valid directory

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

No branches or pull requests

3 participants