;; HOST/TERMINAL specific config (defun hostname () (read (shell-command-to-string "hostname"))) (defun terminus-bold-16 () (interactive) (set-frame-font "terminus-bold-16")) (defun terminus-bold-20 () (interactive) (set-frame-font "terminus-bold-20")) (defun terminus-bold-28 () (interactive) (set-frame-font "terminus-bold-28")) (defun fixed () (interactive) (set-frame-font "fixed")) ;; Frame fonts (defvar frame-fonts) (setq frame-fonts '("terminus-bold-16" "terminus-bold-20" "terminus-bold-28" "terminus-bold-32" "fixed" )) (defun frame-font-set-current () (interactive) (set-frame-font (car frame-fonts))) (defun frame-font-next () (interactive) (setq frame-fonts (append (cdr frame-fonts) (list (car frame-fonts)))) (frame-font-set-current)) ;; (frame-font-set-current) (defun terminal-init () (frame-minimalistic) (delete-other-windows) (scratch) ;; (split-window-horizontally) ;; (shell) ) (defun frame-minimalistic () (tool-bar-mode -1) (menu-bar-mode -1) (scroll-bar-mode -1)) (defun font-width () (/ (frame-pixel-width) (frame-width))) (defun font-height () (/ (frame-pixel-height) (frame-height))) (defun frame-fullscreen () (modify-frame-parameters nil `((top . 2) (left . 2) (width . ,(- (/ (display-pixel-width) (font-width)) 4)) (height . ,(- (/ (display-pixel-height) (font-height)) 0))))) ;; it might be easier just to go fullscreen using (screen-width) (defvar frame-parameters-host) (set 'frame-parameters-host '((acer . ((top . 2) (left . 2) (width . 166) (height . 58))) (del . ((top . 2) (left . 2) (width . 166) (height . 58))) (ACER . ((top . 2) (left . 2) (width . 166) (height . 58))) (ed . ((top . 2) (left . 2) (width . 188) (height . 66))) (sornfit . ((top . 2) (left . 2) (width . 166) (height . 58))) (zzz . ((top . 2) (left . 0) (width . 210) (height . 78))))) (defun frame-host () (interactive) (let ((config (assoc (hostname) frame-parameters-host))) (if config (modify-frame-parameters nil (cdr config)) (message "no host window config")))) ;; ENV VARS (defun frame-env () (setenv "MANWIDTH" (pp-to-string (- (/ (screen-width) 2) 3)))) (pp-to-string 72) ;; FRAME CONFIGURATION (defun frame-config () (interactive) (frame-notice-user-settings) ;; doesnt work without... (frame-minimalistic) (frame-env) (frame-host)) ;; restore terminal settings after re-attach (defun dtach-restore () (interactive) (redraw-display) (xterm-mouse-mode 1) (frame-minimalistic) ;; (delete-other-windows) ;; pretty annoying... ;; (message "attached") ) ;; not using X11 any more ;; (frame-config) ;; From the `xterm-mouse-mode' help page: ;; When turned on, the normal xterm mouse functionality for such ;; clicks is still available by holding down the SHIFT key while ;; pressing the mouse button. ;; For xterm it seems best to have both worlds, even if that means to ;; have to use shift-middle to do paste from another X window. In ;; rxvt the xterm-mouse-mode doesn't work. (xterm-mouse-mode 1) (frame-minimalistic) ;; (defun eclipsify () ;; (interactive) ;; (setq-default tab-with 4))