jcaw / theme-magic Goto Github PK
View Code? Open in Web Editor NEW๐จ Apply your Emacs theme to the rest of Linux, using magic. Also works on Mac.
License: GNU General Public License v3.0
๐จ Apply your Emacs theme to the rest of Linux, using magic. Also works on Mac.
License: GNU General Public License v3.0
I get a mapcar* error on theme reload with the 3 themes I've tried. The theme changes in emacs but nothing else happens. The themes are the following: Kaolin-Ocean, Majapahit-Dark and Planet. Here is the error:
Debugger entered--Lisp error: (void-function mapcar*)
mapcar*(cons (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16) ("#13131D" "#CC5B5F" "#EDD790" "#9C80B9" "#52849C" "#CC9474" "#90B8C6" "#E5E5E7" "#5F686A" "#CC5B5F" "#EDD790" "#9C80B9" "#52849C" "#CC9474" "#90B8C6" "#E5E5E7"))
theme-magic--apply-colors-with-pywal(("#13131D" "#CC5B5F" "#EDD790" "#9C80B9" "#52849C" "#CC9474" "#90B8C6" "#E5E5E7" "#5F686A" "#CC5B5F" "#EDD790" "#9C80B9" "#52849C" "#CC9474" "#90B8C6" "#E5E5E7"))
theme-magic-from-emacs()
theme-magic-from-emacs--wrapper(kaolin-ocean nil nil)
apply(theme-magic-from-emacs--wrapper (kaolin-ocean nil nil))
load-theme(kaolin-ocean nil nil)
funcall-interactively(load-theme kaolin-ocean nil nil)
call-interactively(load-theme record nil)
command-execute(load-theme record)
#f(compiled-function (cmd) #<bytecode 0x1623429>)("load-theme")
ivy-call()
ivy-read("M-x " [## c-clear-char-property-fun ansi-color-apply-overlay-face eval-sexp-fu-flash-error haskell-indentation-bird-p 0 -is-infix\? vc-git-stash-snapshot gdb-script-syntax-propertize-function tls-format-message flycheck-next-error magit-reflog-commit help-variable 0 haskell-cabal-empty-regexp extend-region-p rtags-fixitline tramp-do-copy-or-rename-file-out-of-band adwaita nnmail-fix-eudora-headers js--expression-in-sgml-indent-line sgml-syntax-propertize web-mode-warning-face avl-tree--stack-store--cmacro cl-print--preprocess ivy-sort-file-function-default calcFunc-sec :notifier wicon drag-stuff-region-right conf-space-mode-map post-deadline checkdoc-package-keywords-flag being c-mode-var one message-kill-actions nnheader-translate-file-chars cl--loop-initially \' nnoo-import-1 gnus-summary-catchup-from-here rtags-results-buffer-type rx-trans-forms problems sgml-tag-name--cmacro calc-embedded-mode-hook f-empty\? ident message-send-mail-function ...] :predicate commandp :require-match t :history counsel-M-x-history :action #f(compiled-function (cmd) #<bytecode 0x1623429>) :sort t :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
counsel-M-x()
funcall-interactively(counsel-M-x)
call-interactively(counsel-M-x nil nil)
command-execute(counsel-M-x)
And here is how I set up theme-magic:
(use-package theme-magic
:ensure t
:init (theme-magic-export-theme-mode))
Running on Arch Linux, Emacs 26.2. Let me know if anything else is needed.
When using emacsclient
with emacs --daemon
as the server, automatic theme exporting stops working. The wrong background color is extracted. Here's an example of what happens when theme-magic-export-theme-mode
is active and the theme is changed to zenburn
:
To the top right, wal has a preview of the current colors. Color0 (the background color) is not the only color affected, but it is the most dramatic.
Manual theme exporting still works.
What seems to be happening is the default face isn't setting its background color until after theme-magic's advice is processed, but this only happens to emacsclients. (I don't currently know what would cause that.)
This may be related to the server running as a terminal-based Emacs. I don't know how that architecture works.
When I switch themes, I get the following message in the echo area:
Applying colors:
((0 . #000000) (1 . #FF8059) (2 . #79A8FF) (3 . #DBBE5F) (4 . #B6A0FF) (5 . #B0D6F5) (6 . #FEACD0) (7 . #FFFFFF) (8 . #A8A8A8) (9 . #FF8059) (10 . #79A8FF) (11 . #DBBE5F) (12 . #B6A0FF) (13 . #B0D6F5) (14 . #FEACD0) (15 . #FFFFFF))
...after which, nothing happens and I have to explicity call keyboard-quit
to kill the process.
Any clues what could be hanging?
Some themes do not set the ANSI colors correctly. They seem to use the defaults, which don't match the theme.
zenburn
sets the ANSI colors. This looks good. Look at the color palettes:
obsidian
does not seem to set the ANSI colors. Look at the intermediate colors, 1 through 6. They appear to be the defaults (ignore the background and the foreground - these are not set from the ANSI colors):
cherry-blossom
has the same problem:
The only way to get around this would be to set the colors using a different method to the ANSI colors. This could be an optional fallback, which is only used if theme-magic
detects that the ANSI colors are unset.
I don't have access to a Mac. pywal
, the engine that drives the theme application, does work on MacOS (using iTerm 2). theme-magic
should work on MacOS, but I can't test it.
If anyone could test the package on Mac and let me know if it works, it would be most appreciated.
I think it would be useful to have s way to run an external script after pywal has finished similar to the wal -o
flag. At the moment I need to run a script after pywal finishes to relaunch bspwm and dunst. If I could either specify a path to the script to run or maybe even choose what flags to run pywal with, I'd be happy.
Hello
I would like to know where is the xresources file generated located ?
If I close emacs I lose the theme
Hello,
It would be nice if this would also add bright colours.
Thanks.
Pywal automatically extracts colors from a wallpaper, and applies them to your current Linux session wherever it can (mainly, terminals). theme-magic
exports colors, but it can't currently import them.
Add some method for importing Pywal colors, and turning them into a nice theme.
(Visual examples included below - they may be easier to understand)
Most themes that set ANSI colors use the standard color order:
Meaning they will set ANSI color 0 to black, 1 to red, 2 to green, 4 to blue, etc. Almost all themes use this ordering. This means the ANSI colors don't reflect any kind of color dominance. If the Emacs theme uses purple as its dominant color, the ordering of the ANSI colors will not reflect this.
This means the exported theme will not look cohesive for some themes. Two problems become obvious:
This behaviour works well for some themes, such as zenburn
:
However, it doesn't work for others. spacemacs-dark
is designed to use purple as its dominant color - this look is lost when it's exported - everything becomes blue and cyan.
Some themes use non-standard ANSI colors, presumably to get around this problem. These tend to look good. For example, creamsody
:
Some themes look awful. This is cherry-blossom
:
Ideally, the exported theme should somehow reflect the dominant colors of the Emacs theme. If the theme is mainly purple, purple should be dominant. If the theme is monocolor, the different gradients should be reflected instead of just the named ANSI colors.
The obvious solution would be to re-order the colors. Instead of exporting colors in the standard ANSI order, theme-magic
should place the dominant colors in the most-used slots. For example, the spacemacs-dark
theme should put purple in the blue or cyan slot, since it's used the most.
A heuristic would need to be developed that could do this.
Hello
I get an error can't open /usr/bin/python
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.