Closed goteksc closed 5 years ago
You can build a .user.css file and tell Firefox to open the file. But you still have to click the "Install" button to update the userstyle.
Not sure if it is possible to simplify this process. I think it doesn't worth creating a native app to handle this.
Actually, it might be easier to output your variables to clipboard, then open the editor in Stylus -> paste the code -> save the style.
So, since you didn't bring it up, I guess stylus stores it's data in a containerfile somewhere in the browser profile, right? The .user.css themselves aren't available as raw text files?
Note: I'm not familiar with webextension development, nor am I a programmer.
You can build a .user.css file and tell Firefox to open the file. But you still have to click the "Install" button to update the userstyle.
I guess I have to live with that. Rarely change wallpaper/color scheme more than once a day anyways. Do I need to do as stated in https://github.com/openstyles/stylus/wiki/UserCSS-authors#hosting-a-usercss, or is it possible to point to a local directory?
stylus stores it's data in a containerfile
There is a built-in browser database which can be used; but it's not accessible at all times (private browsing). And yes we do save the original raw text file along with parsed data.
is it possible to point to a local directory?
You can install usercss files from a local directory.
There is a built-in browser database which can be used
Does this mean there is a file somewhere in the firefox profile directory that I could manipulate with a bash script to update the color variables of a usercss?
You can install usercss files from a local directory.
What I was referring to was the ability to update usercss though stylus, either automatically or on demand. Is that possible with a usercss that is stored locally?
It's saved as an SQLite file (check the reference for location), so I don't think you can modify it using bash, but that's outside my realm of knowledge,
Also check out https://www.jeffersonscher.com/res/stylishextract.html, referenced from https://github.com/openstyles/stylus/issues/77#issuecomment-324156420.
Thanks for the swift responses!
so I don't think you can modify it using bash
Yeah, I think so too, or at least learning SQlite is out of the scope of this little project of mine.
is this in consideration as with pywalfox?
Now, the question is, is there a way for me to change variables inside a style or user.css applied with stylus with a bash script? IE: Are the styles put into a local dir that I was just too dumb to find?
Or is it possible to set stylus to update a user.css on startup or a really short interval? (seconds) That way I could automatically push to a repo containing the user.css with updated color variables.
Why would I want that?
I'm using wpgtk, (pywal has similar functionality) which among other things outputs out a colors.css file which looks like this:
colors.css
I'm appending this, together with custom css into the userChrome.css file of Firefox to update the color scheme of the browser with every use of wpgtk.
cat ~/.config/wpg/formats/colors.css ~/.scripts/firefoxwpg/firefoxTheme.css > ~/.mozilla/firefox/myprofile/chrome/userChrome.css
This is launched as a postscript when I change the color scheme/wallpaper with wpgtk. I tried replicating that approach for duckduckgo.com with the userContent.css file for firefox, but duckduckgo has some wonky priority in loading first it's default theme, then respecting userContent.css and afterwards loading a custom theme (if set) ontop.
I found more success applying my custom css onto duckduckgo with Stylus.