CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 346
Conversation
Isn't this identical to the xresources-theme? (They'll both load the same color codes) |
This can be done on the fly while hot-reloading Xresources would require forking emacs |
|
Oh whoops, you're right about the color names. But I didn't use |
Can you also rename the file to |
Something weird's going on. After switching to the FINAL EDIT: Seems like it works perfectly in a config-less Emacs and the problem is with Spacemacs. |
I don't think that we should add themes for programs to This is the exact reason why I removed the Would it be possible to add an export file that just contained the color values? Inside |
Maybe we could make it a theme and also export a function to refresh the colors, and simply have the users execute something like Although it still has problems with Spacemacs, I'm gonna look into that once the Antergos installer stops being goofy. |
+1 for a file with only the colors values. (setq wal-foreground "{foreground}"
wal-background "{background}"
wal-cursor "{cursor}"
wal-black "{color1}"
wal-red "{color1}"
wal-green "{color2}"
wal-yellow "{color3}"
wal-blue "{color4}"
wal-magenta "{color5}"
wal-cyan "{color6}"
wal-gray "{color7}"
wal-light-gray "{color8}"
wal-light-red "{color9}"
wal-light-green "{color10}"
wal-light-yellow "{color11}"
wal-light-blue "{color12}"
wal-light-magenta "{color13}"
wal-light-cyan "{color14}"
wal-white "{color15}")
|
@sebastiencs Do you change your Emacs colors on the fly using these colors? |
@omrisim210 Depends what you mean by "on the fly" but I have this code in my emacs init file: (add-hook
'before-make-frame-hook
(lambda ()
(when (file-readable-p "~/.cache/wal/colors-emacs.el")
(load-file "~/.cache/wal/my-colors-emacs.el")
(set-face-attribute 'what-ever-face nil :background wal-foreground :foreground "black")))) The colors are reloaded every times I open a frame |
@sebastiencs So from what I understand you have to BTW, do you use Spacemacs? Because my previous attempts at this (which you can see above) didn't work that well in Spacemacs and I'm not sure how well this will work (I'll test it when I'll be able to) |
You can use |
That's what I meant, sorry if it wasn't clear
β¦On Jul 25, 2017 05:13, "Dylan Araps" ***@***.***> wrote:
You can use -o to get wal to run an external script on finish. That
script could call the eval.
β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#43 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AM1QKYzBuLq_AzwFuXbc2-FtxRJcDoWRks5sRU80gaJpZM4OTttI>
.
|
With the code I wrote the colors are changed automatically when I open a frame, not a buffer. But yes you got the idea. |
So we should open a new project for the Emacs theme |
I am also a spacemacs user, so I think I might know what is causing the problem @omrisim210 . Do you have some colors defined in the very bottom of your .spacemacs file? This was causing issues for me too, to fix it just delete all of the lines defining colors at the end and you should be good to go. |
@tkamat I'll only be at home in a few days, then I'll definitely check if I have colors defined. If that's the only thing that's preventing my Emacs from reloading colors on the fly it'll be wonderful. |
As an alternative option, I've got an emacs that reloads colours from Effectively, I generate the following
And have in my
Now evaling |
In case anyone is wondering about the "file-notify" method, I got it to work using the same
Essentially, you define the same Adding in the template functionality from You can then use the command |
Chiming in late here, but since this is still open, I thought I'd add another solution in case it helps others. One easy way to hot reload the xresources theme is to use emacs' advice functionality to override the function in the xresources theme that retrieves the color. That way, you aren't stuck with the x database emacs creates at launch but rather can grab fresh data from the json file that wal generates. (You could also of course use a custom template to put the data into a emacs lisp expression, but since the json file already exists, we can just be lazy and use that.) Here's an example:
Then just add "emacsclient -e '(my-load-xresources)'" to the script you run with the "-o" option in wal. |
I tried to add an emacs colorscheme, it's basically xresources-theme but with the xresources bits ripped out of it and replaced with
pywal
templates.It does look a bit weird but it's better than no color-hot-swapping:
Usage is simply
(load-file "~/.cache/wal/colors.el")
inielm
and/or.emacs.el
,M-x load-file
or from the command line (can also be automated afterwal
is executed), something like$ emacs -batch --eval='(load-file "~/.cache/wal/colors.el")'