Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Cache colour theme setting to save delays.
* Add some fullscreen functions
* Tweak Netbook screen size (emacs23)
  • Loading branch information
stsquad authored and Alex Bennee committed Aug 23, 2009
1 parent 0ce1e49 commit c3fcdf1
Showing 1 changed file with 36 additions and 11 deletions.
47 changes: 36 additions & 11 deletions dotemacs
Expand Up @@ -515,16 +515,30 @@ on the command line"
(if (fboundp 'color-theme-initialize)
(color-theme-initialize))))

(defvar my-last-theme 'nil
"Last color theme we set")

(defun my-color-theme-set (theme)
"Set colour theme but don't bother if we already have"
(if (eq my-last-theme theme)
(message "my-color-theme-set: theme already set")
(if (fboundp theme)
(progn
(funcall theme)
(setq my-last-theme theme)))))

; Define the default frames sizes, shouldn't apply to a tty invocation
; TODO: handle remote sessions better, probably by probing remote X
; geometry somehow.
(cond
((eval I-am-on-netbook)
(message "setting default frame for netbook")
(setq default-frame-alist '((menu-bar-lines . 1)
(tool-bar-lines . 0)
(width . 160)
(height . 28)
(left . 0) ;
(width . 80)
(height . 25)
(left . 0)
(top . 25)
(background-color . "DarkSlateGrey")
(foreground-color . "wheat")
(vertical-scroll-bars . left))))
Expand Down Expand Up @@ -559,17 +573,14 @@ on the command line"

(defun my-set-tty-colours ()
"Set the colours for tty mode"
(if (fboundp 'color-theme-midnight)
(progn
(color-theme-midnight)
; some tweaks
(set-face-attribute 'show-paren-match-face nil :weight 'extra-bold)
(set-face-background 'region "blue"))))
(my-color-theme-set 'color-theme-midnight)
; some tweaks
(set-face-attribute 'show-paren-match-face nil :weight 'extra-bold)
(set-face-background 'region "blue"))

(defun my-set-x-colours()
"Set the colours for X windows mode"
(if (fboundp 'color-theme-gnome2)
(color-theme-gnome2)))
(my-color-theme-set 'color-theme-gnome2))

(defun my-new-frame-colours(frame)
"Set the colour scheme of a new frame"
Expand All @@ -584,6 +595,20 @@ on the command line"
(if I-am-in-console
(my-set-tty-colours))

; Fullscreen
(defun fullscreen (&optional f)
(interactive)
(set-frame-parameter f 'fullscreen
(if (frame-parameter f 'fullscreen) nil 'fullboth)))

(global-set-key [f11] 'fullscreen)

;; (defun switch-full-screen ()
;; (interactive)
;; (shell-command "wmctrl -r :ACTIVE: -btoggle,fullscreen"))

;; (global-set-key [f11] 'switch-full-screen)

(message "Display Done")


Expand Down

0 comments on commit c3fcdf1

Please sign in to comment.