{"action":"opened","issue":{"url":"https://api.github.com/repos/qtile/qtile/issues/685","labels_url":"https://api.github.com/repos/qtile/qtile/issues/685/labels{/name}","comments_url":"https://api.github.com/repos/qtile/qtile/issues/685/comments","events_url":"https://api.github.com/repos/qtile/qtile/issues/685/events","html_url":"https://github.com/qtile/qtile/issues/685","id":91570870,"number":685,"title":"How to autostart applications the right way?","user":{"login":"apinsard","id":1536035,"avatar_url":"https://avatars.githubusercontent.com/u/1536035?v=3","gravatar_id":"","url":"https://api.github.com/users/apinsard","html_url":"https://github.com/apinsard","followers_url":"https://api.github.com/users/apinsard/followers","following_url":"https://api.github.com/users/apinsard/following{/other_user}","gists_url":"https://api.github.com/users/apinsard/gists{/gist_id}","starred_url":"https://api.github.com/users/apinsard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apinsard/subscriptions","organizations_url":"https://api.github.com/users/apinsard/orgs","repos_url":"https://api.github.com/users/apinsard/repos","events_url":"https://api.github.com/users/apinsard/events{/privacy}","received_events_url":"https://api.github.com/users/apinsard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-28T08:22:58Z","updated_at":"2015-06-28T08:22:58Z","closed_at":null,"body":"Hi, in order to get some application running on startup, I found [this from the official doc](http://docs.qtile.org/en/latest/manual/config/hooks.html#autostart) and [this from archlinux doc](https://wiki.archlinux.org/index.php/Qtile#Startup).\r\n\r\nBut none of them look elegant, nor provide a way to open application \"X\" on screen \"N\" or on group \"Y\".\r\n\r\nSo I tried to find other solutions to get this result. Some had no effect, some raised exceptions, but none worked.\r\n\r\n### Solution 1\r\n```python\r\n@hook.subscribe.startup_once\r\ndef autostart():\r\n    lazy.to_screen(0)\r\n    lazy.spawn(\"urxvt\")\r\n    lazy.to_screen(1)\r\n    lazy.spawn(\"firefox\")\r\n    lazy.to_screen(0)\r\n```\r\n\r\n### Solution 2\r\n```python\r\n@hook.subscribe.startup_once\r\ndef autostart():\r\n    c = Client()\r\n    c.to_screen(0)\r\n    c.spawn(\"urxvt\")\r\n    c.to_screen(1)\r\n    c.spawn(\"firefox\")\r\n    c.to_screen(0)\r\n```\r\n\r\n### Solution 3\r\n#### autostart.qsh\r\n```qsh\r\n#!/usr/bin/qsh\r\nto_screen(0)\r\nspawn(\"urxvt\")\r\nto_screen(1)\r\nspawn(\"firefox\")\r\nto_screen(0)\r\n```\r\n#### config.py\r\n```python\r\n@hook.subscribe.startup_once\r\ndef autostart():\r\n    home = os.path.expanduser('~')\r\n    subprocess.call([home + '/.config/qtile/autostart.qsh'])\r\n```\r\n\r\n### Solution 4\r\n#### autostart.qsh\r\n```qsh\r\nto_screen(0)\r\nspawn(\"urxvt\")\r\nto_screen(1)\r\nspawn(\"firefox\")\r\nto_screen(0)\r\nexit\r\n```\r\n#### autostart.sh\r\n```sh\r\n#!/bin/sh\r\n/usr/bin/qsh < /home/tony/.config/qtile/autostart.qsh\r\n```\r\n#### config.py\r\n```python\r\n@hook.subscribe.startup_once\r\ndef autostart():\r\n    home = os.path.expanduser('~')\r\n    subprocess.call([home + '/.config/qtile/autostart.sh'])\r\n```\r\n\r\nNone of these solutions gave results.\r\n\r\nSo how to setup my workspace properly on startup? Thanks."}}