Skip to content

Commit fb20d44

Browse files
committed
Remove custom launcher; install variety as a console script
1 parent c730e31 commit fb20d44

File tree

3 files changed

+26
-66
lines changed

3 files changed

+26
-66
lines changed

bin/variety

Lines changed: 0 additions & 66 deletions
This file was deleted.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ description = "Wallpaper changer, downloader and manager"
1414
dynamic = ["version", "readme"]
1515
urls = { Homepage = "https://github.com/varietywalls/variety" }
1616

17+
[project.scripts]
18+
variety = "variety:main"
19+
1720
[tool.black]
1821
line-length = 100
1922
target_version = ['py38']

variety/__init__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,29 @@ def _set_up_logging(verbose):
171171

172172

173173
def main():
174+
if os.geteuid() == 0:
175+
print(
176+
'Variety is not supposed to run as root.\n'
177+
'You should NEVER run desktop apps as root, unless they are supposed to make '
178+
'system-global changes and you know very well what you are doing.\n'
179+
'Please run it with your normal user.\n'
180+
'\n'
181+
'If you are trying to run as root because Variety does not start at all with your normal '
182+
'user, you may be hitting a file permission issue or a bug.\n'
183+
'Here is what to do to troubleshoot:\n'
184+
'\n'
185+
'1. Open a terminal and run "variety -v" with your normal user.\n'
186+
'Look for exceptions and hints in the log for what the problem might be.\n'
187+
'\n'
188+
'2. You may try to rename ~/.config/variety to ~/.config/variety_bak and try again.\n'
189+
'This will have Variety start from a clean state.\n'
190+
'Your old config and images will remain in variety_bak\n'
191+
'\n'
192+
'3. If none of these help, open a bug in https://github.com/varietywalls/variety/issues '
193+
'and follow the instructions there.'
194+
)
195+
sys.exit(1)
196+
174197
# Ctrl-C
175198
signal.signal(signal.SIGINT, _sigint_handler)
176199
signal.signal(signal.SIGTERM, _sigint_handler)

0 commit comments

Comments
 (0)