{"id":15021546,"url":"https://github.com/gamemann/web-desktop-app-launcher","last_synced_at":"2025-10-29T07:32:49.299Z","repository":{"id":256336281,"uuid":"854932838","full_name":"gamemann/web-desktop-app-launcher","owner":"gamemann","description":"A web/desktop application launcher I made for a mini-PC I recently purchased for game/movie streaming and emulation.","archived":false,"fork":false,"pushed_at":"2024-09-17T08:05:14.000Z","size":2722,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T19:52:18.711Z","etag":null,"topics":["app-launcher","applauncher","application","cplusplus","desktop","go","golang","gtk","gtk3","gui","launcher","linux","qt","web","webkit","webkit2gtk","webserver","website"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gamemann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-10T02:31:58.000Z","updated_at":"2024-12-14T17:41:15.000Z","dependencies_parsed_at":"2024-09-10T07:23:20.479Z","dependency_job_id":"0df4d264-8a7e-439e-a247-e1bf8b9c329d","html_url":"https://github.com/gamemann/web-desktop-app-launcher","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"cda0543c95119c208f52965b6f55e510be3c1d64"},"previous_names":["gamemann/web-desktop-app-launcher"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2Fweb-desktop-app-launcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2Fweb-desktop-app-launcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2Fweb-desktop-app-launcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2Fweb-desktop-app-launcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gamemann","download_url":"https://codeload.github.com/gamemann/web-desktop-app-launcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238791894,"owners_count":19531027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app-launcher","applauncher","application","cplusplus","desktop","go","golang","gtk","gtk3","gui","launcher","linux","qt","web","webkit","webkit2gtk","webserver","website"],"created_at":"2024-09-24T19:56:42.553Z","updated_at":"2025-10-29T07:32:43.844Z","avatar_url":"https://github.com/gamemann.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"After purchasing a [mini-PC](https://www.amazon.com/dp/B0D5CS3CDS) that I planned to use for movie and game streaming along with emulation ([Dolphin](https://dolphin-emu.org/); Wii/GameCube), I found opening specific applications from the terminal was inconvenient. I wanted an application that allowed me to launch specific applications such as [Steam Link](https://store.steampowered.com/app/353380/Steam_Link/), [RetroArch](https://www.retroarch.com/), [Dolphin](https://dolphin-emu.org/), and [Plex HTPC](https://support.plex.tv/articles/htpc-getting-started/) from the desktop itself and through a website.\n\nWhile I am sure there are applications that are already capable of achieving this, I wanted to make my own applications to gain more experience (specifically with C++ and GTK + WebKit2GTK).\n\n**NOTE** - The website intentionally doesn't contain any security measures and runs commands under the user running the website. Do **not** expose this website to unauthorized users! I only recommend running it under your LAN and on a server that doesn't contain any sensitive data.\n\n## Preview\n### Video Demonstration\n[![vid](./preview/vid-thumb.jpeg)](https://www.youtube.com/watch?v=0g1pquXcWic)\n### Website\n![Website Preview](./preview/web-preview01.png)\n\n**NOTE** - I may improve the front-end web design in the future, but wanted to create something simple first.\n\n## Technologies Used\n### Desktop Application\nI utilize [GTK 3](https://docs.gtk.org/gtk3/) and [WebKit2GTK](https://webkitgtk.org/) to create a desktop application through GNOME and display our web page.\n\n### Web Application\nI simply utilize Golang for running a web server with its template system for serving HTML content along with basic JavaScript and CSS.\n\n## Building\nI recommend using the [`Makefile`](./Makefile) via `make` to build this project. You will also need to build the [`nlohmann/json`](https://github.com/nlohmann/json) library which is used to parse our config file in the desktop application.\n\n### Prerequisites\n* Golang\n* GTK 3 \u0026 WebKit2GTK (e.g. `libgtk-3-dev` and `libwebkit2gtk-4.0-dev` Ubuntu/Debian packages)\n* [`nlohmann/json`](https://github.com/nlohmann/json)\n\nFor Ubuntu/Debian, I'd recommend the following command to install the required system packages.\n\n```bash\nsudo apt install -y libgtk-3-dev libwebkit2gtk-4.0-dev pkgconf build-essential make cmake golang-go\n```\n\n### Cloning\nClone the repository recursively so that the JSON sub-module is also cloned.\n\n```bash\n# Clone the repository\ngit clone --recursive https://github.com/gamemann/web-desktop-app-launcher.git /var/web-desktop-app-launcher\n\n# Change directories.\ncd /var/web-desktop-app-launcher\n```\n\n**NOTE** - The reason I clone into `/var/` is because that is the directory the [`systemd`](./systemd/) services use as the working directory. You may change this if you'd like of course.\n\n### Desktop Application\n#### Building The JSON Library\nYou will need to build the [`nlohmann/json`](https://github.com/nlohmann/json) library before building the main desktop application. You can use `make json` or the following shell commands.\n\n```bash\n# Change to JSON library.\ncd src/desktop/modules/json\n\n# Create build directory and change to it.\nmkdir build\n\ncd build/\n\n# Use CMake.\ncmake ..\n\n# Install library to system.\ncmake --build . --target install\n```\n\nAfterwards, you may use `make` and `make install` (as root) to build and install the desktop and web applications.\n\n## Command Line\nAt this time, both the web and desktop applications use the same command-line options which are listed below.\n\n| Flag(s) | Default | Description |\n| ----- | ------- | ----------- |\n| `-c --cfgflag` | `/etc/wdal/conf.json` | The path to the config file. |\n| `-l --list` | N/A | Prints the config settings. |\n| `-v --version` | N/A | Prints the current version. |\n| `-h --help` | N/A | Prints the help menu. |\n\n## Configuration\nBoth the desktop and web applications parse a single JSON config file (the default path is `/etc/wdal/conf.json`). In both applications, you can also change the config path via the `-c` and `--cfgpath` command-line flags (e.g. `-c ./conf.json`).\n\n| Key | Type | Default | Description |\n| --- | ---- | ------- | ----------- |\n| desktop | Desktop Object | `{}` | The desktop application object (read below). |\n| web | Web Object | `{}` | The web object (read below). |\n| applications | Application Object Array | `[]` | The applications object array (read below). |\n\n\u003cdetails\u003e\n    \u003csummary\u003eExample(s)\u003c/summary\u003e\n\n```json\n{\n    \"desktop\": {\n        ...\n    },\n    \"web\": {\n        ...\n    },\n    \"apps\": [\n        ...\n    ]\n}\n```\n\u003c/details\u003e\n\n### Desktop Object\nThe desktop object contains information on the desktop application.\n\n| Key | Type | Default | Description |\n| --- | ---- | ------- | ----------- |\n| window_width | int | `1920` | The application window width (useless with full-screen mode). |\n| window_height | int | `1080` | The application window height (useless with full-screen mode). |\n| full_screen | bool | `true` | Whether to use full-screen mode for the desktop application. |\n\n\u003cdetails\u003e\n    \u003csummary\u003eExample(s)\u003c/summary\u003e\n\n```json\n{\n    \"window_width\": 1200,\n    \"window_height\": 720,\n    \"full_screen\": false\n}\n```\n\u003c/details\u003e\n\n### Web Object\nThe web object contains information on the website and web server.\n\n| Key | Type | Default | Description |\n| --- | ---- | ------- | ----------- |\n| host | string | `127.0.0.1` | The web host/address to bind with. |\n| port | int | `2001` | The web port to bind with. |\n| log_to_file | bool | `true` | Logs `stdout` and `stderr` pipes from processes launched to `log_directory/apps`. |\n| log_directory | string | `logs/web` | The directory to log to. |\n| env | Object | `{}` | A string to string object that represents environmental variables that should be set before launching every application. |\n\n\u003cdetails\u003e\n    \u003csummary\u003eExample(s)\u003c/summary\u003e\n\n```json\n{\n    \"host\": \"192.168.1.5\",\n    \"port\": 80,\n    \"env\": {\n        \"GLOBAL_ENV1\": \"VAL1\",\n        \"GLOBAL_ENV2\": \"VAL2\"\n    }\n}\n```\n\u003c/details\u003e\n\n### Application Object\n| Key | Type | Default | Description |\n| --- | ---- | ------- | ----------- |\n| name | string | `NULL` | The name of the application (for display). |\n| start | string | `NULL` | The command to execute when starting the application. |\n| stop | string | `NULL` | The command to execute when stopping the application. |\n| banner | string | `NULL` | The banner to use inside of the web-view card. |\n| env | Object | `{}` | A string to string object that represents environmental variables (key =\u003e value). |\n\n\u003cdetails\u003e\n    \u003csummary\u003eExample(s)\u003c/summary\u003e\n\n```json\n[\n    {\n        \"name\": \"Steam Link\",\n        \"start\": \"flatpak run com.valvesoftware.SteamLink\",\n        \"stop\": \"pkill steamlink\",\n        \"banner\": \"/images/steam.jpg\"\n    },\n    {\n        \"name\": \"RetroArch\",\n        \"start\": \"retroarch\",\n        \"stop\": \"pkill retroarch\",\n        \"banner\": \"/images/retroarch.png\"\n    },\n    {\n        \"name\": \"Dolphin\",\n        \"start\": \"dolphin-emu\",\n        \"stop\": \"pkill dolphin-emu\",\n        \"banner\": \"/images/dolphin.jpg\"\n    },\n    {\n        \"name\": \"Plex HTPC\",\n        \"start\": \"flatpak run tv.plex.PlexHTPC\",\n        \"stop\": \"pkill plex-bin\",\n        \"banner\": \"/images/plex.png\"\n    }\n]\n```\n\u003c/details\u003e\n\n## Notes\n### Launching GUI Applications From WDAL On Debian 12\nThere were a couple of things I needed to do in order to get applications to launch from WDAL.\n\n1. The command `xhost +LOCAL:` (or `xhost +SI:localuser:$(whoami)`) needs to be executed. Executing this command doesn't save on reboot, but for most Linux distros you can put this command inside your `$HOME/.bashrc` file so it saves on reboot.\n2. The `DISPLAY` (usually `:0`) and `XAUTHORITY` (usually `$HOME/.Xauthority`) environmental variables need to be set inside of the config for all apps.\n\nThis is likely the case for other Linux distros also. There's a chance on other distros like Ubuntu that it has a different desktop manager (e.g. GDM) and the `.Xauthority` file is somewhere else.\n\nFor my Debian 12 installation that has autologin enabled (and keyring disabled), placing the `xhost` command inside of the `$HOME/.bashrc`, `$HOME/.xinitrc`, `$HOME/.xprofile`, `/etc/profile`, and `/etc/X11/Xsession.d/60xhost` files did not work on reboot along with a `systemd` service. Therefore, I needed to create a desktop autostart file in `$HOME/.config/autostart/xhost.desktop` with the following contents (you may need to create the `$HOME/.config/autostart` directory).\n\n```bash\n[Desktop Entry]\nType=Application\nExec=bash -c \"sleep 5 \u0026\u0026 DISPLAY=:0 xhost +LOCAL:\"\nX-GNOME-Autostart-enabled=true\n```\n\n## Credits\n* [Christian Deacon](https://github.com/gamemann)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamemann%2Fweb-desktop-app-launcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgamemann%2Fweb-desktop-app-launcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamemann%2Fweb-desktop-app-launcher/lists"}