diff --git a/.config/emacs/bootstrap/crafted-package-bootstrap.el b/.config/emacs/bootstrap/crafted-package-bootstrap.el deleted file mode 100644 index d573f39..0000000 --- a/.config/emacs/bootstrap/crafted-package-bootstrap.el +++ /dev/null @@ -1,120 +0,0 @@ -;;;; crafted-package/package.el --- Configuration to use `package.el'. -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;;; Commentary: - -;; Bootstrap `package.el' configuration. This is the default package -;; manager for Crafted Emacs. Code provided herein is intended for -;; internal use, the user is not expected to use the interface -;; provided here to manage their packages. In fact, should the user -;; prefer to use `use-package' in their configuration, that should -;; work seamlessly with this configuration. The user will need to -;; install `use-package', of course. That being said, the user is -;; welcome to use the macros presented here. They provide -;; `crafted-emacs' a standard way to install packages in the modules -;; provided as we can't predict if the user will choose to use -;; `package.el' or some other tool. - -;;; Code: - -;; package configuration -(require 'package) -(require 'time-date) - -;; Emacs 27.x has gnu elpa as the default -;; Emacs 28.x adds the nongnu elpa to the list by default, so only -;; need to add nongnu when this isn't Emacs 28+ -(when (version< emacs-version "28") - (add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/"))) -(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/")) -(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) - -(customize-set-variable 'package-archive-priorities - '(("gnu" . 99) ; prefer GNU packages - ("nongnu" . 80) ; use non-gnu packages if - ; not found in GNU elpa - ("stable" . 70) ; prefer "released" versions - ; from melpa - ("melpa" . 0))) ; if all else fails, get it - ; from melpa -(customize-set-variable 'package-user-dir - (expand-file-name "elpa/" crafted-config-path)) - -;; make sure the elpa/ folder exists after setting it above. -(unless (file-exists-p package-user-dir) - (mkdir package-user-dir t)) - -(defvar crafted-bootstrap-package-perform-stale-archive-check t - "Flag to allow the user to turn off checking if an archive is -stale on startup.") - -(defvar crafted-bootstrap-package-update-days 1 - "The number of days old a package archive must be before it is -considered stale.") - -;;; package configuration -(defun crafted-package-archive-stale-p (archive) - "Return `t' if ARCHIVE is stale. - -ARCHIVE is stale if the on-disk cache is older than -`crafted-bootstrap-package-update-days' old. If -`crafted-bootstrap-package-perform-stale-archive-check' is nil, -the check is skipped." - (let* ((today (decode-time nil nil t)) - (archive-name (expand-file-name - (format "archives/%s/archive-contents" archive) - package-user-dir)) - (last-update-time (decode-time (file-attribute-modification-time - (file-attributes archive-name)))) - (delta (make-decoded-time :day crafted-bootstrap-package-update-days))) - (if crafted-bootstrap-package-perform-stale-archive-check - (time-less-p (encode-time (decoded-time-add last-update-time delta)) - (encode-time today)) - nil))) - -(defun crafted-package-archives-stale-p () - "Return `t' if any PACKAGE-ARHIVES cache is out of date. - -Check each archive listed in PACKAGE-ARCHIVES, if the on-disk -cache is older than 1 day, return a non-nil value. Fails fast, -will return `t' for the first stale archive found or `nil' if -they are all up-to-date." - (interactive) - (cl-some #'crafted-package-archive-stale-p (mapcar #'car package-archives))) - -(defmacro crafted-package-install-package (package) - "Only install the package if it is not already installed." - `(unless (package-installed-p ,package) (package-install ,package))) - -(defmacro crafted-package-installed-p (package) - `(package-installed-p ,package)) - -(defun crafted-package-initialize () - "Initialize the package system." - - ;; Only use package.el if it is enabled. The user may have turned it - ;; off in their `early-config.el' file, so respect their wishes if so. - (when package-enable-at-startup - (package-initialize) - - (require 'seq) - ;; Only refresh package contents once per day on startup, or if the - ;; `package-archive-contents' has not been initialized. If Emacs has - ;; been running for a while, user will need to manually run - ;; `package-refresh-contents' before calling `package-install'. - (cond ((seq-empty-p package-archive-contents) - (progn - (message "crafted-init: package archives empty, initializing") - (package-refresh-contents))) - ((crafted-package-archives-stale-p) - (progn - (message "crafted-init: package archives stale, refreshing in the background") - (package-refresh-contents t)))) - )) - -(provide 'crafted-package/package) -;;; crafted-package/package.el ends here diff --git a/.config/emacs/bootstrap/crafted-package.el b/.config/emacs/bootstrap/crafted-package.el deleted file mode 100644 index c5a49ab..0000000 --- a/.config/emacs/bootstrap/crafted-package.el +++ /dev/null @@ -1,66 +0,0 @@ -;;;; crafted-package.el --- Configuration to use `package.el'. -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;;; Commentary: - -;; This library provides a package related interface for -;; `crafted-emacs'. - -;; So far, it has two backends: -;; - `package.el' -- The default. -;; - `straight.el' -- A popular option. - -;; Other backends could be added. To add a backend, add the name to -;; the list above, provide a bootstrap file (the name must match -;; `crafted-%s-bootstrap.el' or it will fail to be loaded with this -;; code), and make sure to implement the following macros (at a -;; minimum): -;; -;; `crafted-package-install-package' which should receive a package to -;; install and perform the appropriate operations to install that -;; package. -;; -;; `crafted-package-installed-p' which should identify if a package is -;; installed (ie, it should return `t' if the package is installed and -;; `nil' otherwise) -;; -;; See the bootstrap files in this directory for examples. The macros -;; mentioned above are intended to provide a consistent interface for -;; the modules to use when installing packages. The user is not -;; expected to use them in their own configuration, but they may if -;; they choose. Or they may choose a different interface, like -;; `use-package' or `leaf'. - -;;; Code: - -(defvar crafted-package-system 'package - "What package system to use. - -By default, it uses 'package for `package.el'. Another option is -'straight for `straight.el'.") - -(defun crafted-package-bootstrap (&optional system) - "Load the configuration and defaults to the selected package. - -This will check for the value of the variable -`crafted-package-system', but could be overriden with the -optional parameter SYSTEM. - -This is called when `early-init.el' runs." - (let* ((module (make-symbol (format "crafted-%s-bootstrap.el" - (symbol-name (or system - crafted-package-system - ;; In case both above are nil - 'package))))) - (module-path (expand-file-name (symbol-name module) crafted-bootstrap-directory))) - (if (file-exists-p module-path) - (load module-path) - (error "Could not find module %s" module)))) - -(provide 'crafted-package) - -;;; crafted-package.el ends here diff --git a/.config/emacs/bootstrap/crafted-straight-bootstrap.el b/.config/emacs/bootstrap/crafted-straight-bootstrap.el deleted file mode 100644 index 59df45e..0000000 --- a/.config/emacs/bootstrap/crafted-straight-bootstrap.el +++ /dev/null @@ -1,56 +0,0 @@ -;;;; crafted-package/straight.el --- Configuration to use `straigt.el`. -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;;; Commentary: - -;; This code loads the bootstrap code for `straight.el', according as -;; described in . - -;; Bootstrap `straight.el' configuration, as described in -;; . Code provided -;; herein is intended for internal use, the user is not expected to -;; use the interface provided here to manage their packages. In fact, -;; should the user prefer to use `use-package' in their configuration, -;; that should work seamlessly with this configuration. The user will -;; need to install `use-package', of course. That being said, the -;; user is welcome to use the macros presented here. They provide -;; `crafted-emacs' a standard way to install packages in the modules -;; provided as we can't predict if the user will choose to use -;; `straight.el' or some other tool. - -;;; Code: - -(defvar bootstrap-version) - -(let ((bootstrap-file - (expand-file-name "straight/repos/straight.el/bootstrap.el" crafted-config-path)) - (bootstrap-version 6)) - ;; moves the straight install directory to the users crafted - ;; configuration folder rather than the `user-emacs-directory' - (setq straight-base-dir crafted-config-path) - (unless (file-exists-p bootstrap-file) - (with-current-buffer - (url-retrieve-synchronously - "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) - (load bootstrap-file nil 'nomessage)) - -(defmacro crafted-package-install-package (package) - "Crafted Emacs interface to install packages. - -Only install the package if it is not already installed using -straight.el." - `(straight-use-package ,package)) - -(defmacro crafted-package-installed-p (package) - "Crafted Emacs interface to check if a package is installed." - `(straight--installed-p ,package)) - -(provide 'crafted-package/straight) -;;; crafted-package/straight.el ends here diff --git a/.config/emacs/config.el b/.config/emacs/config.el old mode 100644 new mode 100755 index a89d303..f2779cb --- a/.config/emacs/config.el +++ b/.config/emacs/config.el @@ -1,51 +1,12 @@ -(require 'crafted-defaults) ; Sensible Default settings for Emacs -(require 'crafted-updates) ; Tools to upgrade Crafted Emacs -(require 'crafted-completion) ; selection framework based on 'vertico' -(require 'crafted-ui) ; Better UI experience (modeline etc..) -(require 'crafted-evil) ; An 'evil-mode' configuration -;;(require 'custom-evil) ; An 'evil-mode' configuration -(require 'crafted-editing) ; Whitespace trimming, auto parens etc. -;;(require 'crafted-org) ; org-appear, clickable hyperlinks etc. -(require 'custom-org) ; org-appear, clickable hyperlinks etc. -(require 'crafted-project) -(require 'crafted-latex) - -(setq-default tab-width 4) -(defvaralias 'c-basic-offset 'tab-width) - -(setq default-input-method "korean-hangul") -(global-set-key (kbd "") 'toggle-input-method) - -(setq user-full-name "JaeYoo-Im" - user-mail-address "cpu3792@gmail.com") - -;; Line numbers -(column-number-mode) -(global-display-line-numbers-mode t) -(dolist (mode '(org-mode-hook - vterm-mode-hook - dired-mode-hook - ;;shell-mode-hook - ;;treemacs-mode-hook - eshell-mode-hook)) - (add-hook mode (lambda () (display-line-numbers-mode 0)))) - -(add-hook 'emacs-startup-hook - (lambda () - (custom-set-faces - `(default ((t (:font "Fira Code 12")))) - `(fixed-pitch ((t (:inherit (default))))) - `(fixed-pitch-serif ((t (:inherit (default))))) - `(variable-pitch ((t (:font "Ubuntu Mono 12"))))))) -(set-fontset-font t `hangul (font-spec :name "NanumGothic")) -;; loading themes -(crafted-package-install-package 'doom-themes) -(progn - (disable-theme 'deeper-blue) ; first turn off the deeper-blue theme - (if (display-graphic-p) - (load-theme 'doom-palenight t) - (load-theme 'doom-gruvbox t)) - (unless (display-graphic-p) - (xterm-mouse-mode))) - -(require 'custom-dashboard) +;;; config.el -*- lexical-binding: t; -*- +(setq user-full-name "JaeYoo-Im" + user-mail-address "cpu3792@gmail.com") + +(add-to-list 'default-frame-alist `(font . "Fira Code Retina")) +(set-face-attribute 'default nil :font "Fira Code Retina" :height 12) +(set-face-attribute 'fixed-pitch nil :font "Fira Code Retina" :height 12) +(set-face-attribute 'variable-pitch nil :font "Fira Code Retina" :height 12 :weight 'regular) +(set-fontset-font t 'hangul (font-spec :family "NanumGothic" :height 12)) + +(require 'custom-ui) +(require 'custom-keybindings) diff --git a/.config/emacs/early-init.el b/.config/emacs/early-init.el old mode 100644 new mode 100755 index 24937ba..716828e --- a/.config/emacs/early-init.el +++ b/.config/emacs/early-init.el @@ -1,63 +1,21 @@ -;;; early-init.el -*- lexical-binding: t; -*- - -;;; Garbage collection -;; Increase the GC threshold for faster startup -;; The default is 800 kilobytes. Measured in bytes. -(setq gc-cons-threshold (* 50 1000 1000)) - -;;; Emacs lisp source/compiled preference -;; Prefer loading newest compiled .el file -(customize-set-variable 'load-prefer-newer t) - - -(defvar crafted-config-path "~/.cache/emacs") -(unless (file-exists-p crafted-config-path) - (mkdir crafted-config-path t)) - -;;; Native compilation settings -(when (featurep 'native-compile) - ;; Silence compiler warnings as they can be pretty disruptive - (setq native-comp-async-report-warnings-errors nil) - - ;; Make native compilation happens asynchronously - (setq native-comp-deferred-compilation t) - - ;; Set the right directory to store the native compilation cache - ;; NOTE the method for setting the eln-cache directory depends on the emacs version - (when (fboundp 'startup-redirect-eln-cache) - (if (version< emacs-version "29") - (add-to-list 'native-comp-eln-load-path (convert-standard-filename (expand-file-name "var/eln-cache/" user-emacs-directory))) - (startup-redirect-eln-cache (convert-standard-filename (expand-file-name "var/eln-cache/" user-emacs-directory))))) - - (add-to-list 'native-comp-eln-load-path (expand-file-name "eln-cache/" user-emacs-directory))) - -;;; UI configuration -;; Remove some unneeded UI elements (the user can turn back on anything they wish) -(setq inhibit-startup-message t) -(push '(tool-bar-lines . 0) default-frame-alist) -(push '(menu-bar-lines . 0) default-frame-alist) -(push '(vertical-scroll-bars) default-frame-alist) -(push '(mouse-color . "white") default-frame-alist) - -;; Loads a nice blue theme, avoids the white screen flash on startup. -(load-theme 'deeper-blue t) - -;; Make the initial buffer load faster by setting its mode to fundamental-mode -(customize-set-variable 'initial-major-mode 'fundamental-mode) - -;;; Package system -;; Load the package-system. If needed, the user could customize the -;; system to use in `early-config.el'. -(defvar crafted-bootstrap-directory (expand-file-name "bootstrap/" user-emacs-directory) - "Package system bootstrap configuration.") - -(load (expand-file-name "crafted-package.el" crafted-bootstrap-directory)) -(when (eq crafted-package-system 'package) - ;; needed in case `early-config.el' has pinned packages configured - (require 'package)) - -;; this is the default -;; (setq crafted-package-system 'package) -;; use this in `early-config.el' to switch to `straight.el' -;; (setq crafted-package-system 'straight) -(crafted-package-bootstrap crafted-package-system) +;;; early-init.el -*- lexical-binding: t; -*- +;; garbage collection +(setq gc-cons-threshold (* 50 1024 1024)) ;; 50MB +;; prefers newest version of a file +(customize-set-variable 'load-prefer-newer t) + +(setq package-enable-at-startup nil + inhibit-startup-message t + frame-resize-pixelwise t + package-native-compile t) +(scroll-bar-mode -1) +(tool-bar-mode -1) +(tooltip-mode -1) +(set-fringe-mode 10) +(menu-bar-mode -1) +;;(blink-cursor-mode 0) + +;; initial load with blue theme +(load-theme 'deeper-blue) + +(customize-set-variable 'initial-major-mode 'fundamental-mode) diff --git a/.config/emacs/init.el b/.config/emacs/init.el old mode 100644 new mode 100755 index 4baf3e6..5bce42d --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -1,69 +1,67 @@ -;;; init.el -*- lexical-binding: t; -*- - -;; Profile emacs startup -(add-hook 'emacs-startup-hook - (lambda () - (message "Crafted Emacs loaded in %s." - (emacs-init-time)))) - -(when (eq crafted-package-system 'package) - (crafted-package-initialize)) - -;; Add the modules folder to the load path -(add-to-list 'load-path (expand-file-name "modules/" user-emacs-directory)) - -;; Set default coding system (especially for Windows) -(set-default-coding-systems 'utf-8) -(customize-set-variable 'visible-bell 1) ; turn off beeps, make them flash! -(customize-set-variable 'large-file-warning-threshold 100000000) ;; change to ~100 MB - -(defun crafted-ensure-package (package &optional args) - "Ensure that PACKAGE is installed on the system, either via -package.el or Guix depending on the value of -`crafted-prefer-guix-packages'." - (if crafted-prefer-guix-packages - (unless (featurep package) - (message "Package '%s' does not appear to be installed by Guix: " package)) - (crafted-package-install-package package))) - -;; Check the system used -(defconst ON-LINUX (eq system-type 'gnu/linux)) -(defconst ON-MAC (eq system-type 'darwin)) -(defconst ON-BSD (or ON-MAC (eq system-type 'berkeley-unix))) -(defconst ON-WINDOWS (memq system-type '(cygwin windows-nt ms-dos))) - - -;; Defines the user configuration var and etc folders -;; and ensure they exist. -(defvar crafted-config-etc-directory (expand-file-name "etc/" crafted-config-path) - "The user's configuration etc/ folder.") -(defvar crafted-config-var-directory (expand-file-name "var/" crafted-config-path) - "The user's configuration var/ folder.") -(mkdir crafted-config-etc-directory t) -(mkdir crafted-config-var-directory t) - -;; Find the user configuration file -(defvar crafted-config-file (expand-file-name "config.el" "~/.config/emacs") - "The user's configuration file.") -;; Load the user configuration file if it exists -(when (file-exists-p crafted-config-file) - (load crafted-config-file nil 'nomessage)) - -;; Make GC pauses faster by decreasing the threshold. -(setq gc-cons-threshold (* 2 1000 1000)) - -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(package-selected-packages '(auctex doom-themes))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(default ((t (:font "Fira Code 12")))) - '(fixed-pitch ((t (:inherit (default))))) - '(fixed-pitch-serif ((t (:inherit (default))))) - '(variable-pitch ((t (:font "Ubuntu Mono 12"))))) +;;; init.el -*- lexical-binding: t; -*- +(add-hook 'emacs-startup-hook + (lambda () + (message "Crafted Emacs loaded in %s" + (emacs-init-time)))) + +(require 'package) +(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/")) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) +(defvar bootstrap-version) +(let ((bootstrap-file + (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) + (bootstrap-version 5)) + (unless (file-exists-p bootstrap-file) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) + (load bootstrap-file nil 'nomessage)) +(setq straight-use-package-by-default t) +(package-initialize) +(unless package-archive-contents + (package-refresh-contents)) + +(add-to-list 'load-path (expand-file-name "modules/" user-emacs-directory)) + +(add-hook 'before-save-hook #'whitespace-cleanup) + +(setq-default indent-tabs-mode nil) +(setq-default tab-width 4) + +(column-number-mode) +(global-display-line-numbers-mode t) +;; Disable line numbers for some modes +(dolist (mode '(org-mode-hook + shell-mode-hook + treemacs-mode-hook + dired-mode-hook + eshell-mode-hook)) + (add-hook mode (lambda () (display-line-numbers-mode 0)))) + +(setq backup-directory-alist `(("." . ,(expand-file-name "backups/" user-emacs-directory)))) +(setq-default custom-file (expand-file-name ".custom.el" user-emacs-directory)) +(when (file-exists-p custom-file) + (load custom-file)) +(setq delete-by-moving-to-trash t + trash-directory "~/.local/share/Trash/files/") +(setq undo-limit 100000000 + auto-save-default t) + +(set-default-coding-systems 'utf-8) +(customize-set-variable 'large-file-warning-threshold 100000000) ;; 100MB + +(defconst ON-LINUX (eq system-type 'gnu/linux)) +(defconst ON-MAC (eq system-type 'darwin)) +(defconst ON-WINDOWS (memq system-type '(cygwin windows-nt ms-dos))) + +(setq gc-cons-threshold (* 2 1024 1024)) ; decreasing the threshold to 2MB + +(defvar my-config-file (expand-file-name "config.el" user-emacs-directory)) +(when (file-exists-p my-config-file) + (load my-config-file nil 'nomessage)) + +;;(defalias 'yes-or-no-p 'y-or-n-p) +(global-auto-revert-mode t) diff --git a/.config/emacs/logo.png b/.config/emacs/logo.png deleted file mode 100755 index 47ad47d..0000000 Binary files a/.config/emacs/logo.png and /dev/null differ diff --git a/.config/emacs/logo.svg b/.config/emacs/logo.svg deleted file mode 100755 index fa8a768..0000000 --- a/.config/emacs/logo.svg +++ /dev/null @@ -1,405 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.config/emacs/modules/#custom-keybindings.el# b/.config/emacs/modules/#custom-keybindings.el# new file mode 100755 index 0000000..a228c29 --- /dev/null +++ b/.config/emacs/modules/#custom-keybindings.el# @@ -0,0 +1,23 @@ +(use-package which-key + :defer t + :init (which-key-mode) + :diminish which-key-mode + :config + (setq which-key-idle-delay 0.5)) + +(use-package general + :init + (general-auto-unbind-keys) + :config + (general-evil-setup t) + (general-create-definer ju/leader-key-def + :keymaps '(normal insert visual emacs) + :prefix "SPC" + :global-prefix "C-SPC")) + +(ju/leader-key-def + "." 'find-file) + ;; Buffer) + +(provide 'custom-keybindings) +;;; custom-keybindings.el ends here diff --git a/.config/emacs/modules/crafted-completion.el b/.config/emacs/modules/crafted-completion.el deleted file mode 100644 index c42a241..0000000 --- a/.config/emacs/modules/crafted-completion.el +++ /dev/null @@ -1,153 +0,0 @@ -;;; crafted-completion.el --- Crafted Completion Configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;;; Commentary: - -;; Setup completion packages. Completion in this sense is more like -;; narrowing, allowing the user to find matches based on minimal -;; inputs and "complete" the commands, variables, etc from the -;; narrowed list of possible choices. - -;;; Code: - -(crafted-package-install-package 'cape) -(crafted-package-install-package 'consult) -(crafted-package-install-package 'corfu) -(crafted-package-install-package 'corfu-terminal) -(crafted-package-install-package 'embark) -(crafted-package-install-package 'embark-consult) -(crafted-package-install-package 'marginalia) -(crafted-package-install-package 'orderless) -(crafted-package-install-package 'vertico) - -(defun crafted-completion/minibuffer-backward-kill (arg) - "Delete word or delete up to parent folder when completion is a file. - -ARG is the thing being completed in the minibuffer." - (interactive "p") - (if minibuffer-completing-file-name - ;; Borrowed from https://github.com/raxod502/selectrum/issues/498#issuecomment-803283608 - (if (string-match-p "/." (minibuffer-contents)) - (zap-up-to-char (- arg) ?/) - (delete-minibuffer-contents)) - (backward-kill-word arg))) - - -;;; Vertico -(require 'vertico) - -;; Straight and Package bundle the vertico package differently. When -;; using `package.el', the extensions are built into the package and -;; available on the load-path. When using `straight.el', the -;; extensions are not built into the package, so have to add that path -;; to the load-path manually to enable the following require. -(when (eq crafted-package-system 'straight) - (add-to-list 'load-path - (expand-file-name "straight/build/vertico/extensions" - straight-base-dir))) -(require 'vertico-directory) - -(with-eval-after-load 'evil - (define-key vertico-map (kbd "C-j") 'vertico-next) - (define-key vertico-map (kbd "C-k") 'vertico-previous) - (define-key vertico-map (kbd "M-h") 'vertico-directory-up)) - -;; Cycle back to top/bottom result when the edge is reached -(customize-set-variable 'vertico-cycle t) - -;; Start Vertico -(vertico-mode 1) - - -;;; Marginalia - -;; Configure Marginalia -(require 'marginalia) -(customize-set-variable 'marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil)) -(marginalia-mode 1) - -;; Set some consult bindings -(global-set-key (kbd "C-s") 'consult-line) -(define-key minibuffer-local-map (kbd "C-r") 'consult-history) - -(setq completion-in-region-function #'consult-completion-in-region) - - -;;; Orderless - -;; Set up Orderless for better fuzzy matching -(require 'orderless) -(customize-set-variable 'completion-styles '(orderless basic)) -(customize-set-variable 'completion-category-overrides '((file (styles . (partial-completion))))) - - -;;; Embark -(require 'embark) -(require 'embark-consult) - -(global-set-key [remap describe-bindings] #'embark-bindings) -(global-set-key (kbd "C-.") 'embark-act) - -;; Use Embark to show bindings in a key prefix with `C-h` -(setq prefix-help-command #'embark-prefix-help-command) - -(with-eval-after-load 'embark-consult - (add-hook 'embark-collect-mode-hook #'consult-preview-at-point-mode)) - - -;;; Corfu -(when (eq crafted-package-system 'straight) - (add-to-list 'load-path - (expand-file-name "straight/build/corfu/extensions" - straight-base-dir))) -(require 'corfu-popupinfo) - -(require 'corfu) - -(unless (display-graphic-p) - (require 'corfu-terminal) - (corfu-terminal-mode +1)) - -;; Setup corfu for popup like completion -(customize-set-variable 'corfu-cycle t) ; Allows cycling through candidates -(customize-set-variable 'corfu-auto t) ; Enable auto completion -(customize-set-variable 'corfu-auto-prefix 2) ; Complete with less prefix keys -(customize-set-variable 'corfu-auto-delay 0.0) ; No delay for completion -(customize-set-variable 'corfu-echo-documentation 0.25) ; Echo docs for current completion option - -(global-corfu-mode 1) -(corfu-popupinfo-mode 1) -(eldoc-add-command #'corfu-insert) -(define-key corfu-map (kbd "M-p") #'corfu-popupinfo-scroll-down) -(define-key corfu-map (kbd "M-n") #'corfu-popupinfo-scroll-up) -(define-key corfu-map (kbd "M-d") #'corfu-popupinfo-toggle) - - -;;; Cape - -;; Setup Cape for better completion-at-point support and more -(require 'cape) - -;; Add useful defaults completion sources from cape -(add-to-list 'completion-at-point-functions #'cape-file) -(add-to-list 'completion-at-point-functions #'cape-dabbrev) - -;; Silence the pcomplete capf, no errors or messages! -;; Important for corfu -(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent) - -;; Ensure that pcomplete does not write to the buffer -;; and behaves as a pure `completion-at-point-function'. -(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify) -(add-hook 'eshell-mode-hook - (lambda () (setq-local corfu-quit-at-boundary t - corfu-quit-no-match t - corfu-auto nil) - (corfu-mode))) - -(provide 'crafted-completion) -;;; crafted-completion.el ends here diff --git a/.config/emacs/modules/crafted-defaults.el b/.config/emacs/modules/crafted-defaults.el deleted file mode 100644 index e93b0de..0000000 --- a/.config/emacs/modules/crafted-defaults.el +++ /dev/null @@ -1,116 +0,0 @@ -;;; crafted-defaults.el -*- lexical-binding: t; -*- - -;; Revert Dired and other buffers -(customize-set-variable 'global-auto-revert-non-file-buffers t) -;; Revert buffers when the underlying file has changed -(global-auto-revert-mode 1) -(setq global-auto-revert-non-file-buffers t) ;; TODO check -;; Typed text replaces the selection if the selection is active, -;; pressing delete or backspace deletes the selection. -(delete-selection-mode) -;; Use spaces instead of tabs // TODO Check!! -(setq-default indent-tabs-mode nil) - -;; Use "y" and "n" to confirm/negate prompt instead of "yes" and "no" -;; Using `advice' here to make it easy to reverse in custom -;; configurations with `(advice-remove 'yes-or-no-p #'y-or-n-p)' -;; -;; N.B. Emacs 28 has a variable for using short answers, which should -;; be preferred if using that version or higher. -(if (boundp 'use-short-answers) - (setq use-short-answers t) - (advice-add 'yes-or-no-p :override #'y-or-n-p)) - -;; Turn on recentf mode -(add-hook 'after-init-hook #'recentf-mode) -(customize-set-variable 'recentf-save-file - (expand-file-name "recentf" crafted-config-var-directory)) - -;; Do not save duplicates in kill-ring -(customize-set-variable 'kill-do-not-save-duplicates t) - - -;; Make scrolling less stuttered // TODO emacs29 scroll check!! -;;(setq auto-window-vscroll nil) -;;(customize-set-variable 'fast-but-imprecise-scrolling t) -;;(customize-set-variable 'scroll-conservatively 101) -;;(customize-set-variable 'scroll-margin 0) -;;(customize-set-variable 'scroll-preserve-screen-position t) - -;; Better support for files with long lines -(setq-default bidi-paragraph-direction 'left-to-right) -(setq-default bidi-inhibit-bpa t) -(global-so-long-mode 1) - -;; Make shebang (#!) file executable when saved -(add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p) - -;; Enable savehist-mode for command history -(savehist-mode 1) - -;; Keep state files in `crafted-config-var-directory' by default -;; we use `with-eval-after-load' to only affect what is being used. -;; -;; Note that this can introduce issues depending on how each module -;; works. Like, for example, if the module reads those files during -;; load it may happen that it reads the file on its default location -;; before the path is changed (because this code runs after-load, -;; and user customization is run after all of crafted-emacs is loaded) -;; -;; So, each variable needs some thought on how/when to set it, -;; while also trying to not set variables for modules the user -;; is not loading / using. - -;; Enable the sensible path defaults -(defcustom crafted-folders t - "Non-nil enabled 'sensible folder layout' behaviour." - :type 'boolean - :group 'crafted) - -(defun crafted-defaults--sensible-path - (root varname name) - "Sets the VARNAME to a path named NAME inside ROOT. - But only if `crafted-folders' is enabled (`t'). - - For example (crafted-config-var-directory 'savehist-file \"history\") - Will set `savehist-file' to, ie, ~/.config/crafted-emacs/var/history" - (if-let ((path (expand-file-name name root)) - (crafted-folders)) - (customize-set-variable varname path) - )) - -(crafted-defaults--sensible-path crafted-config-var-directory - 'savehist-file "history") - -(crafted-defaults--sensible-path crafted-config-var-directory - 'auto-save-list-file-prefix "auto-save-list/.saves-") - -(with-eval-after-load 'saveplace - (crafted-defaults--sensible-path crafted-config-var-directory - 'save-place-file "places")) - -(with-eval-after-load 'bookmark - (crafted-defaults--sensible-path crafted-config-var-directory - 'bookmark-default-file "bookmarks")) - -(with-eval-after-load 'tramp - (crafted-defaults--sensible-path crafted-config-var-directory - 'tramp-persistency-file-name - "tramp")) - -(with-eval-after-load 'org-id - (crafted-defaults--sensible-path crafted-config-var-directory - 'org-id-locations-file - "org-id-locations")) - -(with-eval-after-load 'nsm - (crafted-defaults--sensible-path crafted-config-var-directory - 'nsm-settings-file - "network-security.data")) - -(with-eval-after-load 'project - (crafted-defaults--sensible-path crafted-config-var-directory - 'project-list-file - "projects")) - -(provide 'crafted-defaults) diff --git a/.config/emacs/modules/crafted-editing.el b/.config/emacs/modules/crafted-editing.el deleted file mode 100644 index 012672c..0000000 --- a/.config/emacs/modules/crafted-editing.el +++ /dev/null @@ -1,98 +0,0 @@ -;;; crafted-editing.el -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;; Commentary - -;; Editing text configuration. - -;;; Code: - -;;; Helpers for defcustom variables - -(defun crafted-editing--prefer-tabs (enable) - "Adjust whitespace configuration to support tabs based on ENABLE." - (if enable - (customize-set-variable 'whitespace-style - '(face empty trailing indentation::tab - space-after-tab::tab - space-before-tab::tab)) - (customize-set-variable 'whitespace-style - '(face empty trailing tab-mark - indentation::space)))) - -(defun crafted-editing--enable-whitespace-modes (modes) - "Enable whitespace-mode for each mode specified by MODES." - (dolist (mode modes) - (add-hook (intern (format "%s-hook" mode)) - #'whitespace-mode))) - -(defun crafted-editing--disable-whitespace-modes (modes) - "Do not enable whitespace-mode for each mode specified by MODES." - (dolist (mode modes) - (remove-hook (intern (format "%s-hook" mode)) - #'whitespace-mode))) - -;;; Customization group for the Crafted Editing module. -(defgroup crafted-editing '() - "Editing related configuration for Crafted Emacs." - :tag "Crafted Editing" - :group 'crafted) - -(define-obsolete-variable-alias - 'rational-editing-prefer-tabs - 'crafted-editing-prefer-tabs - "1") - -;; provide an option for users who prefer tabs over spaces -(defcustom crafted-editing-prefer-tabs nil - "Prefer using tabs instead of spaces." - :tag "Prefer tabs over spaces" - :group 'crafted-editing - :set (lambda (sym val) - (set-default sym val) - (crafted-editing--prefer-tabs val))) - -(define-obsolete-variable-alias - 'rational-editing-whitespace-cleanup-enabled-modes - 'crafted-editing-whitespace-cleanup-enabled-modes - "1") - -;; whitespace cleanup configuration -(defcustom crafted-editing-whitespace-cleanup-enabled-modes - '(conf-mode prog-mode) - "Modes which should have whitespace cleanup enabled." - :type 'list - :tag "Whitespace cleanup enabled modes" - :group 'crafted-editing - :set (lambda (sym val) - (set-default sym val) - (crafted-editing--enable-whitespace-modes val))) - -(define-obsolete-variable-alias - 'rational-editing-whitespace-cleanup-disabled-modes - 'crafted-editing-whitespace-cleanup-disabled-modes - "1") - -(defcustom crafted-editing-whitespace-cleanup-disabled-modes - '(makefile-mode) - "Modes which should not have whitespace cleanup enabled." - :type 'list - :tag "Whitespace cleanup disabled modes" - :group 'crafted-editing - :set (lambda (sym val) - (set-default sym val) - (crafted-editing--disable-whitespace-modes val))) - -;;; cleanup whitespace -(customize-set-variable 'whitespace-action '(cleanup auto-cleanup)) - -;;; parentheses -(electric-pair-mode 1) ; auto-insert matching bracket -(show-paren-mode 1) ; turn on paren match highlighting - -(provide 'crafted-editing) -;;; crafted-editing.el ends here diff --git a/.config/emacs/modules/crafted-evil.el b/.config/emacs/modules/crafted-evil.el deleted file mode 100644 index cf561f5..0000000 --- a/.config/emacs/modules/crafted-evil.el +++ /dev/null @@ -1,109 +0,0 @@ -;;; crafted-evil.el --- Evil mode configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;;; Commentary: - -;; Evil mode configuration, for those who prefer `Vim' keybindings. - -;;; Code: - -(defgroup crafted-evil '() - "Vim-like related configuration for Crafted Emacs." - :tag "Crafted Evil" - :group 'crafted) - -;; Define configuration variables -(define-obsolete-variable-alias - 'rational-evil-discourage-arrow-keys - 'crafted-evil-discourage-arrow-keys - "1") -(defcustom crafted-evil-discourage-arrow-keys nil - "When non-nil, prevent navigation with the arrow keys in Normal state." - :group 'crafted-evil - :type 'boolean) - -(define-obsolete-variable-alias - 'rational-evil-vim-muscle-memory - 'crafted-evil-vim-muscle-memory - "1") -(defcustom crafted-evil-vim-muscle-memory nil - "When non-nil, let evil mode take some of the default keybindings, in order to make a more familiar Vim experience." - :group 'crafted-evil - :type 'boolean) - -;; Install dependencies -(crafted-package-install-package 'evil) -(crafted-package-install-package 'evil-collection) -(crafted-package-install-package 'evil-nerd-commenter) - -;; Turn on undo-tree globally -(when (< emacs-major-version 28) - (crafted-package-install-package 'undo-tree) - (global-undo-tree-mode)) - -;; Set some variables that must be configured before loading the package -(customize-set-variable 'evil-want-integration t) -(customize-set-variable 'evil-want-keybinding nil) -(customize-set-variable 'evil-want-C-i-jump nil) -(customize-set-variable 'evil-respect-visual-line-mode t) -;; C-h is backspace in insert state -(customize-set-variable 'evil-want-C-h-delete t) -(if (< emacs-major-version 28) - (customize-set-variable 'evil-undo-system 'undo-tree) - (customize-set-variable 'evil-undo-system 'undo-redo)) - -(when crafted-evil-vim-muscle-memory - (customize-set-variable 'evil-want-C-i-jump t) - (customize-set-variable 'evil-want-Y-yank-to-eol t) - (customize-set-variable 'evil-want-fine-undo t)) - -;; Load Evil and enable it globally -(require 'evil) -(evil-mode 1) - -;; Make evil search more like vim -(evil-select-search-module 'evil-search-module 'evil-search) - -;; Turn on Evil Nerd Commenter -(evilnc-default-hotkeys) - -;; Make C-g revert to normal state -(define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state) - -;; Rebind `universal-argument' to 'C-M-u' since 'C-u' now scrolls the buffer -(global-set-key (kbd "C-M-u") 'universal-argument) - -;; Use visual line motions even outside of visual-line-mode buffers -(evil-global-set-key 'motion "j" 'evil-next-visual-line) -(evil-global-set-key 'motion "k" 'evil-previous-visual-line) - -(defun crafted-evil/discourage-arrow-keys () - (interactive) - (message "Use HJKL keys instead!")) - -(when crafted-evil-discourage-arrow-keys - ;; Disable arrow keys in normal and visual modes - (define-key evil-normal-state-map (kbd "") 'crafted-evil/discourage-arrow-keys) - (define-key evil-normal-state-map (kbd "") 'crafted-evil/discourage-arrow-keys) - (define-key evil-normal-state-map (kbd "") 'crafted-evil/discourage-arrow-keys) - (define-key evil-normal-state-map (kbd "") 'crafted-evil/discourage-arrow-keys) - (evil-global-set-key 'motion (kbd "") 'crafted-evil/discourage-arrow-keys) - (evil-global-set-key 'motion (kbd "") 'crafted-evil/discourage-arrow-keys) - (evil-global-set-key 'motion (kbd "") 'crafted-evil/discourage-arrow-keys) - (evil-global-set-key 'motion (kbd "") 'crafted-evil/discourage-arrow-keys)) - -;; Make sure some modes start in Emacs state -;; TODO: Split this out to other configuration modules? -(dolist (mode '(custom-mode - eshell-mode - term-mode)) - (add-to-list 'evil-emacs-state-modes mode)) - -(evil-collection-init) - -(provide 'crafted-evil) -;;; crafted-evil.el ends here diff --git a/.config/emacs/modules/crafted-latex.el b/.config/emacs/modules/crafted-latex.el deleted file mode 100644 index 9f0ba04..0000000 --- a/.config/emacs/modules/crafted-latex.el +++ /dev/null @@ -1,135 +0,0 @@ -;;; crafted-latex.el -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;; Commentary - -;; Configure AUCTEX for editing LaTeX files. Provides customization -;; for various environments to provide some useful additions related -;; to drawing graphs and mathematical diagrams, and code listings. - -;;; Code: - -(defgroup crafted-latex '() - "LaTeX configuration for Crafted Emacs." - :tag "Crafted LaTeX" - :group 'crafted) - -(defcustom crafted-latex-latexp (executable-find "latex") - "Fully qualified path to the `latex' executable" - :tag "`latex' executable location" - :group 'crafted-latex - :type 'string) - -(defcustom crafted-latex-latexmkp (executable-find "latexmk") - "Fully qualified path to the `latexmk' executable" - :tag "`latexmk' executable location" - :group 'crafted-latex - :type 'string) - -(defcustom crafted-latex-use-pdf-tools nil - "Use pdf-tools as the pdf reader - (this is automatic if you load `crafted-pdf-reader')" - :tag "Use pdf-tools as pdf reader" - :group 'crafted-latex - :type 'boolean) - -(defcustom crafted-latex-inhibit-latexmk t - "When set to `nil', the package auctex-latexmk gets installed if the -latex and latexmk executable are found -This package contains a bug which might make it crash during loading -(with a bug related to tex-buf) on newer systems. For this reason, we inhibit -the installation of this package by default. -If you encounter the bug, you keep this package inhibited. You can install -a fix (not on melpa) with the following recipe, and the configuration in this file -will still work -'(auctex-latexmk :fetcher git :host github :repo \"wang1zhen/auctex-latexmk\")" - :tag "Inhibit using `latexmk' command from auxtex-latexmk" - :group 'crafted-latex - :type 'boolean) - - -;; only install and load auctex when the latex executable is found, -;; otherwise it crashes when loading - -(when crafted-latex-latexp - (crafted-package-install-package 'auctex) - - (with-eval-after-load 'latex - (customize-set-variable 'TeX-auto-save t) - (customize-set-variable 'TeX-parse-self t) - (setq-default TeX-master nil) - - ;; compile to pdf - (tex-pdf-mode) - - ;; correlate the source and the output - (TeX-source-correlate-mode) - - ;; set a correct indentation in a few additional environments - (add-to-list 'LaTeX-indent-environment-list '("lstlisting" current-indentation)) - (add-to-list 'LaTeX-indent-environment-list '("tikzcd" LaTeX-indent-tabular)) - (add-to-list 'LaTeX-indent-environment-list '("tikzpicture" current-indentation)) - - ;; add a few macros and environment as verbatim - (add-to-list 'LaTeX-verbatim-environments "lstlisting") - (add-to-list 'LaTeX-verbatim-environments "Verbatim") - (add-to-list 'LaTeX-verbatim-macros-with-braces "lstinline") - (add-to-list 'LaTeX-verbatim-macros-with-delims "lstinline") - - ;; to use pdfview with auctex - (when crafted-latex-use-pdf-tools - (customize-set-variable 'TeX-view-program-selection '((output-pdf "PDF Tools"))) - (customize-set-variable 'TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view))) - (customize-set-variable 'TeX-source-correlate-start-server t)) - - ;; electric pairs in auctex - (customize-set-variable 'TeX-electric-sub-and-superscript t) - (customize-set-variable 'LaTeX-electric-left-right-brace t) - (customize-set-variable 'TeX-electric-math (cons "$" "$")) - - ;; open all buffers with the math mode and auto-fill mode - (add-hook 'LaTeX-mode-hook #'auto-fill-mode) - (add-hook 'LaTeX-mode-hook #'LaTeX-math-mode) - - ;; add support for references - (add-hook 'LaTeX-mode-hook 'turn-on-reftex) - (customize-set-variable 'reftex-plug-into-AUCTeX t) - - ;; to have the buffer refresh after compilation - (add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer))) - -;; message the user if the latex executable is not found -(add-hook 'tex-mode-hook - #'(lambda () (unless crafted-latex-latexp (message "latex executable not found")))) - -;; The following is to use auctex with latexmk. -(defun crafted-latex--install-latexmk () - "install the auctex-latexmk package when the latex and latexmk executable -are found (see `crafted-latex-inhibit-latexmk' )" - (when (and crafted-latex-latexp - crafted-latex-latexmkp) - (crafted-package-install-package 'auctex-latexmk))) - -(defun crafted-latex--watch-inhibit-latexmk (sym val op buf) - "watcher for the `crafted-latex-inhibit-latexmk' variable" - (unless val - (crafted-latex--install-latexmk))) - -(add-variable-watcher 'crafted-latex-inhibit-latexmk - #'crafted-latex--watch-inhibit-latexmk) - -(when (and crafted-latex-latexp - crafted-latex-latexmkp) - (with-eval-after-load 'latex - (when (require 'auctex-latexmk nil 'noerror) - (with-eval-after-load 'auctex-latexmk - (auctex-latexmk-setup) - (customize-set-variable 'auctex-latexmk-inherit-TeX-PDF-mode t)) - (add-hook 'TeX-mode-hook #'(lambda () (setq TeX-command-default "LatexMk")))))) - -(provide 'crafted-latex) -;;; crafted-latex.el ends here diff --git a/.config/emacs/modules/crafted-org.el b/.config/emacs/modules/crafted-org.el deleted file mode 100644 index e17ac07..0000000 --- a/.config/emacs/modules/crafted-org.el +++ /dev/null @@ -1,34 +0,0 @@ -;;; crafted-org.el -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;; Commentary - -;; Provides basic configuration for Org Mode. - -;;; Code: - -(crafted-package-install-package 'org-appear) - -;; Return or left-click with mouse follows link -(customize-set-variable 'org-return-follows-link t) -(customize-set-variable 'org-mouse-1-follows-link t) - -;; Display links as the description provided -(customize-set-variable 'org-link-descriptive t) - -;; Hide markup markers -(customize-set-variable 'org-hide-emphasis-markers t) -(add-hook 'org-mode-hook 'org-appear-mode) - -;; disable auto-pairing of "<" in org-mode -(add-hook 'org-mode-hook (lambda () - (setq-local electric-pair-inhibit-predicate - `(lambda (c) - (if (char-equal c ?<) t (,electric-pair-inhibit-predicate c)))))) - -(provide 'crafted-org) -;;; crafted-org.el ends here diff --git a/.config/emacs/modules/crafted-project.el b/.config/emacs/modules/crafted-project.el deleted file mode 100644 index c4c61dd..0000000 --- a/.config/emacs/modules/crafted-project.el +++ /dev/null @@ -1,17 +0,0 @@ -;;;; crafted-project.el --- Starting configuration for project management -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;;; Commentary - -;; Provides default settings for project management with project.el - -;;; Code: - -(customize-set-variable 'project-list-file (expand-file-name "projects" crafted-config-var-directory)) - -(provide 'crafted-project) -;;; crafted-project.el ends here diff --git a/.config/emacs/modules/crafted-startup.el b/.config/emacs/modules/crafted-startup.el deleted file mode 100644 index dfc4cf8..0000000 --- a/.config/emacs/modules/crafted-startup.el +++ /dev/null @@ -1,203 +0,0 @@ -;;; crafted-startup.el --- Crafted Emacs splash screen on startup -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;;; Commentary: - -;; Provide a fancy splash screen similar to the Emacs default splash -;; screen or the Emacs about page. - -;;; Code: -(require 'crafted-updates) - -(defgroup crafted-startup '() - "Startup configuration for Crafted Emacs" - :tag "Crafted Startup" - :group 'crafted) - -(define-obsolete-variable-alias - 'rational-startup-inhibit-splash - 'crafted-startup-inhibit-splash - "1") -(defcustom crafted-startup-inhibit-splash nil - "Disable the Crafted Emacs Splash screen" - :type 'boolean - :group 'crafted-startup) - -(define-obsolete-variable-alias - 'rational-startup-recentf-count - 'crafted-startup-recentf-count - "1") -(defcustom crafted-startup-recentf-count 10 - "The number of recent files to display on the splash screen" - :type 'number - :group 'crafted-startup) - -(defconst crafted-startup-text - `((:face (variable-pitch font-lock-comment-face (:height 1.5) bold) - ,(let* ((welcome-text "Welcome to Crafted Emacs!\n\n") - (welcome-len (length welcome-text)) - (welcome-mid (/ welcome-len 2))) - (concat - (make-string (abs (- (/ (window-width) 2) - welcome-mid)) - ? ) - welcome-text)) - :face variable-pitch - :link ("View Crafted Emacs Manual" ,(lambda (_button) (info "crafted-emacs"))) - "\tView the Crafted Emacs manual using Info\n" - "\n")) - "A list of texts to show in the middle part of splash screens. -Each element in the list should be a list of strings or pairs -`:face FACE', like `fancy-splash-insert' accepts them.") - -(defvar crafted-startup-screen-inhibit-startup-screen nil) - -(defun crafted-startup-tail (&optional concise) - "Insert the tail part of the splash screen into the current buffer." - (fancy-splash-insert - :face 'variable-pitch - "\nTo start... " - :link `("Open a File" - ,(lambda (_button) (call-interactively 'find-file)) - "Specify a new file's name, to edit the file") - " " - :link `("Open Home Directory" - ,(lambda (_button) (dired "~")) - "Open your home directory, to operate on its files") - " " - :link `("Open Crafted Config Directory" - ,(lambda (_button) (dired crafted-config-path)) - "Open the Crafted Emacs configuration directory, to operate on its files") - " " - :link `("Customize Crafted Emacs" - ,(lambda (_button) (customize-group 'crafted)) - "Change initialization settings including this screen") - "\n") - - (fancy-splash-insert - :face '(variable-pitch (:height 0.7)) - "\n\nTurn this screen off by adding:\n" - :face '(default font-lock-keyword-face) - "`(customize-set-variable 'crafted-startup-inhibit-splash t)'\n" - :face '(variable-pitch (:height 0.7)) - " to your " crafted-config-file "\n" - "Or check the box and click the link below, which will do the same thing.") - - (fancy-splash-insert - :face 'variable-pitch "\n" - :link `("Dismiss this startup screen" - ,(lambda (_button) - (when crafted-startup-screen-inhibit-startup-screen - (customize-set-variable 'crafted-startup-inhibit-splash t) - (customize-mark-to-save 'crafted-startup-inhibit-splash) - (custom-save-all)) - (quit-windows-on "*Crafted Emacs*" t))) - " ") - (when custom-file - (let ((checked (create-image "checked.xpm" - nil nil :ascent 'center)) - (unchecked (create-image "unchecked.xpm" - nil nil :ascent 'center))) - (insert-button - " " - :on-glyph checked - :off-glyph unchecked - 'checked nil 'display unchecked 'follow-link t - 'action (lambda (button) - (if (overlay-get button 'checked) - (progn (overlay-put button 'checked nil) - (overlay-put button 'display - (overlay-get button :off-glyph)) - (setq crafted-startup-screen-inhibit-startup-screen - nil)) - (overlay-put button 'checked t) - (overlay-put button 'display - (overlay-get button :on-glyph)) - (setq crafted-startup-screen-inhibit-startup-screen t)))))) - (fancy-splash-insert :face '(variable-pitch (:height 0.9)) - " Never show it again.")) - -(defun crafted-startup-recentf () - (message "Showing recents on splash screen") - (fancy-splash-insert - :face '(variable-pitch font-lock-string-face italic) - (condition-case recentf-list - (if (not (seq-empty-p recentf-list)) - "Recent Files:\n" - "\n") - (error "\n"))) - (condition-case recentf-list - (if (not (seq-empty-p recentf-list)) - (dolist (file (seq-take recentf-list crafted-startup-recentf-count)) - (fancy-splash-insert - :face 'default - :link `(,file ,(lambda (_button) (find-file file))) - "\n")) - "\n") - (error "\n"))) - -(defun crafted-startup-screen (&optional concise) - "Display fancy startup screen. -If CONCISE is non-nil, display a concise version of the -splash screen in another window." - (message "Loading Crafted Startup Screen") - (let ((splash-buffer (get-buffer-create "*Crafted Emacs*"))) - (with-current-buffer splash-buffer - (let ((inhibit-read-only t)) - (erase-buffer) - (setq default-directory command-line-default-directory) - (make-local-variable 'crafted-startup-screen-inhibit-startup-screen) - (if pure-space-overflow - (insert pure-space-overflow-message)) - (dolist (text crafted-startup-text) - (apply #'fancy-splash-insert text) - (insert "\n")) - (crafted-updates-check-for-latest) - (if (> (condition-case nil - (crafted-updates--get-new-commit-count) - (error 0)) 0) - (fancy-splash-insert - :face '(variable-pitch font-lock-keyword-face bold) - (format "%s : " (crafted-updates-status-message)) - :face '(variable-pitch font-lock-keyword-face) - :link `(" Show Updates " ,(lambda (_button) (crafted-updates-show-latest))) - :face '(variable-pitch font-lock-keyword-face) - :link `(" Get Updates " ,(lambda (_button) (crafted-updates-pull-latest t))) - "\n") - (fancy-splash-insert - :face '(variable-pitch font-lock-keyword-face bold) - (format "%s\n" (condition-case nil - (crafted-updates-status-message) - (error "Crafted Emacs status could not be determined."))))) - (insert "\n\n") - (crafted-startup-recentf) - (skip-chars-backward "\n") - (delete-region (point) (point-max)) - (insert "\n") - (crafted-startup-tail concise)) - (use-local-map splash-screen-keymap) - (setq-local browse-url-browser-function 'eww-browse-url) - (setq tab-width 22 - buffer-read-only t) - (set-buffer-modified-p nil) - (if (and view-read-only (not view-mode)) - (view-mode-enter nil 'kill-buffer)) - (goto-char (point-min)) - (forward-line (if concise 2 4))) - (if concise - (progn - (display-buffer splash-buffer) - ;; If the splash screen is in a split window, fit it. - (let ((window (get-buffer-window splash-buffer t))) - (or (null window) - (eq window (selected-window)) - (eq window (next-window window)) - (fit-window-to-buffer window)))) - (switch-to-buffer splash-buffer)))) - -(provide 'crafted-startup) -;;; crafted-startup.el ends here diff --git a/.config/emacs/modules/crafted-ui.el b/.config/emacs/modules/crafted-ui.el deleted file mode 100644 index 925bd97..0000000 --- a/.config/emacs/modules/crafted-ui.el +++ /dev/null @@ -1,198 +0,0 @@ -;;; crafted-ui.el -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;; Commentary - -;; User interface customizations. Examples are the modeline and how -;; help buffers are displayed. - -;; This package provides a basic, customized appearance for -;; Emacs. Specifically, it uses: Helpful to customize the information -;; and visual display of help buffers, such as that created by M-x -;; `describe-function'; Doom Modeline and Themes, to customize the -;; appearance of buffers, text, et cetera; All-the-icons, to provide -;; Doom Modeline with font-based icons (rather than raster or vector -;; images); and includes some Emacs Lisp demonstrations. - -;;  Run `all-the-icons-install-fonts' to ensure the fonts necessary -;; for ALL THE ICONS are available on your system. You must run this -;; function if the "stop" icon at the beginning of this paragraph is -;; not displayed properly (it appears as a box with some numbers -;; and/or letters inside it). - -;; Read the documentation for `all-the-icons'; on Windows, -;; `all-the-icons-install-fonts' only downloads fonts, they must be -;; installed manually. This is necessary if icons are not displaying -;; properly. - -;;; Code: - -(crafted-package-install-package 'all-the-icons) -(crafted-package-install-package 'elisp-demos) -(crafted-package-install-package 'helpful) - -;;;; Font -(defun crafted-ui--set-default-font (spec) - "Set the default font based on SPEC. - -SPEC is expected to be a plist with the same key names -as accepted by `set-face-attribute'." - (when spec - (apply 'set-face-attribute 'default nil spec))) - -(defun crafted-ui--toggle-doom-modeline-mode (state) - "Turn on/off doom-modeline-mode if it is installed. - -STATE is either 1 to turn the mode on, or -1 to turn it off." - (when (package-installed-p 'doom-modeline) - (doom-modeline-mode state))) - -(defgroup crafted-ui '() - "User interface related configuration for Crafted Emacs." - :tag "Crafted UI" - :group 'crafted) - -(define-obsolete-variable-alias - 'rational-ui-default-font - 'crafted-ui-default-font - "1") -(defcustom crafted-ui-default-font nil - "The configuration of the `default' face. -Use a plist with the same key names as accepted by `set-face-attribute'." - :group 'crafted-ui - :type '(plist :key-type: symbol) - :tag "Default font" - :set (lambda (sym val) - (let ((prev-val (if (boundp 'crafted-ui-default-font) - crafted-ui-default-font - nil))) - (set-default sym val) - (when (and val (not (eq val prev-val))) - (crafted-ui--set-default-font val))))) - -;;;; Mode-Line -(defcustom crafted-ui-use-doom-modeline nil - "Use doom-modeline-mode." - :group 'crafted-ui - :type 'boolean - :tag "Use Doom Modeline" - :set (lambda (sym val) - (set-default sym val) - (if val - (crafted-ui--toggle-doom-modeline-mode 1) - (crafted-ui--toggle-doom-modeline-mode -1)))) - -;; Configure `doom-modeline' if it is enabled -(when crafted-ui-use-doom-modeline - (crafted-package-install-package 'doom-modeline) - (customize-set-variable 'doom-modeline-height 15) - (customize-set-variable 'doom-modeline-bar-width 6) - (customize-set-variable 'doom-modeline-minor-modes t) - (customize-set-variable 'doom-modeline-buffer-file-name-style 'truncate-except-project)) - -;;;; Help Buffers - -;; Make `describe-*' screens more helpful -(require 'helpful) -(define-key helpful-mode-map [remap revert-buffer] #'helpful-update) -(global-set-key [remap describe-command] #'helpful-command) -(global-set-key [remap describe-function] #'helpful-callable) -(global-set-key [remap describe-key] #'helpful-key) -(global-set-key [remap describe-symbol] #'helpful-symbol) -(global-set-key [remap describe-variable] #'helpful-variable) -(global-set-key (kbd "C-h F") #'helpful-function) - -;; Bind extra `describe-*' commands -(global-set-key (kbd "C-h K") #'describe-keymap) - -;;;; Line Numbers -(define-obsolete-variable-alias - 'rational-ui-line-numbers-enabled-modes - 'crafted-ui-line-numbers-enabled-modes - "1") -(defcustom crafted-ui-line-numbers-enabled-modes - '(conf-mode prog-mode) - "Modes which should display line numbers." - :type 'list - :group 'crafted-ui) - -(define-obsolete-variable-alias - 'rational-ui-line-numbers-disabled-modes - 'crafted-ui-line-numbers-disabled-modes - "1") -(defcustom crafted-ui-line-numbers-disabled-modes - '(org-mode) - "Modes which should not display line numbers. -Modes derived from the modes defined in -`crafted-ui-line-number-enabled-modes', but should not display line numbers." - :type 'list - :group 'crafted-ui) - -(defun crafted-ui--enable-line-numbers-mode () - "Turn on line numbers mode. - -Used as hook for modes which should display line numbers." - (display-line-numbers-mode 1)) - -(defun crafted-ui--disable-line-numbers-mode () - "Turn off line numbers mode. - -Used as hook for modes which should not display line numebrs." - (display-line-numbers-mode -1)) - -(defun crafted-ui--update-line-numbers-display () - "Update configuration for line numbers display." - (if crafted-ui-display-line-numbers - (progn - (dolist (mode crafted-ui-line-numbers-enabled-modes) - (add-hook (intern (format "%s-hook" mode)) - #'crafted-ui--enable-line-numbers-mode)) - (dolist (mode crafted-ui-line-numbers-disabled-modes) - (add-hook (intern (format "%s-hook" mode)) - #'crafted-ui--disable-line-numbers-mode)) - (setq-default - display-line-numbers-grow-only t - display-line-numbers-type t - display-line-numbers-width 2)) - (progn - (dolist (mode crafted-ui-line-numbers-enabled-modes) - (remove-hook (intern (format "%s-hook" mode)) - #'crafted-ui--enable-line-numbers-mode)) - (dolist (mode crafted-ui-line-numbers-disabled-modes) - (remove-hook (intern (format "%s-hook" mode)) - #'crafted-ui--disable-line-numbers-mode))))) - -(define-obsolete-variable-alias - 'rational-ui-display-line-numbers - 'crafted-ui-display-line-numbers - "1") -(defcustom crafted-ui-display-line-numbers nil - "Whether line numbers should be enabled." - :type 'boolean - :group 'crafted-ui - :set (lambda (sym val) - (set-default sym val) - (crafted-ui--update-line-numbers-display))) - -;;;; Elisp-Demos - -;; also add some examples -(require 'elisp-demos) -(advice-add 'helpful-update :after #'elisp-demos-advice-helpful-update) - -;; add visual pulse when changing focus, like beacon but built-in -;; from from https://karthinks.com/software/batteries-included-with-emacs/ -(defun pulse-line (&rest _) - "Pulse the current line." - (pulse-momentary-highlight-one-line (point))) - -(dolist (command '(scroll-up-command scroll-down-command - recenter-top-bottom other-window)) - (advice-add command :after #'pulse-line)) - -(provide 'crafted-ui) -;;; crafted-ui.el ends here diff --git a/.config/emacs/modules/crafted-updates.el b/.config/emacs/modules/crafted-updates.el deleted file mode 100644 index 92c69f9..0000000 --- a/.config/emacs/modules/crafted-updates.el +++ /dev/null @@ -1,120 +0,0 @@ -;;;; crafted-updates.el --- Provides automatic update behavior for the configuration. -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;; Commentary - -;;; Code: -(autoload 'vc-git--out-ok "vc-git") -(defun crafted-updates--call-git (&rest args) - (let ((default-directory user-emacs-directory)) - (with-temp-buffer - (if (apply #'vc-git--out-ok args) - (buffer-string) - nil)))) - -(defun crafted-updates--get-new-commit-count () - (string-to-number (crafted-updates--call-git "rev-list" "--count" "master..origin/master"))) - -(defun crafted-updates-status-message () - "Status message indicating availble updates or not." - (if (> (crafted-updates--get-new-commit-count) 0) - "Crafted Emacs updates are available!" - "Crafted Emacs is up to date!")) - -(defun crafted-updates--notify-of-updates () - (message (crafted-updates-status-message))) - -(defun crafted-updates--poll-git-fetch-status (process) - (if (eql (process-status process) 'exit) - (when (eql (process-exit-status process) 0) - ) - (run-at-time 1 nil #'crafted-updates--poll-git-fetch-status process))) - -(defun crafted-updates--find-init-el () - (find-file-noselect (expand-file-name "init.el" user-emacs-directory))) - -(defun crafted-updates-check-for-latest () - "Fetches the latest Crafted Emacs commits from GitHub and -notifies you if there are any updates." - (interactive) - (message "Checking for Crafted Emacs updates...") - (when (crafted-updates--call-git #' "fetch" "origin") - (crafted-updates--notify-of-updates))) - -(defun crafted-updates-show-latest () - "Shows a buffer containing a log of the latest commits to -Crafted Emacs." - (interactive) - (message "Fetching latest commit log for Crafted Emacs...") - (with-current-buffer (find-file-noselect (expand-file-name "init.el" user-emacs-directory)) - (vc-log-incoming))) - -(defun crafted-updates--pull-commits () - (message "Pulling latest commits to Crafted Emacs...") - (with-current-buffer (find-file-noselect (expand-file-name "init.el" user-emacs-directory)) - (vc-pull))) - -(defun crafted-updates-pull-latest (do-pull) - "Pull the latest Crafted Emacs version into the local repository. - -If DO-PULL is nil then only the latest updates will be shown, -otherwise the local repository will get updated to the GitHub -version. - -Interactively, the default if you just type RET is to show recent -changes as if you called `crafted-updates-show-latest'. - -With a `\\[universal-argument]' prefix immediately pull changes -and don't prompt for confirmation." - (interactive - (list - (or current-prefix-arg - (pcase (completing-read "Crafted Update Action: " '("Show Log" "Update") nil t nil nil "Show Log") - ("Show Log" nil) - ("Update" t))))) - (if do-pull - (crafted-updates--pull-commits) - (crafted-updates-show-latest))) - -(defgroup crafted-updates '() - "Configuration for keeping Crafted Emacs up-to-date." - :tag "Crafted Updates" - :group 'crafted) - -;; TODO: use a derived type to check that the value is something `run-at-time' -;; will accept -(define-obsolete-variable-alias - 'rational-updates-fetch-interval - 'crafted-updates-fetch-interval - "1") -(defcustom crafted-updates-fetch-interval "24 hours" - "The interval at which `crafted-updates-mode' will check for updates. - -The interval is scheduled with `run-at-time', so the value of -this variable must conform to a format accepted by -`run-at-time'." - :group 'crafted-updates) - -(defun crafted-updates--do-automatic-fetch () - (when crafted-updates-mode - (crafted-updates-check-for-latest) - (crafted-updates--schedule-fetch))) - -(defun crafted-updates--schedule-fetch () - (run-at-time crafted-updates-fetch-interval nil #'crafted-updates--do-automatic-fetch)) - -(define-minor-mode crafted-updates-mode - "Provides an automatic update checking feature for Crafted -Emacs. When enabled, it will automatically check for updates at -the specified `crafted-updates-fetch-interval'." - :global t - :group 'crafted-updates - (when crafted-updates-mode - (crafted-updates--schedule-fetch))) - -(provide 'crafted-updates) -;;; crafted-updates.el ends here diff --git a/.config/emacs/modules/crafted-windows.el b/.config/emacs/modules/crafted-windows.el deleted file mode 100644 index d198547..0000000 --- a/.config/emacs/modules/crafted-windows.el +++ /dev/null @@ -1,51 +0,0 @@ -;;; crafted-windows.el -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;; Commentary - -;; Emacs windows configuration. - -;;; Code: - -(defgroup crafted-windows '() - "Window related configuration for Crafted Emacs." - :tag "Crafted Windows" - :group 'crafted) - -(define-obsolete-variable-alias - 'rational-windows-evil-style - 'crafted-windows-evil-style - "1") -(defcustom crafted-windows-evil-style nil - "When non-nil, window movement will use evil-style bindings." - :group 'crafted-windows - :type 'boolean) - -(define-obsolete-variable-alias - 'rational-windows-prefix-key - 'crafted-windows-prefix-key - "1") - -(defcustom crafted-windows-prefix-key "C-c w" - "Configure the prefix key for `crafted-windows' bindings." - :group 'crafted-windows - :type 'key) - -(winner-mode 1) - -(define-prefix-command 'crafted-windows-key-map) - -(define-key 'crafted-windows-key-map (kbd "u") 'winner-undo) -(define-key 'crafted-windows-key-map (kbd "n") 'windmove-down) -(define-key 'crafted-windows-key-map (kbd "p") 'windmove-up) -(define-key 'crafted-windows-key-map (kbd "b") 'windmove-left) -(define-key 'crafted-windows-key-map (kbd "f") 'windmove-right) - -(global-set-key (kbd crafted-windows-prefix-key) 'crafted-windows-key-map) - -(provide 'crafted-windows) -;;; crafted-windows.el ends here diff --git a/.config/emacs/modules/custom-dashboard.el b/.config/emacs/modules/custom-dashboard.el deleted file mode 100644 index fced8ec..0000000 --- a/.config/emacs/modules/custom-dashboard.el +++ /dev/null @@ -1,37 +0,0 @@ -;;; custom-dashboard.el -*- lexical-binding: t; -*- -(crafted-package-install-package 'dashboard) - -(require 'dashboard) -(setq dashboard-projects-backend "project-el") -(setq dashboard-set-heading-icons t) -(setq dashboard-set-file-icons t) -(setq dashboard-center-content t) ;; set to 't' for centered content -(setq dashboard-items '((recents . 10) - (bookmarks . 5))) - ;;(projects . 10))) ;; TODO after projectile -(setq dashboard-set-footer t) -(setq dashboard-page-separator "\n\f\n") -(setq dashboard-set-navigator t) -;; Format: "(icon title help action face prefix suffix)" -(setq dashboard-navigator-buttons - `(;; line1 - ((,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust 0.0) - "Github" - "Browse my Github" - (lambda (&rest _) (browse-url "https://github.com/JaeUs3792/"))) - (,(all-the-icons-octicon "home" :height 1.1 :v-adjust 0.0) - "Homepage" - "Browse my Homepage" - (lambda (&rest _) (browse-url "https://jaeus.net")))))) - -(dashboard-setup-startup-hook) -(dashboard-modify-heading-icons '((recents . "file-text") - (bookmarks . "book"))) - -(setq dashboard-startup-banner (expand-file-name "logo.png" user-emacs-directory)) - -(require 'linum) -(add-hook 'dashboard-mode-hook page-break-lines-mode) - -(provide 'custom-dashboard) -;;; custom-dashboard.el end here diff --git a/.config/emacs/modules/custom-evil.el b/.config/emacs/modules/custom-evil.el deleted file mode 100644 index bab3d00..0000000 --- a/.config/emacs/modules/custom-evil.el +++ /dev/null @@ -1,70 +0,0 @@ -;;; crafted-evil.el --- Evil mode configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 -;; SPDX-License-Identifier: MIT - -;; Author: System Crafters Community - -;;; Commentary: - -;; Evil mode configuration, for those who prefer `Vim' keybindings. - -;;; Code: - -;; Install dependencies -(crafted-package-install-package 'evil) -(crafted-package-install-package 'evil-collection) -(crafted-package-install-package 'evil-nerd-commenter) - -;; Turn on undo-tree globally -(when (< emacs-major-version 28) - (crafted-package-install-package 'undo-tree) - (global-undo-tree-mode)) - -;; Set some variables that must be configured before loading the package -(customize-set-variable 'evil-want-integration t) -(customize-set-variable 'evil-want-keybinding nil) -(customize-set-variable 'evil-want-C-i-jump nil) -(customize-set-variable 'evil-respect-visual-line-mode t) -;; C-h is backspace in insert state -(customize-set-variable 'evil-want-C-h-delete t) -(if (< emacs-major-version 28) - (customize-set-variable 'evil-undo-system 'undo-tree) - (customize-set-variable 'evil-undo-system 'undo-redo)) - -(when crafted-evil-vim-muscle-memory - (customize-set-variable 'evil-want-C-i-jump t) - (customize-set-variable 'evil-want-Y-yank-to-eol t) - (customize-set-variable 'evil-want-fine-undo t)) - -;; Load Evil and enable it globally -(require 'evil) -(evil-mode 1) - -;; Make evil search more like vim -(evil-select-search-module 'evil-search-module 'evil-search) - -;; Turn on Evil Nerd Commenter -(evilnc-default-hotkeys) - -;; Make C-g revert to normal state -(define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state) - -;; Rebind `universal-argument' to 'C-M-u' since 'C-u' now scrolls the buffer -(global-set-key (kbd "C-M-u") 'universal-argument) - -;; Use visual line motions even outside of visual-line-mode buffers -(evil-global-set-key 'motion "j" 'evil-next-visual-line) -(evil-global-set-key 'motion "k" 'evil-previous-visual-line) - -;; Make sure some modes start in Emacs state -;; TODO: Split this out to other configuration modules? -(dolist (mode '(custom-mode - eshell-mode - term-mode)) - (add-to-list 'evil-emacs-state-modes mode)) - -(evil-collection-init) - -(provide 'crafted-evil) -;;; crafted-evil.el ends here diff --git a/.config/emacs/modules/custom-keybindings.el b/.config/emacs/modules/custom-keybindings.el new file mode 100755 index 0000000..bdfc72a --- /dev/null +++ b/.config/emacs/modules/custom-keybindings.el @@ -0,0 +1,38 @@ +(use-package which-key + :defer t + :init (which-key-mode) + :diminish which-key-mode + :config + (setq which-key-idle-delay 0.5)) + +(use-package general + :init + (general-auto-unbind-keys) + :config + (general-evil-setup t) + (general-create-definer ju/leader-key-def + :keymaps '(normal insert visual emacs) + :prefix "SPC" + :global-prefix "C-SPC")) + +(ju/leader-key-def + "." 'find-file) + ;; Buffer) + +(use-package evil + :after (general) + :init + (setq evil-want-integration t + evil-want-keybinding nil + evil-want-C-u-scroll t + evil-want-C-i-jump nil) + (require 'evil-vars) + (evil-set-undo-system 'undo-tree) + :config + (evil-mode 1) + (setq evil-want-fine-undo t) ; more granular undo with evil + (evil-set-initial-state 'messages-buffer-mode 'normal) + (evil-set-initial-state 'dashboard-mode 'normal)) + +(provide 'custom-keybindings) +;;; custom-keybindings.el ends here diff --git a/.config/emacs/modules/custom-org.el b/.config/emacs/modules/custom-org.el deleted file mode 100644 index 4495a43..0000000 --- a/.config/emacs/modules/custom-org.el +++ /dev/null @@ -1,22 +0,0 @@ -;;; custom-org.el -*- lexical-binding: t; -*- -(crafted-package-install-package 'org-appear) - -;; Return or left-click with mouse follows link -(customize-set-variable 'org-return-follows-link t) -(customize-set-variable 'org-mouse-1-follows-link t) - -;; Display links as the description provided -(customize-set-variable 'org-link-descriptive t) - -;; Hide markup markers -(customize-set-variable 'org-hide-emphasis-markers t) -(add-hook 'org-mode-hook 'org-appear-mode) - -;; disable auto-pairing of "<" in org-mode -(add-hook 'org-mode-hook (lambda () - (setq-local electric-pair-inhibit-predicate - `(lambda (c) - (if (char-equal c ?<) t (,electric-pair-inhibit-predicate c)))))) - -(provide 'custom-org) -;;; custom-org.el ends here diff --git a/.config/emacs/modules/custom-ui.el b/.config/emacs/modules/custom-ui.el new file mode 100755 index 0000000..6032f7f --- /dev/null +++ b/.config/emacs/modules/custom-ui.el @@ -0,0 +1,51 @@ +(use-package doom-themes + ;;:init (load-theme 'doom-one t)) + :init (load-theme 'doom-palenight t)) + +(setq visible-bell t) +(set-frame-parameter nil 'alpha-background 1.0) +(add-to-list 'default-frame-alist '(alpha-background . 1.0)) +(defun toggle-ttt () + "toggle transparency." + (interactive) + (let ((alpha-transparency 1.0)) + (if (eq (frame-parameter nil 'alpha-background) alpha-transparency) + (set-frame-parameter nil 'alpha-background 0.7) + (set-frame-parameter nil 'alpha-background alpha-transparency)))) + +(use-package all-the-icons) +(use-package doom-modeline + :init + (doom-modeline-mode 1) + :config + (setq doom-modeline-height 15 + doom-modeline-env-version t + doom-modeline-indent-info t)) + +(defun self-screenshot (&optional type) + "Save a screenshot of type TYPE of the current Emacs frame. +As shown by the function `', type can weild the value `svg', +`png', `pdf'. + +This function will output in /tmp a file beginning with \"Emacs\" +and ending with the extension of the requested TYPE." + (interactive) + (let* ((type (if type type + (intern (completing-read "Screenshot Type: " + '(png svg pdf postscript))))) + (extension (pcase type + ('png ".png") + ('svg ".svg") + ('pdf ".pdf") + ('postscript ".ps") + (otherwise (error "Cannot export screenshot of type %s" otherwise)))) + (filename (make-temp-file "Emacs-" nil extension)) + (data (x-export-frames nil type))) + (with-temp-file filename + (insert data)) + (kill-new filename) + (rename-file filename (expand-file-name (file-name-nondirectory filename) "~")) + (message filename))) + +(provide 'custom-ui) +;;; custom-ui.el ends here diff --git a/.config/eww/eww-bar/eww-bar.png b/.config/eww/eww-bar/eww-bar.png deleted file mode 100644 index e6de6a8..0000000 Binary files a/.config/eww/eww-bar/eww-bar.png and /dev/null differ diff --git a/.config/eww/eww-bar/eww.scss b/.config/eww/eww-bar/eww.scss deleted file mode 100644 index efa2a50..0000000 --- a/.config/eww/eww-bar/eww.scss +++ /dev/null @@ -1,55 +0,0 @@ -* { - all: unset; //Unsets everything so you can style everything from scratch -} - -//Global Styles -.bar { - background-color: #3a3a3a; - color: #b0b4bc; - padding: 10px; -} - -// Styles on classes (see eww.yuck for more information) - -.sidestuff slider { - all: unset; - color: #ffd5cd; -} - -.metric scale trough highlight { - all: unset; - background-color: #D35D6E; - color: #000000; - border-radius: 10px; -} -.metric scale trough { - all: unset; - background-color: #4e4e4e; - border-radius: 50px; - min-height: 3px; - min-width: 50px; - margin-left: 10px; - margin-right: 20px; -} -.metric scale trough highlight { - all: unset; - background-color: #D35D6E; - color: #000000; - border-radius: 10px; -} -.metric scale trough { - all: unset; - background-color: #4e4e4e; - border-radius: 50px; - min-height: 3px; - min-width: 50px; - margin-left: 10px; - margin-right: 20px; -} -.label-ram { - font-size: large; -} -.workspaces button:hover { - color: #D35D6E; -} - diff --git a/.config/eww/eww-bar/eww.yuck b/.config/eww/eww-bar/eww.yuck deleted file mode 100644 index a4a27d2..0000000 --- a/.config/eww/eww-bar/eww.yuck +++ /dev/null @@ -1,75 +0,0 @@ -(defwidget bar [] - (centerbox :orientation "h" - (workspaces) - (music) - (sidestuff))) - -(defwidget sidestuff [] - (box :class "sidestuff" :orientation "h" :space-evenly false :halign "end" - (metric :label "🔊" - :value volume - :onchange "amixer -D pulse sset Master {}%") - (metric :label "" - :value {EWW_RAM.used_mem_perc} - :onchange "") - (metric :label "💾" - :value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)} - :onchange "") - time)) - -(defwidget workspaces [] - (box :class "workspaces" - :orientation "h" - :space-evenly true - :halign "start" - :spacing 10 - (button :onclick "wmctrl -s 0" 1) - (button :onclick "wmctrl -s 1" 2) - (button :onclick "wmctrl -s 2" 3) - (button :onclick "wmctrl -s 3" 4) - (button :onclick "wmctrl -s 4" 5) - (button :onclick "wmctrl -s 5" 6) - (button :onclick "wmctrl -s 6" 7) - (button :onclick "wmctrl -s 7" 8) - (button :onclick "wmctrl -s 8" 9))) - -(defwidget music [] - (box :class "music" - :orientation "h" - :space-evenly false - :halign "center" - {music != "" ? "🎵${music}" : ""})) - - -(defwidget metric [label value onchange] - (box :orientation "h" - :class "metric" - :space-evenly false - (box :class "label" label) - (scale :min 0 - :max 101 - :active {onchange != ""} - :value value - :onchange onchange))) - - - -(deflisten music :initial "" - "playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true") - -(defpoll volume :interval "1s" - "scripts/getvol") - -(defpoll time :interval "10s" - "date '+%H:%M %b %d, %Y'") - -(defwindow bar - :monitor 0 - :windowtype "dock" - :geometry (geometry :x "0%" - :y "0%" - :width "90%" - :height "10px" - :anchor "top center") - :reserve (struts :side "top" :distance "4%") - (bar)) diff --git a/.config/eww/eww-bar/scripts/getram b/.config/eww/eww-bar/scripts/getram deleted file mode 100755 index 791a5a5..0000000 --- a/.config/eww/eww-bar/scripts/getram +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}') diff --git a/.config/eww/eww-bar/scripts/getvol b/.config/eww/eww-bar/scripts/getvol deleted file mode 100755 index 6a95077..0000000 --- a/.config/eww/eww-bar/scripts/getvol +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%' | head -1 diff --git a/.config/eww/mybar/eww.scss b/.config/eww/mybar/eww.scss deleted file mode 100644 index 9bcf83f..0000000 --- a/.config/eww/mybar/eww.scss +++ /dev/null @@ -1,107 +0,0 @@ -// EWW.SCSS -// GLOBALS -*{ - all: unset; - font-family: "Ubuntu Mono"; - font-weight: 400; -} - -.bars { - background-image: url("images/background.png"); - background-color: #120010; - border: 3px solid #ff1475; - border-radius: 20px; -} - - -// LEFT MODULES -// Workspaces -.workspaces { - margin-left: 5px; - margin-top: -2px; -} -.workspace_buttons { - font-family: Hack; - font-size: 15px; - margin: 0 2 0 1; - color: #e6dafc; -} - - -// CENTER MODULES -.center_icons { - margin-right: 3px; - margin-left: 15px; -} -.center_labels { - font-size: 15px; - margin-bottom: -3px; - margin-top: 1px; - color: #e6dafc; -} -.center_revealers { - border-radius: 5px; - background-color: rgba(18,0,16, 1); - min-height: 32px; - border: solid 2px #ffff01; - color: #3081c6; -} -.center_info scale trough highlight { - all: unset; - background: #FFCD01; - border-radius: 10px; - border: solid 2px #ffff01; -} -.center_info scale trough { - all: unset; - background-color: rgba(230,218,252, 0.4); - border-radius: 10px; - min-width: 110px; - min-height: 10px; -} - - -// RIGHT MODULES -.power_button { - color: #ff4c5f; - font-size: 20px; - margin: -10 15 -10 15; -} -.time_box { - margin-top: -10px; - margin-bottom: -10px; -} -.time { - color: #e6dafc; - font-size: 25px; - margin-bottom: -20px; - margin-top: -20px; -} -.date { - color: #e6dafc; - font-size: 25px; - margin-top: 8px; -} -.kb_box { - color: #e6dafc; - font-size: 15px; - margin-left: 2px; - margin-right: 10px; -} -.kb_button_us { - font-size: 15px; - margin-bottom: -3px; -} -.kb_button_es { - font-size: 15px; - margin-top: -2px; -} -.cal { - font-size: 16px; - background-color: #120010; - background-image: url("images/background.png"); - color: #e6dafc; - border: 5px solid #ff1475; - border-radius: 0 0 20 20; - padding: 10px; -} diff --git a/.config/eww/mybar/eww.yuck b/.config/eww/mybar/eww.yuck deleted file mode 100644 index 50c8049..0000000 --- a/.config/eww/mybar/eww.yuck +++ /dev/null @@ -1,813 +0,0 @@ -;; VARS -(defvar eww "eww -c $HOME/.config/eww/mybar") -(defvar music_reveal false) -(defvar cover "images/music.png") -(defvar cpu_reveal false) -(defvar disk_reveal false) -(defvar temperature_reveal false) -(defvar ram_reveal false) -(defvar date_reveal false) -(defvar battery_reveal false) -(defvar left_bg "#120010") -(defvar center_bg "#120010") -(defvar right_bg "#120010") -(defvar media_bar_class "bar_normal") -(defvar media_bar_class_popup "bar_normal_popup") -(defvar battery_image "images/battery_normal.png") -(defvar us_color "rgba(230,218,252,1)") -(defvar es_color "rgba(230,218,252,0.4)") -(defvar day "0") -(defvar month "0") -(defvar year "0") -(defvar wp1 "●") -(defvar wp2 "○") -(defvar wp3 "○") -(defvar wp4 "○") -(defvar wp5 "○") -(defvar layout_button "") -(defvar media_status "") -(defvar artist "No artist") -(defvar artist_parsed "No artist") -(defvar title "No title") -(defvar title_parsed "No title") -(defvar length 100) -(defvar position 0) - -(deflisten launch1 "scripts/workspaces") -(deflisten launch2 "scripts/layout") -(deflisten launch3 "scripts/media_info") - -(defpoll cpu_percent :interval "1s" "scripts/cpu_info") -(defpoll disk_all :interval "10s" "scripts/disk_info --all") -(defpoll disk_used :interval "10s" "scripts/disk_info --used") -(defpoll disk_free :interval "10s" "scripts/disk_info --free") -(defpoll temperature :interval "2s" "scripts/temperature_info") -(defpoll ram_used :interval "2s" "scripts/ram_info --used") -(defpoll ram_all :interval "2s" "scripts/ram_info --all") -(defpoll ram_parsed :interval "2s" "scripts/ram_info --parsed") -(defpoll battery_percent :interval "3s" "scripts/battery_info --percentage") -(defpoll battery_time :interval "3s" "scripts/battery_info --time") -(defpoll hour :interval "1s" "scripts/time_info --hour") -(defpoll minutes :interval "1s" "scripts/time_info --minutes") -(defpoll type :interval "1s" "scripts/time_info --type") -(defpoll date :interval "1s" "scripts/time_info --date") - -;; WINDOWS -;; Left bar -(defwindow bar_left - :geometry - (geometry - :x "10px" - :y "10px" - :width "150px" - :height "25px") - :stacking "bg" - :reserve - (struts - :distance "70px" - :side "top") - :windowtype "dock" - :wm-ignore "false" -(widgets_left)) - -;; Central bar -(defwindow bar_center - :geometry - (geometry - :x "180px" - :y "10px" - :width "930px" - :height "50px") - :stacking "bg" - :reserve - (struts - :distance "70px" - :side "top") - :windowtype "dock" - :wm-ignore "false" - (widgets_center)) - -;; Right bar -(defwindow bar_right - :geometry - (geometry - :x "1130px" - :y "10px" - :width "455px" - :height "50px") - :stacking "bg" - :reserve - (struts - :distance "70px" - :side "top") - :windowtype "dock" - :wm-ignore "false" -(widgets_right)) - -;; Calendar window -(defwindow calendar - :geometry - (geometry - :x "1465px" - :y "65px" - :width "415px" - :height "100px") - :stacking "fg" - :windowtype "dock" - :wm-ignore "false" - (box - :class "cal" - :orientation "h" - :valign "fill" - :halign "fill" - (calendar - :day day - :month month - :year year - :show-details "true" - :show-heading "true" - :show-day-names "true"))) - -;; Music window -(defwindow music - :geometry - (geometry - :x "40px" - :y "65px" - :width "415px" - :height "200px") - :stacking "fg" - :windowtype "dock" - :wm-ignore "false" - (box - :orientation "v" - :valign "fill" - :halign "fill" - :space-evenly "false" - :class "music_box_popup" - (box - :orientation "h" - :valign "fill" - :halign "fill" - :space-evenly "false" - (box - :valign "center" - :halign "start" - (image - :halign "start" - :class "media_art_popup" - :tooltip "${title} by ${artist}" - :path cover - :image-height 130 - :image-width 130)) - (box - :valign "center" - :halign "fill" - :orientation "v" - :class "media_data_popup" - :spacing 20 - (label - :class "media_title_popup" - :markup title_parsed - :halign "center") - (label - :class "media_artist_popup" - :markup artist_parsed - :halign "center") - (box - :orientation "h" - :halign "fill" - :valign "fill" - :class "media_buttons_box_popup" - (eventbox - :cursor "pointer" - (button - :onclick "scripts/media_control --prev" - :class "nextprev_popup" - :tooltip "Previous" - "")) - (eventbox - :cursor "pointer" - (button - :onclick "scripts/media_control --move -5" - :class "move_popup" - :tooltip "-5 seconds" - "")) - (eventbox - :cursor "pointer" - (button - :onclick "scripts/media_control --toggle" - :class "playpause_popup" - :tooltip "Play/Pause" - media_status)) - (eventbox - :cursor "pointer" - (button - :onclick "scripts/media_control --move +5" - :class "move_popup" - :tooltip "+5 seconds" - "")) - (eventbox - :cursor "pointer" - (button - :onclick "scripts/media_control --next" - :class "nextprev_popup" - :tooltip "Next" - "")) - - ))) - (eventbox - :cursor "pointer" - :onhover "${eww} update media_bar_class_popup=\"bar_highlighted_popup\"" - :onhoverlost "${eww} update media_bar_class_popup=\"bar_normal_popup\"" - (box - :orienttion "h" - :valign "fill" - :halign "fill" - :class media_bar_class_popup - (scale - :min 0 - :max length - :value position - :orientation "h" - :onchange "scripts/media_control --seek {}" - ))) - )) - - - - -;; WIDGETS -;; Left widgets -(defwidget widgets_left [] - (eventbox - :onhover "${eww} update left_bg=\"#43013b\"" - :onhoverlost "${eww} update left_bg=\"#120010\"" - (box - :spacing 0 - :space-evenly "false" - :class "bars" - :orientation "h" - :valign "fill" - :hexpand "false" - :style "background-color: ${left_bg}" - (workspaces) - (layout)))) - - - (defwidget workspaces [] - (box - :orientation "h" - :halign "start" - :class "workspaces" - (box - :orientation "h" - :spacing 5 - :space-evenly "false" - :class "${launch1}, ${launch2}, ${launch3}" - (eventbox - :cursor "pointer" - (button - :tooltip "Switch to workspace 1" - :onclick "bspc desktop -f 1" - (label - :markup wp1 - :class "workspace_buttons"))) - (eventbox - :cursor "pointer" - (button - :tooltip "Switch to workspace 2" - :onclick "bspc desktop -f 2" - (label - :markup wp2 - :class "workspace_buttons"))) - (eventbox - :cursor "pointer" - (button - :tooltip "Switch to workspace 3" - :onclick "bspc desktop -f 3" - (label - :markup wp3 - :class "workspace_buttons"))) - (eventbox - :cursor "pointer" - (button - :tooltip "Switch to workspace 4" - :onclick "bspc desktop -f 4" - (label - :markup wp4 - :class "workspace_buttons"))) - (eventbox - :cursor "pointer" - (button - :tooltip "Switch to workspace 5" - :onclick "bspc desktop -f 5" - (label - :markup wp5 - :class "workspace_buttons"))) - ))) - - (defwidget layout [] - (box - :orientation "h" - :halign "start" - (box - :orientation "h" - :space-evenly "false" - (eventbox - :cursor "pointer" - (button - :tooltip "Change current layout" - :onclick "bspc desktop focused --layout next" - (label - :class "layout" - :text layout_button))) - ))) - - (defwidget music [] - (eventbox - :onhover "${eww} update music_reveal=true" - :onhoverlost "${eww} update music_reveal=false" - (box - :class "music_box" - :orientation "h" - :spacing 0 - :space-evenly "false" - :halign "start" - (eventbox - :cursor "pointer" - (box - :space_evenly "false" - :halign "start" - :tooltip "${title} by ${artist}" - (button - :onclick "scripts/popup_music" - (image - :class "media_art" - :path cover - :image-height 40 - :image-width 40)))) - (box - :class "media_data" - :orientation "v" - :space-evenly "false" - :vexpand "false" - :hexpand "false" - :valign "end" - :halign "start" - (label - :class "media_title" - :halign "center" - :markup title_parsed - :limit-width 15 - :wrap "true" - :show_truncated "true") - (revealer - :reveal music_reveal - :transition "slideup" - :duration "350ms" - (box - :orientation "h" - :halign "center" - :space-evenly "false" - :class "media_buttons" - :space-evenly "false" - (eventbox - :cursor "pointer" - (button - :class "prev_button" - :onclick "scripts/media_control --prev" - :tooltip "Previous" - "")) - (eventbox - :cursor "pointer" - (button - :class "toggle_button" - :onclick "scripts/media_control --toggle" - :tooltip "Play/Pause" - "${media_status}")) - (eventbox - :cursor "pointer" - (button - :class "next_button" - :onclick "scripts/media_control --next" - :tooltip "Next" - "")))) - (box - :space-evenly "false" - :class media_bar_class - :halign "center" - :vexpand "false" - :hexpand "false" - (eventbox - ;;:cursor "pointer" - ;; :onhover "${eww} update media_bar_class=bar_highlighted" - ;; :onhoverlost "${eww} update media_bar_class=bar_normal" - (scale - :active "false" - :min 0 - :max length - :value position - :orientation "h" - :tooltip "Seek" - ;; :onchange "scripts/media_control --seek {}" - ))))))) - -;; Central widgets -(defwidget widgets_center [] - (eventbox - :onhover "${eww} update center_bg=\"#43013b\"" - :onhoverlost "${eww} update center_bg=\"#120010\"" - (box - :spacing 0 - :space-evenly "true" - :class "bars" - :orientation "h" - :valign "fill" - :halign "fill" - :hexpand "false" - :style "background-color: ${center_bg}" - (box - :space-evenly "true" - :orientation "h" - :valign "center" - :halign "fill" - (cpu_status) - (ram_status) - (temperature_status) - (disk_status) - (battery_status) - )))) - - -(defwidget cpu_status [] - (eventbox - :onhover "${eww} update cpu_reveal=\"true\"" - :onhoverlost "${eww} update cpu_reveal=\"false\"" - :tooltip "CPU usage" - (box - :orientation "h" - :space-evenly "false" - :class "cpu_box" - :vexpand "false" - :hexpand "false" - (image - :class "center_icons" - :path "images/cpu.png" - :image-width 30 - :image-height 30) - (box - :orientation "v" - :space-evenly "false" - :vexpand "false" - :hexpand "false" - :valign "center" - :class "center_boxes" - (revealer - :reveal "${!cpu_reveal}" - :transition "slidedown" - :duration "350ms" - (box - :orientation "v" - :class "center_info" - :valign "start" - (label - :class "center_labels" - :text "${cpu_percent}%" - :halign "center") - (scale - :min 0 - :max 100 - :value cpu_percent - :orientation "h"))) - (revealer - :reveal cpu_reveal - :transition "slideup" - :duration "350ms" - :valign "center" - (box - :valign "center" - :class "center_revealers" - (graph - :thickness 3 - :value cpu_percent - :time-range "20s" - :min 0 - :max 100 - :dynamic "true" - :line-style "round")) - ))))) - -(defwidget disk_status [] - (eventbox - :onhover "${eww} update disk_reveal=\"true\"" - :onhoverlost "${eww} update disk_reveal=\"false\"" - :tooltip "Disk usage" - (box - :orientation "h" - :space-evenly "false" - :class "disk_box" - :vexpand "false" - :hexpand "false" - (image - :class "center_icons" - :path "images/disk.png" - :image-width 30 - :image-height 30) - (box - :orientation "v" - :space-evenly "false" - :vexpand "false" - :hexpand "false" - :valign "center" - :class "center_boxes" - (revealer - :reveal "${!disk_reveal}" - :transition "slidedown" - :duration "350ms" - (box - :orientation "v" - :class "center_info" - :valign "start" - (label - :class "center_labels" - :text "${disk_used}G/${disk_all}G" - :halign "center") - (scale - :min 0 - :max disk_all - :value disk_used - :orientation "h"))) - (revealer - :reveal disk_reveal - :transition "slideup" - :duration "350ms" - :valign "center" - (box - :valign "center" - :halign "fill" - :class "center_revealers" - (label - :halign "center" - :text "${disk_free}G free")) - ))))) -(defwidget temperature_status [] - (eventbox - :onhover "${eww} update temperature_reveal=\"true\"" - :onhoverlost "${eww} update temperature_reveal=\"false\"" - :tooltip "Internal temperature" - (box - :orientation "h" - :space-evenly "false" - :class "temperature_box" - :vexpand "false" - :hexpand "false" - (image - :class "center_icons" - :path "images/temperature.png" - :image-width 30 - :image-height 30) - (box - :orientation "v" - :space-evenly "false" - :vexpand "false" - :hexpand "false" - :valign "center" - :class "center_boxes" - (revealer - :reveal "${!temperature_reveal}" - :transition "slidedown" - :duration "350ms" - (box - :orientation "v" - :class "center_info" - :valign "start" - (label - :class "center_labels" - :text "${temperature}°C" - :halign "center") - (scale - :min 0 - :max 100 - :value temperature - :orientation "h"))) - (revealer - :reveal temperature_reveal - :transition "slideup" - :duration "350ms" - :valign "center" - (box - :valign "center" - :class "center_revealers" - (graph - :thickness 3 - :value temperature - :time-range "20s" - :min 0 - :max 100 - :dynamic "true" - :line-style "round")) - ))))) - -(defwidget ram_status [] - (eventbox - :onhover "${eww} update ram_reveal=\"true\"" - :onhoverlost "${eww} update ram_reveal=\"false\"" - :tooltip "RAM usage" - (box - :orientation "h" - :space-evenly "false" - :class "ram_box" - :vexpand "false" - :hexpand "false" - (image - :class "center_icons" - :path "images/ram.png" - :image-width 30 - :image-height 30) - (box - :orientation "v" - :space-evenly "false" - :vexpand "false" - :hexpand "false" - :valign "center" - :class "center_boxes" - (revealer - :reveal "${!ram_reveal}" - :transition "slidedown" - :duration "350ms" - (box - :orientation "v" - :class "center_info" - :valign "start" - (label - :class "center_labels" - :text "${ram_parsed}" - :halign "center") - (scale - :min 0 - :max ram_all - :value ram_used - :orientation "h"))) - (revealer - :reveal ram_reveal - :transition "slideup" - :duration "350ms" - :valign "center" - (box - :valign "center" - :class "center_revealers" - (graph - :thickness 3 - :value ram_used - :time-range "20s" - :min 0 - :max ram_all - :dynamic "true" - :line-style "round")) - ))))) - -(defwidget battery_status [] - (eventbox - :onhover "${eww} update battery_reveal=\"true\"" - :onhoverlost "${eww} update battery_reveal=\"false\"" - :tooltip "Battery" - (box - :orientation "h" - :space-evenly "false" - :class "battery_box" - :vexpand "false" - :hexpand "false" - (image - :class "center_icons" - :path battery_image - :image-width 30 - :image-height 30) - (box - :orientation "v" - :space-evenly "false" - :vexpand "false" - :hexpand "false" - :valign "center" - :class "center_boxes" - (revealer - :reveal "${!battery_reveal}" - :transition "slidedown" - :duration "350ms" - (box - :orientation "v" - :class "center_info" - :valign "start" - (label - :class "center_labels" - :text "${battery_percent}%" - :halign "center") - (scale - :min 0 - :max 100 - :value battery_percent - :orientation "h"))) - (revealer - :reveal battery_reveal - :transition "slideup" - :duration "350ms" - :valign "center" - (box - :valign "center" - :class "center_revealers" - (label - :halign "center" - :text battery_time)) - ))))) - - - - - ;; Right widgets -(defwidget widgets_right [] - (eventbox - :onhover "${eww} update right_bg=\"#43013b\"" - :onhoverlost "${eww} update right_bg=\"#120010\"" - (box - :spacing 0 - :space-evenly "false" - :class "bars" - :orientation "h" - :valign "fill" - :hexpand "false" - :style "background-color: ${right_bg}" - (power_button) - (time) - (keyboard) - ))) - -(defwidget power_button [] - (eventbox - :cursor "pointer" - :tooltip "Logout options" - (button - :class "power_button" - :valign "center" - :onclick "~/.bscripts/rofi.sh outopts" - ""))) - -(defwidget time [] - (eventbox - :tooltip "Current time" - :onhover "${eww} update date_reveal=true" - :onhoverlost "${eww} update date_reveal=false" - :cursor "pointer" - (button - :onclick "scripts/popup_calendar" - (box - :class "time_box" - :space-evenly "false" - :orientation "h" - :valign "center" - :halign "fill" - (label - :valign "center" - :class "time" - :markup "${hour}:${minutes}${type}" ) - (revealer - :reveal date_reveal - :transition "slideright" - :duration "350ms" - :valign "fill" - (label - :valign "fill" - :class "date" - :markup "${date}" - )))))) - -(defwidget keyboard [] - (box - :class "kb_box" - :orientation "h" - :valign "fill" - :halign "center" - "|" - (box - :orientation "v" - :space-evenly "false" - :valign "fill" - :halign "center" - (eventbox - :cursor "pointer" - :tooltip "Change layout to US english" - (button - :class "kb_button_us" - :onclick "scripts/kb_layouts set us" - :style "color: ${us_color}" - :valign "center" - "US")) - (eventbox - :cursor "pointer" - :tooltip "Change layout to US spanish" - (button - :class "kb_button_es" - :onclick "scripts/kb_layouts set es" - :style "color: ${es_color}" - :valign "center" - "ES") - )))) diff --git a/.config/eww/mybar/images/background.png b/.config/eww/mybar/images/background.png deleted file mode 100644 index 112c24b..0000000 Binary files a/.config/eww/mybar/images/background.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_0.png b/.config/eww/mybar/images/battery_0.png deleted file mode 100644 index 514554b..0000000 Binary files a/.config/eww/mybar/images/battery_0.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_10.png b/.config/eww/mybar/images/battery_10.png deleted file mode 100644 index 33dee3d..0000000 Binary files a/.config/eww/mybar/images/battery_10.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_100.png b/.config/eww/mybar/images/battery_100.png deleted file mode 100644 index b454554..0000000 Binary files a/.config/eww/mybar/images/battery_100.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_20.png b/.config/eww/mybar/images/battery_20.png deleted file mode 100644 index 842654a..0000000 Binary files a/.config/eww/mybar/images/battery_20.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_30.png b/.config/eww/mybar/images/battery_30.png deleted file mode 100644 index 364e76b..0000000 Binary files a/.config/eww/mybar/images/battery_30.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_40.png b/.config/eww/mybar/images/battery_40.png deleted file mode 100644 index 032ab47..0000000 Binary files a/.config/eww/mybar/images/battery_40.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_50.png b/.config/eww/mybar/images/battery_50.png deleted file mode 100644 index 46a6ad1..0000000 Binary files a/.config/eww/mybar/images/battery_50.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_60.png b/.config/eww/mybar/images/battery_60.png deleted file mode 100644 index 4fe6472..0000000 Binary files a/.config/eww/mybar/images/battery_60.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_70.png b/.config/eww/mybar/images/battery_70.png deleted file mode 100644 index 804bc10..0000000 Binary files a/.config/eww/mybar/images/battery_70.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_80.png b/.config/eww/mybar/images/battery_80.png deleted file mode 100644 index 898a144..0000000 Binary files a/.config/eww/mybar/images/battery_80.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_90.png b/.config/eww/mybar/images/battery_90.png deleted file mode 100644 index 44bd3e1..0000000 Binary files a/.config/eww/mybar/images/battery_90.png and /dev/null differ diff --git a/.config/eww/mybar/images/battery_charging.png b/.config/eww/mybar/images/battery_charging.png deleted file mode 100644 index 6021eb5..0000000 Binary files a/.config/eww/mybar/images/battery_charging.png and /dev/null differ diff --git a/.config/eww/mybar/images/cpu.png b/.config/eww/mybar/images/cpu.png deleted file mode 100644 index 4c30da3..0000000 Binary files a/.config/eww/mybar/images/cpu.png and /dev/null differ diff --git a/.config/eww/mybar/images/currmedia.png b/.config/eww/mybar/images/currmedia.png deleted file mode 100644 index 86be125..0000000 Binary files a/.config/eww/mybar/images/currmedia.png and /dev/null differ diff --git a/.config/eww/mybar/images/disk.png b/.config/eww/mybar/images/disk.png deleted file mode 100644 index bdf9cbf..0000000 Binary files a/.config/eww/mybar/images/disk.png and /dev/null differ diff --git a/.config/eww/mybar/images/music.png b/.config/eww/mybar/images/music.png deleted file mode 100644 index 3ded333..0000000 Binary files a/.config/eww/mybar/images/music.png and /dev/null differ diff --git a/.config/eww/mybar/images/ram.png b/.config/eww/mybar/images/ram.png deleted file mode 100644 index 37b71bf..0000000 Binary files a/.config/eww/mybar/images/ram.png and /dev/null differ diff --git a/.config/eww/mybar/images/temperature.png b/.config/eww/mybar/images/temperature.png deleted file mode 100644 index 1a8a406..0000000 Binary files a/.config/eww/mybar/images/temperature.png and /dev/null differ diff --git a/.config/eww/mybar/polybar_tray.ini b/.config/eww/mybar/polybar_tray.ini deleted file mode 100644 index d73058f..0000000 --- a/.config/eww/mybar/polybar_tray.ini +++ /dev/null @@ -1,17 +0,0 @@ -;tray -[bar/tray] -width = 10 -height = 40 -offset-x = 1865 -offset-y = 25 -tray-position = right -tray-detached = true -tray-offset-x = 20 -background = ${xrdb:color8:#222} - -modules-right = filler - -[module/filler] -type = custom/text -format = " " - diff --git a/.config/eww/mybar/scripts/battery_info b/.config/eww/mybar/scripts/battery_info deleted file mode 100644 index 0dc254f..0000000 --- a/.config/eww/mybar/scripts/battery_info +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -notify() -{ - case $1 in - charging) - if [[ $lstate -ne 3 ]] - then - echo 3 > /tmp/batstate - pop_report -d 800 -m "Charging$icon" -t battery_charging -o "font-size: 70px" "font-family: CaskaydiaCoveNerdFont" "padding-right: 30px" - fi; - ;; - high) - echo 2 > /tmp/batstate - ;; - mid) - if [[ $lstate -gt 1 ]] - then - echo 1 > /tmp/batstate - ~/.ricing/notify-send.sh "Warning: $bat_level% Battery left" -i "~/Pictures/Important/icons/other/battery_mid.png" -t 10000 --replace=550 -u critical - fi; - ;; - low) - if [[ $lstate -gt 0 ]] - then - echo 0 > /tmp/batstate - pop_report -m "Battery is critically low" -d 5000 -t battery_low - fi; - ;; - esac -} - -# Set necessary info -eww="eww -c $HOME/.config/eww/mybar" -lstate=`cat /tmp/batstate` -acpi=`acpi -b` -bat_level_all=`echo "$acpi" | grep -v "unavailable" | grep -E -o "[0-9][0-9]?[0-9]?%"` -bat_level=`echo "$bat_level_all" | awk -F"%" 'BEGIN{tot=0;i=0} {i++; tot+=$1} END{printf("%d%%\n", tot/i)}'` -bat_level=`printf ${bat_level%?}` -discharging=`echo "$acpi" | grep -w 0: | grep -c Discharging` -time=`echo "$acpi" | awk '{printf $5}'` -time=${time::-3} - -if [[ $discharging -eq 0 ]] -then - notify charging > /dev/null - $eww update battery_image="images/battery_charging.png" -else - if [[ $bat_level -le 10 ]] - then - $eww update battery_image="images/battery_10.png" - notify low > /dev/null - elif [[ $bat_level -le 20 ]] - then - $eww update battery_image="images/battery_20.png" - notify mid > /dev/null - elif [[ $bat_level -le 30 ]] - then - $eww update battery_image="images/battery_30.png" - notify high > /dev/null - elif [[ $bat_level -le 40 ]] - then - $eww update battery_image="images/battery_40.png" - notify high > /dev/null - elif [[ $bat_level -le 50 ]] - then - $eww update battery_image="images/battery_50.png" - notify high > /dev/null - elif [[ $bat_level -le 60 ]] - then - $eww update battery_image="images/battery_60.png" - notify high > /dev/null - elif [[ $bat_level -le 70 ]] - then - $eww update battery_image="images/battery_70.png" - notify high > /dev/null - elif [[ $bat_level -le 80 ]] - then - $eww update battery_image="images/battery_80.png" - notify high > /dev/null - elif [[ $bat_level -le 90 ]] - then - $eww update battery_image="images/battery_90.png" - notify high > /dev/null - else - $eww update battery_image="images/battery_100.png" - notify high > /dev/null - fi; -fi; - -case $1 in - "--time") - [[ $time != "" && $time != "discharg" ]] && echo "$time" || echo "00:00" - ;; - "--percentage") - echo "$bat_level" - ;; - *) - true - ;; -esac diff --git a/.config/eww/mybar/scripts/cpu_info b/.config/eww/mybar/scripts/cpu_info deleted file mode 100644 index ef70894..0000000 --- a/.config/eww/mybar/scripts/cpu_info +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -cpu_usage=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}') - -cpu_whole=`printf ${cpu_usage%.*}` - -if [[ $cpuwhole -ge 80 ]] -then - true - #update var -elif [[ $cpuwhole -ge 70 ]] -then - true - #update var -else - true - #update var -fi; - -echo $cpu_usage - - diff --git a/.config/eww/mybar/scripts/disk_info b/.config/eww/mybar/scripts/disk_info deleted file mode 100644 index d0d39af..0000000 --- a/.config/eww/mybar/scripts/disk_info +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -raw=`df -h / | grep /dev/` - -case $1 in - "--used" ) - value=`echo $raw | awk '{printf $3}'` - ;; - "--all" ) - value=`echo $raw | awk '{printf $2}'` - ;; - "--free" ) - value=`echo $raw | awk '{printf $4}'` - ;; - * ) - true - ;; -esac -value=${value::-1} -echo $value diff --git a/.config/eww/mybar/scripts/kb_layouts b/.config/eww/mybar/scripts/kb_layouts deleted file mode 100644 index a3ae141..0000000 --- a/.config/eww/mybar/scripts/kb_layouts +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -eww="eww -c $HOME/.config/eww/mybar" -set -e - -get_kbdlayout() { - layout=$(setxkbmap -query | grep -oP 'layout:\s*\K([\w,]+)') - variant=$(setxkbmap -query | grep -oP 'variant:\s*\K(\w+)') - echo "$layout" "$variant" -} - -set_kbdlayout() { - eval "array=($1)" - setxkbmap "${array[@]}" - if [[ "${array[@]}" == "us" ]] - then - $eww update us_color="rgba(230,218,252,1)" - $eww update es_color="rgba(230,218,252,0.4)" - else - $eww update us_color="rgba(230,218,252,0.4)" - $eww update es_color="rgba(230,218,252,1)" - fi; -} - -cycle() { - current_layout=$(get_kbdlayout | xargs) - layouts=("$@" "$1") # add the first one at the end so that it cycles - index=0 - while [ "${layouts[$index]}" != "$current_layout" ] && [ $index -lt "${#layouts[@]}" ]; do index=$[index +1]; done - next_index=$[index +1] - next_layout=${layouts[$next_index]} - set_kbdlayout "$next_layout" - upper=$(echo $next_layout | tr '[:lower:]' '[:upper:]') - - pop_report -m $upper -t keyboard > /dev/null -} - - -subcommand="$1" -shift || (echo "Please specify one of: get, set , cycle ... , i3status" && exit) - -case $subcommand in - "get") - echo -n $(get_kbdlayout) - ;; - "set") - set_kbdlayout "$1" - ;; - "cycle") - cycle "$@" - ;; -esac - diff --git a/.config/eww/mybar/scripts/layout b/.config/eww/mybar/scripts/layout deleted file mode 100644 index 46ac1fb..0000000 --- a/.config/eww/mybar/scripts/layout +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -eww="eww -c $HOME/.config/eww/mybar" - -bspc subscribe desktop_focus desktop_layout | while read line; do - case `bspc query -T -d | jq -r .layout` in - tall) - echo "Tall" - ;; - tiled) - $eww update layout_button= - ;; - grid) - echo "Grid" - ;; - monocle) - $eww update layout_button= - ;; - even) - echo "Even" - ;; - *) - echo "?" - ;; -esac; -done diff --git a/.config/eww/mybar/scripts/media_control b/.config/eww/mybar/scripts/media_control deleted file mode 100644 index 7301733..0000000 --- a/.config/eww/mybar/scripts/media_control +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash - -# Selects player based on if they're playing or if they have a cover -# Note: Being played takes priority -select_player () { - playingplayer="" - coverplayer="" - totalplayer="" - for player in "$player"s - do - art=`playerctl --player="$player" metadata mpris:artUrl 2> /dev/null` - status=`playerctl --player="$player" status 2> /dev/null` - [[ $status == "Playing" ]] && playingplayer="$player" - [[ $art != "" ]] && coverplayer="$player" - [[ $status == "Playing" && $art != "" ]] && totalplayer="$player" - done; - player="" - [[ ! -z $coverplayer ]] && player=$coverplayer - [[ ! -z $playingplayer ]] && player=$playingplayer - [[ ! -z $totalplayer ]] && player=$totalplayer -} - -# Get general info -eww="eww -c $HOME/.config/eww/mybar" -players=`playerctl -l` -select_player -status=`playerctl --player="$player" status` -[[ $status == "" ]] && exit - -# Toggle play pause and update status accordingly -toggle () { - [[ $status == "Playing" ]] && $eww update media_status=""|| $eww update media_status="" - playerctl --player="$player" play-pause -} - -# Seek to an specific time -seek () { - seekt="$1" - position=`playerctl --player=$player position` - if [[ $? -eq 0 ]] && [[ `python -c "print(round(abs($seekt-$position)))"` -gt 3 ]] - then - playerctl --player=$player position $seekt - fi; -} - -# Rewind or fast forward 5 seconds -move () { - move="$1" - startpos=`playerctl --player=$player position` - length=`playerctl --player="$player" metadata mpris:length` - length=`python -c "print($length/1000000)"` - if [[ $? -eq 0 ]] - then - endpos=`python -c "print(min($length, max(0, $startpos $move)))"` - playerctl --player=$player position $endpos - fi; -} - - -case $1 in - --toggle ) - toggle - ;; - --seek ) - seek $2 - ;; - --move ) - move $2 - ;; - --next ) - playerctl --player=$player next - ;; - --prev ) - playerctl --player=$player previous - ;; -esac diff --git a/.config/eww/mybar/scripts/media_info b/.config/eww/mybar/scripts/media_info deleted file mode 100644 index ffb0194..0000000 --- a/.config/eww/mybar/scripts/media_info +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/env bash - -# Selects player based on if they're playing or if they have a cover -# Note: Being played takes priority -select_player () { - playingplayer="" - coverplayer="" - totalplayer="" - playerctl -l | while read -r player; - do - art=`playerctl --player="$player" metadata mpris:artUrl 2> /dev/null` - status=`playerctl --player="$player" status 2> /dev/null` - [[ $status == "Playing" ]] && playingplayer="$player" - [[ $art != "" ]] && coverplayer="$player" - [[ $status == "Playing" && $art != "" ]] && totalplayer="$player" - [[ ! -z $coverplayer ]] && player="$coverplayer" - [[ ! -z $playingplayer ]] && player="$playingplayer" - [[ ! -z $totalplayer ]] && player="$totalplayer" - echo "$player" - done; -} - -update_cover () { - if [[ -z $newimg ]] - then - newimg="$imgdir/music.png" - cp "$newimg" "$imgdir/currmedia.png" - echo "Image is unknown, using template" - elif [[ `echo $newimg | grep -c "file://"` -gt 0 ]] - then - cp "`echo $newimg | sed 's/file:\/\///g'`" "$imgdir/currmedia.png" - echo "Image is a file, succesfully coppied" - else - curl "$newimg" -o "$imgdir/currmedia.png" -s - echo "Image is an url, succesfully downloaded" - fi; - $eww update cover="$imgdir/currmedia.png" -} - - -imgdir="$HOME/.config/eww/mybar/images" -lastimg="none" -eww="eww -c $HOME/.config/eww/mybar" - -while true; do - if [[ ! -z `playerctl status` ]] - then - player=`select_player | tail -1` - status="" - status=`playerctl --player="$player" status` - echo "Selected $player as player" - - # Update status button - if [[ $status == "Playing" ]] - then - $eww update media_status="" - else - $eww update media_status="" - fi; - - # Update title and artist - title=`playerctl --player="$player" metadata xesam:title` - [[ -z $title ]] && title="No title" - title_parsed=`$HOME/.config/eww/mybar/scripts/parse_jp "$title"` - $eww update title="$title" - $eww update title_parsed="$title_parsed" - - artist=`playerctl --player="$player" metadata xesam:artist` - [[ -z $artist ]] && artist="No artist" - artist_parsed=`$HOME/.config/eww/mybar/scripts/parse_jp "$artist"` - $eww update artist="$artist" - $eww update artist_parsed="$artist_parsed" - - # Update length and position - position=`playerctl --player="$player" position` - [[ -z $position ]] && position=0 - $eww update position="$position" - length=`playerctl --player="$player" metadata mpris:length` - length=`python -c "print($length/1000000)"` - [[ -z $length ]] && length=100 - $eww update length="$length" - - newimg=`playerctl --player="$player" metadata mpris:artUrl 2> /dev/null\ - | sed "s/https:\/\/i.ytimg.com\/vi\//https:\/\/img.youtube.com\/vi\//g"\ - | sed "s/hq/maxres/g"` - - if [[ "$newimg" != "$lastimg" ]] - then - echo "New image $newimg detected" - lastimg=$newimg - update_cover& - fi; - else - # Update everything to default values - $eww update media_status="" - $eww update title_parsed="No title" - $eww update title="No title" - $eww update artist="No artist" - $eww update artist_parsed="No artist" - $eww update position=0 - $eww update length=100 - $eww update cover="images/music.png" - lastimg="" - fi; - sleep 1 - echo "" -done; diff --git a/.config/eww/mybar/scripts/parse_jp b/.config/eww/mybar/scripts/parse_jp deleted file mode 100644 index fede1b9..0000000 --- a/.config/eww/mybar/scripts/parse_jp +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/python3 - -import sys -# -*- coding:utf-8 -*- - -ranges = [ - {"from": ord(u"\u3300"), "to": ord(u"\u33ff")}, # compatibility ideographs - {"from": ord(u"\ufe30"), "to": ord(u"\ufe4f")}, # compatibility ideographs - {"from": ord(u"\uf900"), "to": ord(u"\ufaff")}, # compatibility ideographs - {"from": ord(u"\U0002F800"), "to": ord(u"\U0002fa1f")}, # compatibility ideographs - {'from': ord(u'\u3040'), 'to': ord(u'\u309f')}, # Japanese Hiragana - {"from": ord(u"\u30a0"), "to": ord(u"\u30ff")}, # Japanese Katakana - {"from": ord(u"\u2e80"), "to": ord(u"\u2eff")}, # cjk radicals supplement - {"from": ord(u"\u4e00"), "to": ord(u"\u9fff")}, - {"from": ord(u"\u3400"), "to": ord(u"\u4dbf")}, - {"from": ord(u"\U00020000"), "to": ord(u"\U0002a6df")}, - {"from": ord(u"\U0002a700"), "to": ord(u"\U0002b73f")}, - {"from": ord(u"\U0002b740"), "to": ord(u"\U0002b81f")}, - {"from": ord(u"\U0002b820"), "to": ord(u"\U0002ceaf")} # included as of Unicode 8.0 -] - -def is_cjk(char): - return any([range["from"] <= ord(char) <= range["to"] for range in ranges]) - -def cjk_substrings(string): - i = 0 - while i len(string): - string = string + "…" -for sub in cjk_substrings(string): - string = string.replace(sub, "" + sub + "") -print(string) - diff --git a/.config/eww/mybar/scripts/popup_calendar b/.config/eww/mybar/scripts/popup_calendar deleted file mode 100644 index 808eb69..0000000 --- a/.config/eww/mybar/scripts/popup_calendar +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -eww="eww -c $HOME/.config/eww/mybar" - -$eww close calendar || (\ - $eww update day="`scripts/time_info --day`"; \ - $eww update month="`scripts/time_info --month`"; \ - $eww update year="`scripts/time_info --year`"; \ - $eww open calendar ) diff --git a/.config/eww/mybar/scripts/popup_music b/.config/eww/mybar/scripts/popup_music deleted file mode 100644 index 909e424..0000000 --- a/.config/eww/mybar/scripts/popup_music +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -eww="eww -c $HOME/.config/eww/mybar" - -$eww close music || (\ - $eww open music ) diff --git a/.config/eww/mybar/scripts/ram_info b/.config/eww/mybar/scripts/ram_info deleted file mode 100644 index 771d1a4..0000000 --- a/.config/eww/mybar/scripts/ram_info +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -case $1 in - "--used") - free -m | grep Mem | awk '{printf $3/100}' - ;; - "--all") - free -m | grep Mem | awk '{printf $2/100}' - ;; - "--parsed") - free -h | grep Mem | awk '{printf $3 "/" $2}' - ;; - *) - true - ;; -esac diff --git a/.config/eww/mybar/scripts/temperature_info b/.config/eww/mybar/scripts/temperature_info deleted file mode 100644 index 0d6e35f..0000000 --- a/.config/eww/mybar/scripts/temperature_info +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -temp=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '[0-9]*.[0-9]*°C' -o) -temp=${temp::-4} -echo "$temp" diff --git a/.config/eww/mybar/scripts/time_info b/.config/eww/mybar/scripts/time_info deleted file mode 100644 index d97ee41..0000000 --- a/.config/eww/mybar/scripts/time_info +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -case $1 in - "--hour") - date "+%I" - ;; - "--minutes") - date "+%M" - ;; - "--type") - date "+%p" - ;; - "--date") - date "+ %a, %b %d" - ;; - "--day") - date "+%d" - ;; - "--month") - $(( `date "+%m"` -1 )) - ;; - "--year") - date "+%y" - ;; - *) - true - ;; -esac - diff --git a/.config/eww/mybar/scripts/workspaces b/.config/eww/mybar/scripts/workspaces deleted file mode 100644 index 9e3ccf6..0000000 --- a/.config/eww/mybar/scripts/workspaces +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -total=`xdotool get_num_desktops` -icon1=○ -icon2=◎ -icon3=● -eww="eww -c $HOME/.config/eww/mybar/" - -bspc subscribe desktop_focus node_add node_remove 2> /dev/null | while read line; do - currwp=$((`xdotool get_desktop`)) - for (( i = 0; i < $total; i++)); - do - if [[ $i -eq $currwp ]] - then - $eww update wp$i=$icon3 - else - [[ `bspc query -N -d $i | wc -l` -gt 0 ]] && $eww update wp$i=$icon2 || $eww update wp$i=$icon1 - fi; - done - echo cycle -done