summaryrefslogtreecommitdiff
path: root/emacs.org
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-07-21 16:01:32 +0300
committerThanos Apollo <[email protected]>2023-07-21 16:01:32 +0300
commit5f68a8125d664736bfa3cc0c38d7f943eba7d311 (patch)
tree790d8636a0a01df6636e3ed95bcadb517f26247e /emacs.org
parent4e22efcbbcd6f468bc08d1cbc02aa84f13ee673c (diff)
emacs: Update app launcher & Add vm manager
Diffstat (limited to 'emacs.org')
-rwxr-xr-xemacs.org62
1 files changed, 41 insertions, 21 deletions
diff --git a/emacs.org b/emacs.org
index d812ab7..9f24b86 100755
--- a/emacs.org
+++ b/emacs.org
@@ -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