New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove styling #3
Conversation
Users like to be able to select their own styles and themes.
Thanks, we will work on more easy styling on the future... 😸 mainly for non-Qt DEs. |
thank you! maybe a command line argument or environment variable will be the right approach. and e.g. on OSX the visual style is already known, so we can detect if running there and apply a style sheet specific for OSX |
@flying-sheep I am thinking something like using
Some friendly access for the CSS is needed anyway, on old GTK Desktops Qt5 by default looks ugly. 😃 |
make that from pathlib import Path
import xdg
config_path = Path(xdg.BaseDirectory.save_config_path('unicodemoticons'))
css_path = config_path / 'style.css'
with css_path.open() as css_f:
try:
css = css_f.read()
except IOError:
css = None
if css == None:
css = DEFAULT_CSS
with css_path.open('w') as css_f:
css_f.write(css) |
@flying-sheep I dont like On Linux I dont have any I am using the following, is more or less crossplatform: On Linux its I dont have problem with The full function I am using right now and testing locally is: def set_or_get_stylesheet(self, stylesheet=QSS_STYLE):
style_file = os.path.join(os.path.expanduser("~"), ".unicodemoticon.css")
if not os.path.isfile(style_file):
with open(style_file, "w", encoding="utf-8") as style_file_object:
style_file_object.write(stylesheet.strip())
with open(style_file, "r", encoding="utf-8") as style_file_object:
stylesheet = style_file_object.read().strip()
return stylesheet Thanks for Collaboration on this; Let me know what you think... |
the spec says that it’s and the spec is there in order to eliminate all the junk in $ ls .* | wc -l
1122 i’d love if you didn’t add to it and respect the XDG spec. it’s also really easy to implement yourself if you don’t want to depend on pyxdg: config_path = os.getenv('XDG_CONFIG_HOME', os.path.expanduser('~/.config'))
yeah, that was my motivation: we can also store a config file in there. and then it’s either |
oh, and to also ideally support other OSs: if sys.platform.startswith('darwin'):
config_path = os.path.expanduser(`~/Library/Preferences`)
else if sys.platform.startswith('win32'):
config_path = os.getenv('APPDATA')
else:
config_path = os.getenv('XDG_CONFIG_HOME', os.path.expanduser('~/.config')) |
Ok, will try to use that snippet this weekend, we are at ~ 7.777 Downloads / Month on UnicodEmoticons. d-( ʘ‿ʘ )_m |
Users like to be able to select their own styles and themes.
I would never use something that diverges noticably from my system look&feel