aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-10-20 20:10:40 +0200
committerMattias Andrée <m@maandree.se>2026-10-20 20:10:40 +0200
commit102aece748c6854aac21ccdcc1c56c6b428e49a0 (patch)
treecb55af0db6f41a907f1c328e3ece21b48fe60158
parentMisc (diff)
downloaddotfiles-102aece748c6854aac21ccdcc1c56c6b428e49a0.tar.gz
dotfiles-102aece748c6854aac21ccdcc1c56c6b428e49a0.tar.bz2
dotfiles-102aece748c6854aac21ccdcc1c56c6b428e49a0.tar.xz
Signed-off-by: Mattias Andrée <m@maandree.se>
-rw-r--r--emacs/init.el26
-rwxr-xr-xgit/new-c-proj2
-rw-r--r--xmonad/xmonad.hs.gpp18
3 files changed, 39 insertions, 7 deletions
diff --git a/emacs/init.el b/emacs/init.el
index ebaf0d7..994f76b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -66,11 +66,20 @@
(setq auto-mode-alist (cons '("\.cl$" . c-mode) auto-mode-alist)) ; OpenCL source files
-
-;; Load configurations from installed for other packages
-((lambda ()
- (dolist (file (directory-files (expand-file-name "~/.config/emacs/") t "^init-.*\\.el$"))
- (load-file file))))
+;; M-up and M-down to transpose line
+(defun move-line-up ()
+ "Move the current line up one line."
+ (interactive)
+ (transpose-lines 1)
+ (forward-line -2))
+(defun move-line-down ()
+ "Move the current line down one line."
+ (interactive)
+ (forward-line 1)
+ (transpose-lines 1)
+ (forward-line -1))
+(global-set-key (kbd "M-<up>") #'move-line-up)
+(global-set-key (kbd "M-<down>") #'move-line-down)
;; Disable Emacs overriding the terminal's background
@@ -78,6 +87,13 @@
(set-face-attribute 'default nil :background "unspecified-bg")
(set-face-attribute 'default nil :foreground "unspecified-fg"))
+
;; Disable Emacs take control over the terminal's mouse features
;; (This is important for copy and paste between Emacs and other applications)
(unless (display-graphic-p) (xterm-mouse-mode -1))
+
+
+;; Load configurations from installed for other packages
+((lambda ()
+ (dolist (file (directory-files (expand-file-name "~/.config/emacs/") t "^init-.*\\.el$"))
+ (load-file file))))
diff --git a/git/new-c-proj b/git/new-c-proj
index 7546478..a1df19f 100755
--- a/git/new-c-proj
+++ b/git/new-c-proj
@@ -119,7 +119,7 @@ if printf '%s\n' "$1" | grep '^lib' >/dev/null 2>/dev/null; then
x \$(CC) -fPIC -c -o \$@ \$< \$(ALL_CFLAGS) \$(COV_CFLAGS) \$(ALL_CPPFLAGS) \$(COV_CPPFLAGS)
.c.to:
- x \$(CC) -DTEST -c -o \$@ \$< $\(G) \$(ALL_CFLAGS) \$(ALL_CPPFLAGS) \$(COV_CPPFLAGS)
+ x \$(CC) -DTEST -c -o \$@ \$< \$(G) \$(ALL_CFLAGS) \$(ALL_CPPFLAGS) \$(COV_CPPFLAGS)
.to.t:
x \$(CC) -o \$@ \$< $1.a \$(G) \$(ALL_LDFLAGS) \$(COV_LDFLAGS)
diff --git a/xmonad/xmonad.hs.gpp b/xmonad/xmonad.hs.gpp
index 7a6f960..b7cca39 100644
--- a/xmonad/xmonad.hs.gpp
+++ b/xmonad/xmonad.hs.gpp
@@ -161,6 +161,10 @@ $$>fi
, (( $${modmask}, xK_F5), sendMessage $ JumpToLayout (decoName ++ "Tall"))
, (( $${modmask}, xK_F6), sendMessage $ JumpToLayout (decoName ++ "Mirror Tall"))
, (( $${modmask}, xK_F7), sendMessage $ JumpToLayout (decoName ++ "Grid"))
+ , (( $${modmask} .|. controlMask, xK_h), shiftHorizontalLayout (-16)) -- <Super><Ctrl>H :: Shift layout area left
+ , (( $${modmask} .|. controlMask, xK_j), adjustHorizontalGaps (-16)) -- <Super><Ctrl>J :: Widen layout area
+ , (( $${modmask} .|. controlMask, xK_k), adjustHorizontalGaps 16) -- <Super><Ctrl>K :: Narrow layout area
+ , (( $${modmask} .|. controlMask, xK_l), shiftHorizontalLayout 16) -- <Super><Ctrl>L :: Shift layout area right
, (( $${modmask}, xK_F8), sendMessage $ JumpToLayout "Full")
{-- TODO , (( $${modmask} .|. controlMask, xK_m), withFocused (sendMessage . maximizeRestore)) --}
{-- TODO , (( $${modmask}, xK_m), withFocused minimizeWindow) --}
@@ -205,7 +209,7 @@ myManageHook = manageDocks <+> manageHook def <+> composeAll
[ className =? "XEyes" --> doIgnore
, className =? "TzClock" --> doIgnore
]
-myLayoutHook = avoidStruts $ myLayouts
+myLayoutHook = avoidStruts $ gaps [(L, 0), (R, 0)] $ myLayouts
myLayouts = $${deco} (maximize {-- $ TODO minimize --} (tiled 2))
||| $${deco} (maximize {-- $ TODO minimize --} (Mirror (tiled 2)))
||| full
@@ -217,6 +221,18 @@ full = noBorders Full
nmaster = 1
delta = 1/100
+adjustHorizontalGaps amount = sendMessage $ ModifyGaps $ map adjustGap
+ where
+ adjustGap (direction, size)
+ | direction == L || direction == R = (direction, max 0 (min 720 (size + amount)))
+ | otherwise = (direction, size)
+
+shiftHorizontalLayout amount = sendMessage $ ModifyGaps $ map shiftGap
+ where
+ shiftGap (direction, size)
+ | direction == L = (direction, max 0 (min 720 (size + amount)))
+ | direction == R = (direction, max 0 (min 720 (size - amount)))
+ | otherwise = (direction, size)
---- ==== dzen2/xpybar (top panel) settings ==== ----
myLogHook h = do