Conversation

soooooo is there a way to stop a program from opening something in a browser? either via linux directly or wine, but i need it to just not do anything when the program tries to open the URL for that program only

4
0
0
@hanna you should configure MIME in order not to open specific files on a browser window. There are a bunch of ways to do so.
Maybe this could help you a bit: https://wiki.archlinux.org/title/Default_applications
0
0
1

@kanako@the.gayest.dev yeah i'm trying to create an xdg-open config thing rn

0
0
0

@hanna well on nix you could figure out which command-line tool it's using to do the open request (there isn't a dbus endpoint for this specific thing, as far as we're aware), and make the package depend on a custom version of that tool which ignores it

on other linuxes it's harder to do that without affecting other programs

0
0
1

@hanna have a wrapper for xdg-open, and have it just noop for these urls, while passing everything else to normal xdg-open

1
0
0

@4censord i actually did that without even seeing this, but… how?

i can do that, but 1) then it shows up as a desktop entry in rofi/start menus/etc., 2) it can’t just pass everything else to normal xdg-open because it’s the thing that’s set to handle xdg-open requests for the browser so that just recurses, and 3) ideally i’d still like to be able to open this link, just not let a specific program do it (though this can be optional, at least for now)

1
0
0

@hanna ah, i ment like a script, not a desktop entry.
Then you'd just run /usr/bin/xdg-open for passing it on.

1 can be solved, there is a hidden propperty, that just prevents its from being displayed
2: You'd probably want to have it pass to your browser of choice directly if its a link then.

3: i don't think i understand what you want there

1
0
1

@4censord well, for 3 it’s that i want it so a certain program (running in wine) can’t open stuff with xdg-open

but the other issue is that if this is the thing that handles links for xdg-open, then i can’t pass it to xdg-open, since that would just call the script again. i could just hardcode it or make it a variable or whatever, but ideally i’d still like xdg-open’s functionality to work… maybe i could hijack and modify the desktop entry?

0
0
0