From e0e8797aa42352ab896e884d23278b6ea7f6bf29 Mon Sep 17 00:00:00 2001 From: BirDt_ Date: Sat, 11 Oct 2025 03:10:50 +0800 Subject: [PATCH] System utilities and desktop configuration changes --- ui.el | 19 ++++++++++++ userland/system-util.el | 66 +++++++++++++++++++++++++++++++++++++++++ userland/terminal.el | 15 ---------- workflows/org-custom.el | 3 +- 4 files changed, 86 insertions(+), 17 deletions(-) create mode 100644 userland/system-util.el diff --git a/ui.el b/ui.el index fd3488c..df104f6 100644 --- a/ui.el +++ b/ui.el @@ -184,6 +184,25 @@ (global-set-key (kbd " ") '(lambda () (interactive) (frame-toggle-on-screen-keyboard (selected-frame) nil)))) +;; Desktop specific configuration +;; We can replace the system bar here: +(defcustom theurgy-replace-bar + t + "Whether to show battery and time values in the tab bar." + :type 'boolean + :group 'theurgy + :group 'theurgy-ui) + +(when (and (equal system-type 'gnu/linux) + theurgy-replace-bar) + (display-battery-mode 1) + (add-to-list 'tab-bar-format 'tab-bar-format-align-right 'append) + (add-to-list 'tab-bar-format 'tab-bar-format-global 'append) + (setq display-time-format "%a %F %H:%M (%Z)") + (setq display-time-default-load-average nil) ;; Turn off load number by default + (setq display-time-interval 1) + (display-time-mode 1)) + (provide 'ui) ;;; ui.el ends here diff --git a/userland/system-util.el b/userland/system-util.el new file mode 100644 index 0000000..49403c7 --- /dev/null +++ b/userland/system-util.el @@ -0,0 +1,66 @@ +;;; system-util.el --- System utilities for GNU/Linux -*- lexical-binding: t -*- + +;; This file is not part of GNU Emacs + +;; 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 +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + + +;;; Commentary: + +;; commentary + +;;; Code: + +(require 'transient) + +(defcustom theurgy-system-utils-enabled + t + "Whether to enable theurgy system utilities suite for GNU/Linux." + :type 'boolean + :group 'theurgy + :group 'theurgy-compat) + +(when (and theurgy-system-utils-enabled + (equal system-type 'gnu/linux)) + (use-package restart-emacs) + + (use-package system-packages) + + (use-package nm + :straight (nm :type git :host github :repo "theesfeld/nm") + :ensure t) + + (use-package bluetooth + :straight (bluetooth :type git :host github :repo "emacsmirror/bluetooth") + :ensure t) + + (transient-define-prefix system-interactions-transient () + "Transient menu for interfacing with the system via system-packages and restart." + ["Emacs system actions" ("R" "Restart" restart-emacs)] + ["Package..." ("s" "Search" system-packages-search) + ("u" "Update" system-packages-update) + ("i" "Install" system-packages-install) + ("r" "Uninstall" system-packages-uninstall) + ("o" "Remove Orphans" system-packages-remove-orphaned)] + ["Networking" ("d" "Dashboard" nm-ui-dashboard) + ("S" "Status" nm-status) + ("w" "WiFi Browser" nm-ui-wifi-list) + ("c" "Connections" nm-ui-connections)] + ["Bluetooth" ("l" "List Devices" bluetooth-list-devices)]) + + (define-key global-map (kbd "C-c o s") #'system-interactions-transient)) + +(provide 'system-util) + +;;; system-util.el ends here diff --git a/userland/terminal.el b/userland/terminal.el index 596e4ef..a7d4db6 100644 --- a/userland/terminal.el +++ b/userland/terminal.el @@ -86,21 +86,6 @@ (slot . 0) (window-height . 0.2))) -(use-package restart-emacs) - -(use-package system-packages) - -(transient-define-prefix system-interactions-transient () - "Transient menu for interfacing with the system via system-packages and restart." - ["Emacs system actions" ("R" "Restart" restart-emacs)] - ["Package..." ("s" "Search" system-packages-search) - ("u" "Update" system-packages-update) - ("i" "Install" system-packages-install) - ("r" "Uninstall" system-packages-uninstall) - ("o" "Remove Orphans" system-packages-remove-orphaned)]) - -(define-key global-map (kbd "C-c o s") #'system-interactions-transient) - (provide 'terminal) ;;; terminal.el ends here diff --git a/workflows/org-custom.el b/workflows/org-custom.el index cccb77e..67d9c1d 100644 --- a/workflows/org-custom.el +++ b/workflows/org-custom.el @@ -647,8 +647,7 @@ :config (setq org-roam-ui-sync-theme t org-roam-ui-follow t - org-roam-ui-update-on-save t - org-roam-ui-open-on-start (if (equal system-type 'android) nil t))) + org-roam-ui-update-on-save t)) ;; Bibliography stuff (setq bibtex-dialect 'biblatex) ;; Use biblatex instead of bibtex.