From 654e0855904600dcbed0dd356cecd68acc849b50 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 19 Apr 2024 17:18:43 +0300 Subject: emacs: Fix vm-run & wallpaper commands --- .emacs.d/modules/thanos-commands.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to '.emacs.d') diff --git a/.emacs.d/modules/thanos-commands.el b/.emacs.d/modules/thanos-commands.el index 36e6529..5911e5e 100644 --- a/.emacs.d/modules/thanos-commands.el +++ b/.emacs.d/modules/thanos-commands.el @@ -51,8 +51,8 @@ (read-file-name "ISO: ") nil))) (async-shell-command - (format "qemu-system-x86_64 -enable-kvm -m %s -smp %s -hda %s -vga virtio -device virtio-serial-pci %s" - memory cores image (when iso (concat "-cdrom " iso)))))) + (format "qemu-system-x86_64 -enable-kvm -m %s -smp %s -hda %s -vga virtio -device virtio-serial-pci -netdev user,id=vmnic,hostfwd=tcp::2222-:22 -device e1000,netdev=vmnic %s" + memory cores image (if iso (concat "-cdrom " iso) ""))))) ;; MISC @@ -110,8 +110,8 @@ (defun thanos/wallpaper-set (image) "Set IMAGE as wallpaper, using feh." - (call-process-shell-command - (concat "feh --bg-scale " wallpapers-dir image) nil 0)) + (let ((command (if is-zeus "xwallpaper --output DisplayPort-1 --stretch" "feh --bg-scale"))) + (call-process-shell-command (concat command " " wallpapers-dir image) nil 0))) (defun thanos/wallpaper-random () "Set random wallpaper." @@ -143,8 +143,9 @@ (defun dired-set-wallpaper () "Set NAME as wallpaper using feh." (interactive) - (call-process-shell-command - (format "feh --bg-scale %s" (dired-get-filename)) nil 0)) + (let ((command (if is-zeus "xwallpaper --output DisplayPort-1 --stretch" "feh --bg-scale"))) + (call-process-shell-command + (format "%s %s" command (dired-get-filename)) nil 0))) (defun dired-delete-files-except () "Delete all files inside directory except match." -- cgit v1.2.3