summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--files.el
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-12-13 23:43:10 -0500
committerbdunahu <bdunahu@operationnull.com>2026-01-03 21:46:06 -0700
commit288ccb3984c7cb46b67d0f6bf7fb6d53c5d7a2d3 (patch)
tree47091f5aeede90e1364546e8122cd55e6d7f2971 /.config/emacs/modules/bd--files.el
parentdf14036eb22ff9326c2806eb3f8cafc0d3042efa (diff)
guix: full refactor of configuration structure
Diffstat (limited to '.config/emacs/modules/bd--files.el')
-rw-r--r--.config/emacs/modules/bd--files.el92
1 files changed, 0 insertions, 92 deletions
diff --git a/.config/emacs/modules/bd--files.el b/.config/emacs/modules/bd--files.el
deleted file mode 100644
index c2f3df8..0000000
--- a/.config/emacs/modules/bd--files.el
+++ /dev/null
@@ -1,92 +0,0 @@
-;;; -*- lexical-binding: t; -*-
-;;; Commentary:
-;;; Code:
-
-
-(use-package files
- :config
- (setopt safe-local-variable-directories
- '("/home/bdunahu/pt/guix")))
-
-(use-package recentf
- :demand t
- :bind
- (("C-x g" . recentf-open))
- :init
- (recentf-mode 1)
- :config
- (setopt recentf-max-saved-items 3500
- recentf-auto-cleanup 300))
-
-(defun bd/zathura (file)
- "Open FILE with zathura."
- (start-process "zathura" nil "zathura" (expand-file-name file)))
-(defun bd/mpv (file)
- "Open FILE with mpv."
- (start-process "mpv" nil "mpv" "--force-window=yes" (expand-file-name file)))
-(defun bd/info (file)
- "Open FILE with info."
- (info file))
-(defun bd/nsxiv (file)
- "Open FILE with nsxiv."
- (start-process "nsxiv" nil "nsxiv" (expand-file-name file)))
-(defun bd/qemu (file)
- "Open FILE with QEMU."
- (let ((options `("qemu-system" nil "qemu-system-x86_64" ,(expand-file-name file)
- "-net" "nic" "-net""user,hostfwd=tcp:127.0.0.1:2222-:22"
- "--accel" "kvm" "-m" "8G")))
- (unless (string-match-p "graphic" file)
- (setq options (append options (list "-nographic"))))
- (apply 'start-process options)))
-(defun bd/rom (file)
- "Open FILE with an emulator."
- (let ((command
- (cdr (assoc (file-name-extension file)
- '(("gba" . "mgba")
- ("z64" . "mupen64plus")
- ("iso" . "dolphin-emu")
- ("ciso" . "dolphin-emu")
- ("n64" . "mupen64plus")
- ("sfc" . "bsnes"))))))
- (start-process command nil command (expand-file-name file))))
-
-(defun bd/external-find-file-wrapper (f &rest args)
- "Wrapper around F (find-file), passing ARGS."
- (defun bd/open-with-function (f)
- (funcall f (car args))
- (recentf-add-file (car args)))
-
- (let ((ext (or (file-name-extension (car args)) "")))
- (cond
- ((string-match (regexp-opt '("epub" "pdf")) ext)
- (bd/open-with-function #'bd/zathura))
- ((string-match (regexp-opt '("mkv" "mov" "mp4" "webm" "m4v"
- "wav" "mp3" "opus" "ogv" "flac"
- "m4a" "ogg")) ext)
- (bd/open-with-function #'bd/mpv))
- ((string-match (regexp-opt '("info")) ext)
- (bd/open-with-function #'bd/info))
- ((string-match (regexp-opt '("jpg" "jpeg" "png" "webp"
- "ico" "gif" "JPG" "PNG")) ext)
- (bd/open-with-function #'bd/nsxiv))
- ((string-match (regexp-opt '("qcow2")) ext)
- (bd/open-with-function #'bd/qemu))
- ((string-match (regexp-opt '("gba" "z64" "n64" "sfc" "iso" "ciso")) ext)
- (bd/open-with-function #'bd/rom))
- (t (apply f args)))))
-(advice-add #'find-file :around #'bd/external-find-file-wrapper)
-
-(use-package dired
- :demand t
- :config
- (setopt dired-listing-switches "-alhLG --time-style=long-iso --group-directories-first"
- dired-recursive-copies 'always
- dired-recursive-deletes 'always
- dired-auto-revert-buffer t
- dired-dwim-target t
- dired-guess-shell-alist-user
- `((,(regexp-opt '(".pdf")) "pdftotext -nopgbrk -enc UTF-8 -eol unix -layout"))))
-
-
-(provide 'bd--files)
-;;; bd--files.el ends here