How to set emacsclient background as Emacs background?
set-background-color
and set-foreground-color
only affect the current frame, and your .emacs
file is not executed when running emacsclient
.
Try setting the variable default-frame-alist
("Alist of default values for frame creation") instead:
(setq default-frame-alist
'((background-color . "#101416")
(foreground-color . "#f6f3e8")))
create emacs alias that starts in background?
Instead of calling /usr/bin/emacs-snapshot
directly, write a script that calls /usr/bin/emacs-snapshot
in the background and then returns:
#!/bin/sh
case $# in
0) /usr/bin/emacs-snapshot &
*) /usr/bin/emacs-snapshot "$@" &
esac
Then you call the script in the ordinary way; it will launch a background emacs process and return immediately.
If you want to get fancy you can use /bin/bash
and disown
the process after the esac
(get the pid with $!
).
How to set default emacs background and foreground colors?
Add the following to your .emacs
:
(add-to-list 'default-frame-alist '(foreground-color . "#E0DFDB"))
(add-to-list 'default-frame-alist '(background-color . "#102372"))
You might want to look at http://www.emacswiki.org/emacs/FrameParameters and the links therein.
how to check if emacs in frame or in terminal?
(defun my-frame-config (frame)
"Custom behaviours for new frames."
(with-selected-frame frame
(when (display-graphic-p)
(set-background-color "#101416")
(set-foreground-color "#f6f3e8"))))
;; run now
(my-frame-config (selected-frame))
;; and later
(add-hook 'after-make-frame-functions 'my-frame-config)
Emacs: disable theme background color in terminal
(defun on-after-init ()
(unless (display-graphic-p (selected-frame))
(set-face-background 'default "unspecified-bg" (selected-frame))))
(add-hook 'window-setup-hook 'on-after-init)
Combined with the code in your edit, it worked nicely for me for both emacsterms and newly started emacsen. As for why window-setup-hook
:
http://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html
(neither of the earlier hooks seemed to work except for this one.)
Change Emacs' background color
It seems that it's better to use
(custom-set-faces
'(default ... )
'(region ... )
....
)
style to set faces, this way it will not have that problem.
How to get background type of Emacs? e.g. 'light or 'dark
You can use the function frame-parameter
to get the attributes of a frame. For your particular case you can do
(frame-parameter nil 'background-mode)
To get background-mode of the current frame. The first parameter is the frame for which you want to the get specified parameter, if nil the currently selected frame is used. You can do C-hfframe-parameter
RET
Related Topics
Is There Way to Delete Duplicate Header in a File in Unix
Fixing the Line-Endings in a Git Repository Using the '.Gitattributes' File
Start X86_64 Code on X86 (32Bit) Linux, Running on X86_64 Cpu
Synchronizing Four Shell Scripts to Run One After Another in Unix
How to Run a Linux Command That Still Runs After I Close My Putty Ssh Session
How to Mount Google Bucket as Local Disk on Linux Instance with Full Access Rights
Collecting the Data for a Partiulcar Process from Pmu for Every 1 Milli Second
Redirect Two or More Stdout to a Single Stdin
Getting Github Files (And Updates) Onto an Ubuntu Web Server
How to Save the Execution Log When We Run a Command Using Putty/Plink
Qmake .Pro File Not Parsed Correctly to Generate Ld_Library_Path
Suppress or Prevent Duplicate Inotifywait Events
Perf-Report Show Value of CPU Register
Access Denied to Android.Git.Kernel.Org
How to Capitalize First Letter of Each Line in Bash