diff options
author | Thanos Apollo <[email protected]> | 2023-07-21 16:01:32 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-07-21 16:01:32 +0300 |
commit | 5f68a8125d664736bfa3cc0c38d7f943eba7d311 (patch) | |
tree | 790d8636a0a01df6636e3ed95bcadb517f26247e | |
parent | 4e22efcbbcd6f468bc08d1cbc02aa84f13ee673c (diff) |
emacs: Update app launcher & Add vm manager
-rwxr-xr-x | emacs.org | 62 |
1 files changed, 41 insertions, 21 deletions
@@ -306,6 +306,47 @@ Fonts and basic appearance settings for each device (define-key thanos/pass (kbd "g") 'password-store-generate) (define-key thanos/pass (kbd "s") 'smtp-get-pass) #+end_src +* App Launcher +#+begin_src emacs-lisp + (defun thanos/app-launcher () + "Launch Emacs as an Application Launcher." + (interactive) + (let* ((ivy-height 100)) + (unwind-protect + (with-selected-frame + (make-frame '((name . "thanos/emacs-launcher") + (minibuffer . only) + (fullscreen . 0) + (undecorated . t) + (internal-border-width . 10) + (width . 80) + (height . 11))) + (if is-zeus + (progn + (load-file "~/Developer/emacs-projects/emacs-app-launcher/app-launcher.el") + (app-launcher-run-app)) + (counsel-linux-app)) + (delete-frame))))) +#+end_src +* VM Manager +#+begin_src emacs-lisp + (defun vm-create-image () + (let ((name (format "%s.qcow2" (read-string "Name: "))) + (size (format "%s" (read-string "Size(G): ")))) + (shell-command + (format "qemu-img create -f qcow2 %s %sG" name size)))) + + (defun vm-run () + (let ((memory (format "%sG" (read-string "Memory(G): "))) + (cores (read-string "Cores: ")) + (image (read-file-name "Image: ")) + (iso (if (y-or-n-p "Load iso? ") + (read-file-name "ISO: ") + nil))) + (async-shell-command + (format "qemu-system-x86_64 -enable-kvm -m %s -smp %s -hda %s -vga qxl -device virtio-serial-pci -spice port=5930,disable-ticketing=on -display spice-app %s " + memory cores image (if iso (concat "-cdrom " iso) ""))))) +#+end_src * Dired ** Functions #+begin_src emacs-lisp @@ -1372,24 +1413,3 @@ Set aliases for emacs functions and ~PATH~ (define-key Create (kbd "e") 'create-scratch) ;; #+end_src - -** App launcher -#+begin_src emacs-lisp - (when (or is-zeus - is-hermes) - (defun thanos/app-launcher () - "Launch Emacs as an Application Launcher." - (interactive) - (let* ((ivy-height 100)) - (unwind-protect - (with-selected-frame - (make-frame '((name . "thanos/emacs-launcher") - (minibuffer . only) - (fullscreen . 0) - (undecorated . t) - (internal-border-width . 10) - (width . 80) - (height . 11))) - (app-launcher-run-app) - (delete-frame)))))) -#+end_src |