Skip to content

Instantly share code, notes, and snippets.

@jdtsmith
jdtsmith / maximize-window.el
Last active May 11, 2024 14:18
maximize-window-vertically in emacs
;; Maximize a window vertically or horizontally within its frame
(defun maximize-window-in-direction (&optional horizontally)
"Maximize window.
Default vertically, unless HORIZONTALLY is non-nil."
(interactive)
(unless (seq-every-p
(apply-partially #'window-at-side-p nil)
(if horizontally '(left right) '(top bottom)))
(let* ((buf (window-buffer))
(top-size (window-size (frame-root-window) (not horizontally)))
@jdtsmith
jdtsmith / repeat-change-cursor-color.el
Last active July 4, 2024 23:15
Emacs: change cursor color during active repeat-mode commands
(let ((orig (default-value 'repeat-echo-function))
rcol ccol in-repeat)
(setq
repeat-echo-function
(lambda (map)
(if orig (funcall orig map))
(unless rcol (setq rcol (face-foreground 'error)))
(if map
(unless in-repeat ; new repeat sequence
(setq in-repeat t
@amno1
amno1 / build-emacs.el
Last active December 8, 2023 04:59
Build Custom Emacs from Git from Emacs
;;; build-emacs.el --- Build custom Emacs from sources -*- lexical-binding: t; -*-
;; Copyright (C) 2022 Arthur Miller
;; Author: Arthur Miller <[email protected]>
;; Keywords: tools
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@plembo
plembo / you-need-spice-vdagent.md
Last active October 22, 2024 20:17
You need spice-vdagent

You need spice-vdagent

Debian or Kali Linux installed to as KVM (libvirtd) guests do not automatically have qemu-guest-agent or spice-vdagent installed. This will prevent seamless movement of the mouse cursor between the guest and host desktop in Virtual Machine Manager (requiring the use of a Ctrl-Alt to release the cursor from the guest window).

To cure this, install both qemu-guest-agent and spice-vdagent on each guest and reboot (the guests).

$ sudo apt install qemu-guest-agent
$ sudo apt install spice-vdagent