{"id":13683290,"url":"https://github.com/jceb/dex","last_synced_at":"2025-04-08T00:39:56.018Z","repository":{"id":1246893,"uuid":"764358","full_name":"jceb/dex","owner":"jceb","description":"DesktopEntry Execution","archived":false,"fork":false,"pushed_at":"2024-09-27T11:21:41.000Z","size":141,"stargazers_count":449,"open_issues_count":6,"forks_count":37,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-31T23:33:58.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jceb.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2010-07-08T17:46:54.000Z","updated_at":"2025-03-24T01:48:13.000Z","dependencies_parsed_at":"2025-02-28T19:09:58.943Z","dependency_job_id":"c88ac075-cdac-4daf-a59f-a93a1efd2975","html_url":"https://github.com/jceb/dex","commit_stats":{"total_commits":95,"total_committers":17,"mean_commits":5.588235294117647,"dds":0.3263157894736842,"last_synced_commit":"d68c5d01c22bf7df967dd25f5f1a8f082557b445"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jceb%2Fdex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jceb%2Fdex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jceb%2Fdex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jceb%2Fdex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jceb","download_url":"https://codeload.github.com/jceb/dex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755560,"owners_count":20990620,"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":[],"created_at":"2024-08-02T13:02:06.517Z","updated_at":"2025-04-08T00:39:55.977Z","avatar_url":"https://github.com/jceb.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"dex\n===\n\n.. image:: https://github.com/jceb/dex/actions/workflows/test.yml/badge.svg\n   :target: https://github.com/jceb/dex/actions\n   :alt: Test Status\n\nSynopsis\n--------\n\n**dex** [*options*] [*DesktopEntryFile*]...\n\nDescription\n-----------\n\n``dex``, DesktopEntry Execution, is a program to generate and execute DesktopEntry files of the Application type.\n\nOptions\n-------\n\n+------------------------------------+------------------------------------------------------------+\n| Option                             | Description                                                |\n+====================================+============================================================+\n| -h, --help                         | Show a help message and exit                               |\n+------------------------------------+------------------------------------------------------------+\n| --action ACTION                    | Identifier of an \"additional application action\" to        |\n|                                    | operate on. Also known as a quicklist/jumplist entry.      |\n+------------------------------------+------------------------------------------------------------+\n| -a, --autostart                    | Autostart programs                                         |\n+------------------------------------+------------------------------------------------------------+\n| -c, --create PATH                  | Create a DesktopEntry file for the program at the given    |\n|                                    | path. An optional second argument is used to specify the   |\n|                                    | filename of the created DesktopEntry file,or specify the   |\n|                                    | filename - to print the file to stdout. By default a new   |\n|                                    | file is createdwith the .desktop file extension.           |\n+------------------------------------+------------------------------------------------------------+\n| -d, --dry-run                      | Dry run, don't execute any command                         |\n+------------------------------------+------------------------------------------------------------+\n| -e, --environment ENVIRONMENT      | Specify the Desktop Environment an autostart should be     |\n|                                    | performed for; works only in combination with -a           |\n+------------------------------------+------------------------------------------------------------+\n| -p PROPERTY, --property PROPERTY   | Display DesktopEntry property value. Supported properties  |\n|                                    | are: Type, Version, Name, NoDisplay, Hidden, OnlyShowIn,   |\n|                                    | NotShowIn, TryExec, Exec, Path, Terminal, Actions,         |\n|                                    | StartupNotify, StartupWMClass, URL. For ACTIONs, only Name |\n|                                    | and Exec are supported.                                    |\n+------------------------------------+------------------------------------------------------------+\n| -s, --search-paths SEARCHPATHS     | Colon separated list of paths to search for desktop files, |\n|                                    | overriding the default search list                         |\n+------------------------------------+------------------------------------------------------------+\n| -t, --target-directory ENVIRONMENT | Create files in target directory                           |\n+------------------------------------+------------------------------------------------------------+\n| --term TERM                        | The terminal emulator that will be used to run the program |\n|                                    | if Terminal=true is set in the desktop file, defaults to   |\n|                                    | x-terminal-emulator.                                       |\n+------------------------------------+------------------------------------------------------------+\n| -w, --wait                         | Block until the program exits.                             |\n+------------------------------------+------------------------------------------------------------+\n| --test                             | Perform a self-test                                        |\n+------------------------------------+------------------------------------------------------------+\n| -v, --verbose                      | Verbose output                                             |\n+------------------------------------+------------------------------------------------------------+\n| -V, --version                      | Display version information                                |\n+------------------------------------+------------------------------------------------------------+\n\nExamples\n--------\n\nPerform an autostart/execute all programs in the autostart folders.\n\n        ``dex -a``\n\nPerform an autostart/execute all programs in the specified folders.\n\n        ``dex -a -s /etc/xdg/autostart/:~/.config/autostart/``\n\nPreview the programs would be executed in a regular autostart.\n\n       ``dex -ad``\n\nPreview the programs would be executed in a GNOME specific autostart.\n\n       ``dex -ad -e GNOME``\n\nPreview the value of DesktopEntry property Name.\n\n       ``dex -p Name htop.desktop``\n\nCreate a DesktopEntry for a program in the current directory.\n\n       ``dex -c /usr/bin/skype``\n\nCreate a DesktopEntry for a programs in autostart directroy.\n\n       ``dex -t ~/.config/autostart -c /usr/bin/skype /usr/bin/nm-applet``\n\nExecute a single program from command line and enable verbose output.\n\n       ``dex -v skype.desktop``\n\nExecute a single program (with Terminal=true in the desktop file) in gnome-terminal.\n\n        ``dex --term gnome-terminal nvim.desktop``\n\nExecute a single program and block until it exits.\n\n        ``dex --wait nvim.desktop``\n\nExecute a specifified application action.\n\n        ``dex --action new-private-window firefox.desktop``\n\nAutostart Alternative\n---------------------\n\nI consider ``systemd/user`` as a good alternative for ``dex``'s autostart\nfunctionality and switched to it recently. In particular, systemd solves the\nissue of ``dex`` losing control over the started processes which causes\nprocesses to live longer than the X session which could cause additional\nannoyances like reboots taking a lot of time because the system is waiting for\nthe processes to terminate.\n\nThe following steps will help you to get to a working ``systemd/user``\nconfiguration:\n\n- Create the systemd user directory: ``mkdir -p ~/.config/systemd/user``\n- Create an autostart target at ``~/.config/systemd/user/autostart.target``\n  with the following content::\n\n        [Unit]\n        Description=Current graphical user session\n        Documentation=man:systemd.special(7)\n        RefuseManualStart=no\n        StopWhenUnneeded=no\n\n- Create service files at ``~/.config/systemd/user/\u003cservice name\u003e.service`` that\n  service the same purpose as the ``\u003cservice\u003e.desktop`` files created by\n  ``dex``. The service file should have at least the following content::\n\n        [Unit]\n        Description=\u003cservice description\u003e\n\n        [Service]\n        ExecStart=\u003cpath to the executable\u003e [\u003cparameters\u003e]\n\n  - Attention: for the service to work properly it mustn't fork. Systemd will\n    take care of the service management but it can only do this when the service\n    doesn't fork! If the services forks and terminates the main process, systemd\n    will kill all the processes related to the service. The service will\n    therefore not run at all! The man page of the service should list the\n    required parameters that need to be provided to the service to avoid\n    forking.\n\n- Register a service with systemd:\n\n      ``systemctl --user add-wants autostart.target \u003cservice name\u003e.service``\n\n  - Unregister a service:\n\n      ``systemctl --user disable \u003cservice name\u003e.service``\n\n  - List currently active services:\n\n      ``systemctl --user list-units``\n\n- Finally, start all services in the autostart target during startup by\n  replacing the ``dex -a`` command with:\n\n      ``systemctl --user start autostart.target``\n\n  - Reload all service configurations after making changes to a service file:\n\n        ``systemctl --user daemon-reload``\n\n  - Start a service:\n\n        ``systemctl --user start \u003cservice name\u003e.service``\n\n  - Check the status of a service:\n\n        ``systemctl --user status \u003cservice name\u003e.service``\n\n  - Stop a service:\n\n        ``systemctl --user stop \u003cservice name\u003e.service``\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjceb%2Fdex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjceb%2Fdex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjceb%2Fdex/lists"}