Godot Version: 4.2.1 Stable - Mono
Hello! I’m attempting to create a LinkButton to link to my developer social accounts. I’m running Arch Linux, and the button doesn’t seem to work (Presumably because of Linux). Is there any way I could get OS.shell_open to work on Linux? Here’s The Code:
extends LinkButton
func _on_LinkButton_pressed():
OS.shell_open("https://twitter.com")
Since you are using Linux, and specifically arch, if you type a uri on the command line does it open a browser?
/**************************************************************************/
/* os_linuxbsd.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
This file has been truncated. show original
It looks like kde and gnome are supported. Xdg is the default “agnostic”. do you use any of these that?
If I type the URI on the CLI, It does not open a link unless I prefix the web browser: Ex. firefox https://twitter.com
The shell_open command auto selects the application by pushing to the front. If you don’t use those desktop environments you may be out of luck without some involved environment checking to support your OS.
It uses execute under the hood.
1 Like
Whelp, Thanks for the help! Have a good day!
1 Like