TOOT_VISIBILITY controls default visibility

This commit is contained in:
Lim Ding Wen 2022-12-22 05:12:35 +08:00 committed by Ivan Habunek
parent f91bfa0c62
commit 8582c8ed62
No known key found for this signature in database
GPG key ID: F5F0623FF5EBCB3D
2 changed files with 3 additions and 2 deletions

View file

@ -348,7 +348,7 @@ POST_COMMANDS = [
}),
(["-v", "--visibility"], {
"type": visibility,
"default": "public",
"default": os.getenv("TOOT_VISIBILITY", "public"),
"help": 'post visibility, one of: %s' % ", ".join(VISIBILITY_CHOICES),
}),
(["-s", "--sensitive"], {

View file

@ -1,5 +1,6 @@
import urwid
import logging
import os
from .constants import VISIBILITY_OPTIONS
from .widgets import Button, EditBox
@ -31,7 +32,7 @@ class StatusComposer(urwid.Frame):
self.cw_remove_button = Button("Remove content warning",
on_press=self.remove_content_warning)
self.visibility = "public"
self.visibility = os.getenv("TOOT_VISIBILITY", "public")
self.visibility_button = Button("Visibility: {}".format(self.visibility),
on_press=self.choose_visibility)