Emacs configuration for emacs29 start

This commit is contained in:
2023-01-11 18:03:02 +09:00
parent d23eb06cb3
commit f3bd167f6c
66 changed files with 212 additions and 3793 deletions

View File

@ -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

View File

@ -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

View File

@ -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 <https://github.com/radian-software/straight.el>.
;; Bootstrap `straight.el' configuration, as described in
;; <https://github.com/radian-software/straight.el>. 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

63
.config/emacs/config.el Normal file → Executable file
View File

@ -1,51 +1,12 @@
(require 'crafted-defaults) ; Sensible Default settings for Emacs ;;; config.el -*- lexical-binding: t; -*-
(require 'crafted-updates) ; Tools to upgrade Crafted Emacs (setq user-full-name "JaeYoo-Im"
(require 'crafted-completion) ; selection framework based on 'vertico' user-mail-address "cpu3792@gmail.com")
(require 'crafted-ui) ; Better UI experience (modeline etc..)
(require 'crafted-evil) ; An 'evil-mode' configuration (add-to-list 'default-frame-alist `(font . "Fira Code Retina"))
;;(require 'custom-evil) ; An 'evil-mode' configuration (set-face-attribute 'default nil :font "Fira Code Retina" :height 12)
(require 'crafted-editing) ; Whitespace trimming, auto parens etc. (set-face-attribute 'fixed-pitch nil :font "Fira Code Retina" :height 12)
;;(require 'crafted-org) ; org-appear, clickable hyperlinks etc. (set-face-attribute 'variable-pitch nil :font "Fira Code Retina" :height 12 :weight 'regular)
(require 'custom-org) ; org-appear, clickable hyperlinks etc. (set-fontset-font t 'hangul (font-spec :family "NanumGothic" :height 12))
(require 'crafted-project)
(require 'crafted-latex) (require 'custom-ui)
(require 'custom-keybindings)
(setq-default tab-width 4)
(defvaralias 'c-basic-offset 'tab-width)
(setq default-input-method "korean-hangul")
(global-set-key (kbd "<Hangul>") '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)

84
.config/emacs/early-init.el Normal file → Executable file
View File

@ -1,63 +1,21 @@
;;; early-init.el -*- lexical-binding: t; -*- ;;; early-init.el -*- lexical-binding: t; -*-
;; garbage collection
;;; Garbage collection (setq gc-cons-threshold (* 50 1024 1024)) ;; 50MB
;; Increase the GC threshold for faster startup ;; prefers newest version of a file
;; The default is 800 kilobytes. Measured in bytes. (customize-set-variable 'load-prefer-newer t)
(setq gc-cons-threshold (* 50 1000 1000))
(setq package-enable-at-startup nil
;;; Emacs lisp source/compiled preference inhibit-startup-message t
;; Prefer loading newest compiled .el file frame-resize-pixelwise t
(customize-set-variable 'load-prefer-newer t) package-native-compile t)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(defvar crafted-config-path "~/.cache/emacs") (tooltip-mode -1)
(unless (file-exists-p crafted-config-path) (set-fringe-mode 10)
(mkdir crafted-config-path t)) (menu-bar-mode -1)
;;(blink-cursor-mode 0)
;;; Native compilation settings
(when (featurep 'native-compile) ;; initial load with blue theme
;; Silence compiler warnings as they can be pretty disruptive (load-theme 'deeper-blue)
(setq native-comp-async-report-warnings-errors nil)
(customize-set-variable 'initial-major-mode 'fundamental-mode)
;; 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)

136
.config/emacs/init.el Normal file → Executable file
View File

@ -1,69 +1,67 @@
;;; init.el -*- lexical-binding: t; -*- ;;; init.el -*- lexical-binding: t; -*-
(add-hook 'emacs-startup-hook
;; Profile emacs startup (lambda ()
(add-hook 'emacs-startup-hook (message "Crafted Emacs loaded in %s"
(lambda () (emacs-init-time))))
(message "Crafted Emacs loaded in %s."
(emacs-init-time)))) (require 'package)
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
(when (eq crafted-package-system 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(crafted-package-initialize)) (defvar bootstrap-version)
(let ((bootstrap-file
;; Add the modules folder to the load path (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(add-to-list 'load-path (expand-file-name "modules/" user-emacs-directory)) (bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
;; Set default coding system (especially for Windows) (with-current-buffer
(set-default-coding-systems 'utf-8) (url-retrieve-synchronously
(customize-set-variable 'visible-bell 1) ; turn off beeps, make them flash! "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
(customize-set-variable 'large-file-warning-threshold 100000000) ;; change to ~100 MB 'silent 'inhibit-cookies)
(goto-char (point-max))
(defun crafted-ensure-package (package &optional args) (eval-print-last-sexp)))
"Ensure that PACKAGE is installed on the system, either via (load bootstrap-file nil 'nomessage))
package.el or Guix depending on the value of (setq straight-use-package-by-default t)
`crafted-prefer-guix-packages'." (package-initialize)
(if crafted-prefer-guix-packages (unless package-archive-contents
(unless (featurep package) (package-refresh-contents))
(message "Package '%s' does not appear to be installed by Guix: " package))
(crafted-package-install-package package))) (add-to-list 'load-path (expand-file-name "modules/" user-emacs-directory))
;; Check the system used (add-hook 'before-save-hook #'whitespace-cleanup)
(defconst ON-LINUX (eq system-type 'gnu/linux))
(defconst ON-MAC (eq system-type 'darwin)) (setq-default indent-tabs-mode nil)
(defconst ON-BSD (or ON-MAC (eq system-type 'berkeley-unix))) (setq-default tab-width 4)
(defconst ON-WINDOWS (memq system-type '(cygwin windows-nt ms-dos)))
(column-number-mode)
(global-display-line-numbers-mode t)
;; Defines the user configuration var and etc folders ;; Disable line numbers for some modes
;; and ensure they exist. (dolist (mode '(org-mode-hook
(defvar crafted-config-etc-directory (expand-file-name "etc/" crafted-config-path) shell-mode-hook
"The user's configuration etc/ folder.") treemacs-mode-hook
(defvar crafted-config-var-directory (expand-file-name "var/" crafted-config-path) dired-mode-hook
"The user's configuration var/ folder.") eshell-mode-hook))
(mkdir crafted-config-etc-directory t) (add-hook mode (lambda () (display-line-numbers-mode 0))))
(mkdir crafted-config-var-directory t)
(setq backup-directory-alist `(("." . ,(expand-file-name "backups/" user-emacs-directory))))
;; Find the user configuration file (setq-default custom-file (expand-file-name ".custom.el" user-emacs-directory))
(defvar crafted-config-file (expand-file-name "config.el" "~/.config/emacs") (when (file-exists-p custom-file)
"The user's configuration file.") (load custom-file))
;; Load the user configuration file if it exists (setq delete-by-moving-to-trash t
(when (file-exists-p crafted-config-file) trash-directory "~/.local/share/Trash/files/")
(load crafted-config-file nil 'nomessage)) (setq undo-limit 100000000
auto-save-default t)
;; Make GC pauses faster by decreasing the threshold.
(setq gc-cons-threshold (* 2 1000 1000)) (set-default-coding-systems 'utf-8)
(customize-set-variable 'large-file-warning-threshold 100000000) ;; 100MB
(custom-set-variables
;; custom-set-variables was added by Custom. (defconst ON-LINUX (eq system-type 'gnu/linux))
;; If you edit it by hand, you could mess it up, so be careful. (defconst ON-MAC (eq system-type 'darwin))
;; Your init file should contain only one such instance. (defconst ON-WINDOWS (memq system-type '(cygwin windows-nt ms-dos)))
;; If there is more than one, they won't work right.
'(package-selected-packages '(auctex doom-themes))) (setq gc-cons-threshold (* 2 1024 1024)) ; decreasing the threshold to 2MB
(custom-set-faces
;; custom-set-faces was added by Custom. (defvar my-config-file (expand-file-name "config.el" user-emacs-directory))
;; If you edit it by hand, you could mess it up, so be careful. (when (file-exists-p my-config-file)
;; Your init file should contain only one such instance. (load my-config-file nil 'nomessage))
;; If there is more than one, they won't work right.
'(default ((t (:font "Fira Code 12")))) ;;(defalias 'yes-or-no-p 'y-or-n-p)
'(fixed-pitch ((t (:inherit (default))))) (global-auto-revert-mode t)
'(fixed-pitch-serif ((t (:inherit (default)))))
'(variable-pitch ((t (:font "Ubuntu Mono 12")))))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,405 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="666"
height="666"
viewBox="0 0 666.00001 666.00001"
id="svg4774"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="spacemacs-logo.svg">
<defs
id="defs4776">
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4221"
id="radialGradient4194"
cx="-177.23108"
cy="928.25415"
fx="-177.23108"
fy="928.25415"
r="28.529215"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.78891466,0.78891466,-0.76542395,0.76542395,536.60019,408.54464)" />
<linearGradient
id="linearGradient4221">
<stop
style="stop-color:#c0c0dc;stop-opacity:1"
offset="0"
id="stop4223" />
<stop
id="stop4225"
offset="0.11419532"
style="stop-color:#c0c0dd;stop-opacity:1" />
<stop
style="stop-color:#a191bf;stop-opacity:1"
offset="0.47871608"
id="stop4227" />
<stop
style="stop-color:#625681;stop-opacity:1"
offset="1"
id="stop4229" />
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
y2="951.89844"
x2="46.893108"
y1="934.5658"
x1="-0.65353984"
id="linearGradient7595"
xlink:href="#linearGradient4274"
gradientTransform="matrix(0.4887125,0,0,0.4887125,7.5674041,560.78197)" />
<linearGradient
id="linearGradient4274">
<stop
style="stop-color:#eeeeec;stop-opacity:1"
offset="0"
id="stop4276" />
<stop
id="stop4181"
offset="0.0837483"
style="stop-color:#eeeeec;stop-opacity:1" />
<stop
style="stop-color:#eeeeec;stop-opacity:1"
offset="0.3513594"
id="stop4280" />
<stop
style="stop-color:#e0d5d5;stop-opacity:1"
offset="1"
id="stop4282" />
</linearGradient>
<linearGradient
gradientTransform="matrix(0.19229712,0.06206447,-0.10031905,0.17023858,27.947597,914.55215)"
gradientUnits="userSpaceOnUse"
y2="672.25775"
x2="396.9097"
y1="608.87836"
x1="303.64438"
id="linearGradient4317"
xlink:href="#linearGradient7589" />
<linearGradient
id="linearGradient7589">
<stop
style="stop-color:#351347;stop-opacity:1"
offset="0"
id="stop7591" />
<stop
style="stop-color:#5c3566;stop-opacity:0;"
offset="1"
id="stop7593" />
</linearGradient>
<linearGradient
gradientTransform="matrix(0.07485012,0.08932098,-0.08626544,0.06221301,53.22269,961.64413)"
gradientUnits="userSpaceOnUse"
y2="364.66345"
x2="377.03168"
y1="425.15848"
x1="306.88434"
id="linearGradient4301"
xlink:href="#linearGradient4311" />
<linearGradient
id="linearGradient4311">
<stop
id="stop4313"
offset="0"
style="stop-color:#351e47;stop-opacity:1" />
<stop
id="stop4315"
offset="1"
style="stop-color:#5c3566;stop-opacity:0;" />
</linearGradient>
<linearGradient
gradientTransform="matrix(0.15153279,0.0143268,-0.0143268,0.15153279,-12.641966,950.28506)"
gradientUnits="userSpaceOnUse"
y2="429.49622"
x2="329.16669"
y1="527.33502"
x1="267.65439"
id="linearGradient4230"
xlink:href="#linearGradient4274" />
<linearGradient
gradientTransform="matrix(-0.13467,0.03941451,0.04093431,0.13986281,58.64004,937.70038)"
gradientUnits="userSpaceOnUse"
y2="465.96136"
x2="190.84904"
y1="511.44083"
x1="308.41003"
id="linearGradient5577"
xlink:href="#linearGradient4196" />
<linearGradient
id="linearGradient4196">
<stop
id="stop4198"
offset="0"
style="stop-color:#ffffff;stop-opacity:1" />
<stop
style="stop-color:#fffff2;stop-opacity:1"
offset="0.11419532"
id="stop4200" />
<stop
id="stop4202"
offset="0.47871608"
style="stop-color:#d2acd2;stop-opacity:1" />
<stop
id="stop4204"
offset="1"
style="stop-color:#123069;stop-opacity:1" />
</linearGradient>
<radialGradient
gradientTransform="matrix(0.3389967,0.21474015,-0.19688621,0.26982602,-1209.2255,-630.6322)"
gradientUnits="userSpaceOnUse"
r="169"
fy="472.51749"
fx="322.17105"
cy="472.51749"
cx="322.17105"
id="radialGradient5136-0-6-65"
xlink:href="#linearGradient6003" />
<linearGradient
id="linearGradient6003">
<stop
style="stop-color:#c2c6db;stop-opacity:1"
offset="0"
id="stop6005" />
<stop
id="stop6007"
offset="0.33969504"
style="stop-color:#bab1e0;stop-opacity:1" />
<stop
id="stop6009"
offset="0.44414869"
style="stop-color:#8d77a3;stop-opacity:1" />
<stop
style="stop-color:#675a84;stop-opacity:1"
offset="0.55217898"
id="stop6011" />
<stop
style="stop-color:#050846;stop-opacity:1"
offset="1"
id="stop6013" />
</linearGradient>
<radialGradient
gradientTransform="matrix(0.19025707,0.10471339,-0.11049955,0.13157478,-966.76195,-798.66855)"
gradientUnits="userSpaceOnUse"
r="169"
fy="472.51749"
fx="322.17105"
cy="472.51749"
cx="322.17105"
id="radialGradient5136-0-6-6-8-3-1"
xlink:href="#linearGradient6003" />
<radialGradient
gradientTransform="matrix(0.1361054,0.07855904,-0.0790488,0.09871133,-780.58233,-1164.6467)"
gradientUnits="userSpaceOnUse"
r="169"
fy="472.51749"
fx="322.17105"
cy="472.51749"
cx="322.17105"
id="radialGradient5136-0-6-6-8-8-8"
xlink:href="#linearGradient6003" />
<radialGradient
gradientTransform="matrix(0.18445402,0.09675949,-0.10712923,0.12158052,-859.37376,-1098.3051)"
gradientUnits="userSpaceOnUse"
r="169"
fy="472.51749"
fx="322.17105"
cy="472.51749"
cx="322.17105"
id="radialGradient5136-0-6-6-8-6"
xlink:href="#linearGradient6003" />
<radialGradient
gradientTransform="matrix(0.33582312,0.20512484,-0.19504306,0.25774431,-945.14244,-758.65362)"
gradientUnits="userSpaceOnUse"
r="169"
fy="472.51749"
fx="322.17105"
cy="472.51749"
cx="322.17105"
id="radialGradient5136-0-6-6-2"
xlink:href="#linearGradient6003" />
<radialGradient
gradientTransform="matrix(0.35330232,0.22380216,-0.20519478,0.28121264,-702.27629,-398.30317)"
gradientUnits="userSpaceOnUse"
r="169"
fy="472.51749"
fx="322.17105"
cy="472.51749"
cx="322.17105"
id="radialGradient5136-0-6-65-3"
xlink:href="#linearGradient6003" />
<radialGradient
gradientTransform="matrix(0.19828589,0.10913228,-0.11516262,0.13712722,-658.03031,-481.71303)"
gradientUnits="userSpaceOnUse"
r="169"
fy="472.51749"
fx="322.17105"
cy="472.51749"
cx="322.17105"
id="radialGradient5136-0-6-6-8-3-1-9"
xlink:href="#linearGradient6003" />
<radialGradient
gradientTransform="matrix(0.14184903,0.08187422,-0.08238465,0.10287694,-643.98232,-766.01725)"
gradientUnits="userSpaceOnUse"
r="169"
fy="472.51749"
fx="322.17105"
cy="472.51749"
cx="322.17105"
id="radialGradient5136-0-6-6-8-8-8-5"
xlink:href="#linearGradient6003" />
<radialGradient
gradientTransform="matrix(0.34999481,0.21378108,-0.20327385,0.26862109,-680.60673,-453.66251)"
gradientUnits="userSpaceOnUse"
r="169"
fy="472.51749"
fx="322.17105"
cy="472.51749"
cx="322.17105"
id="radialGradient5136-0-6-6-2-1"
xlink:href="#linearGradient6003" />
<radialGradient
gradientTransform="matrix(0.19223796,0.10084273,-0.11165007,0.1267112,-724.74062,-701.33347)"
gradientUnits="userSpaceOnUse"
r="169"
fy="472.51749"
fx="322.17105"
cy="472.51749"
cx="322.17105"
id="radialGradient5136-0-6-6-8-6-9"
xlink:href="#linearGradient6003" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="395.86046"
inkscape:cy="245.84063"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1055"
inkscape:window-x="1366"
inkscape:window-y="25"
inkscape:window-maximized="1" />
<metadata
id="metadata4779">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="spacemacs"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-386.36216)"
style="display:inline">
<g
style="display:inline"
transform="matrix(12.9592,4.5120702,-4.5120702,12.9592,4535.5464,-12837.419)"
id="g5039">
<circle
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#radialGradient4194);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path4186"
cx="-306.25821"
cy="988.6507"
r="23.139797"
transform="matrix(0.9443945,-0.32881459,0.32881459,0.9443945,0,0)" />
<path
id="path5256-9"
d="m 41.74716,1025.8039 c 14.519162,9.8452 9.408594,4.9185 10.261109,11.0962 -0.08117,0.1465 -0.169388,0.2875 -0.264301,0.4231 -0.01249,-0.014 -0.02419,-0.026 -0.03724,-0.04 -0.01001,-0.012 -0.02174,-0.019 -0.03214,-0.029 0.0196,-0.032 0.04012,-0.064 0.05853,-0.097 -1.225557,-5.0729 2.687143,-1.119 -11.156663,-10.2157 -9.051772,-5.9479 -16.352144,-7.226 -22.551938,-7.4019 -3.488421,-0.099 -5.913923,0.8728 -6.987909,2.7989 -1.3411642,2.4179 -0.912655,3.8155 1.994536,8.2521 -0.0911,0.3259 -0.03315,0.4943 -0.142124,0.8727 -3.8516196,-5.3869 -5.0172816,-9.7976 -3.4468002,-12.6716 0.9933212,-1.8068 2.7093882,-2.6025 5.6926712,-2.7563 9.218032,-0.2063 20.202074,5.5056 26.612289,9.7685 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient7595);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.37715784;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccsccccccc" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.8;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4317);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.21200001;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 14.9959,1029.2143 c -0.236814,-0.2856 -0.559796,-0.7803 -0.485872,-0.7807 0.200566,-9e-4 9.60872,5.7454 9.929692,5.9329 4.225002,4.0646 7.676291,7.8951 11.373035,12.2304 2.765649,3.2702 7.591378,9.0843 9.008973,9.9815 0.05917,0.037 0.112444,0.068 0.159687,0.093 -2.111114,0.1893 -14.247147,-3.1483 -14.247147,-3.1483 -3.97823,-8.2435 -8.504661,-15.1572 -15.738368,-24.3079 z"
id="path4234"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
<path
id="path6025-8"
d="m 39.507014,1015.4943 c 0.260338,0.1601 1.278904,1.4959 1.492115,1.6461 0.54521,0.3837 0.645075,0.4736 1.558512,0.91 2.376613,1.136 6.504302,2.7191 6.504302,2.7191 0,0 2.630753,0.9003 3.272047,1.1112 -1.710157,-0.9453 -3.398419,-2.6104 -5.93676,-4.0182 -2.624957,-0.3799 -5.293181,-1.7482 -6.889784,-2.3741 -5.36e-4,0 0.0042,0.023 -5.36e-4,0 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.8;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4301);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.21200001;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
inkscape:connector-curvature="0" />
<path
id="path6023"
d="m 36.623604,1014.7016 c 0.193864,-0.019 2.509837,1.1588 3.410083,1.7391 1.57816,1.0174 2.284312,1.6826 3.530043,3.325 3.241178,4.2734 5.638326,7.8421 8.059968,11.9988 1.214933,2.0854 3.422302,5.8712 3.79561,6.6117 0.04828,0.1012 0.06496,0.2398 0.07289,0.2669 -0.04815,-0.025 -0.17197,-0.083 -0.695631,-0.2973 -1.535379,-0.6247 -4.40422,-1.3616 -7.138474,-1.8334 -3.411804,-0.5887 -6.703011,-0.9628 -13.982957,-1.5894 -6.645099,-0.572 -9.719985,-0.8756 -12.163077,-1.2004 l -2.240265,-0.286 -2.354121,-2.612 c -1.46418,-1.4526 -2.668967,-2.6643 -2.677396,-2.6931 -0.0084,-0.028 0.332869,0.131 0.758726,0.3553 4.75579,2.5049 13.315388,3.3027 21.66368,2.0192 2.970312,-0.4566 6.368994,-1.6365 7.501263,-2.2622 0.21761,-0.12 0.380508,-0.2142 0.464537,-0.2839 0.0016,-2e-4 0.005,9e-4 0.0069,9e-4 0.0013,-0.093 -0.01124,-0.1899 -0.01912,-0.267 -0.351615,-3.4272 -3.893164,-9.3454 -7.415017,-12.3909 -0.341761,-0.2955 -0.607302,-0.5635 -0.589853,-0.5953 0.0016,0 0.0061,0 0.01225,0 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4230);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.21200001;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
inkscape:connector-curvature="0" />
<path
id="path6025"
d="m 36.461108,1014.6646 c 0.191656,-0.016 3.77684,0.9616 4.167363,1.319 0.998651,0.9137 1.69043,1.7046 2.940028,3.3953 4.362718,5.9461 8.135752,12.2745 11.646698,18.748 -2.436785,-3.3659 -6.107216,-6.7129 -10.58113,-10.1675 -7.7e-5,-0.021 10e-4,-0.075 -0.0016,-0.1149 -0.383095,-3.505 -3.995976,-9.3221 -7.512388,-12.4697 -0.341235,-0.3054 -0.687815,-0.6718 -0.670879,-0.7042 0.0015,0 0.0059,0 0.012,0 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient5577);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.21200001;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
inkscape:connector-curvature="0" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer9"
inkscape:label="craters"
style="display:inline;opacity:0.48800001"
sodipodi:insensitive="true">
<ellipse
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.24500002;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#radialGradient5136-0-6-65-3);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.21200001;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path5113-4-3"
cx="-674.75861"
cy="-183.95151"
rx="33.302528"
ry="31.029184"
transform="matrix(-0.46577522,-0.88490307,0.94940297,0.3140605,0,0)" />
<ellipse
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.24500002;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#radialGradient5136-0-6-6-2-1);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.21200001;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path5113-4-3-7"
cx="-653.35913"
cy="-248.91931"
rx="32.990776"
ry="29.639826"
transform="matrix(-0.79746875,-0.60336025,0.73432765,-0.67879518,0,0)" />
<ellipse
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.24500002;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#radialGradient5136-0-6-6-8-6-9);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.21200001;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path5113-4-3-7-3"
cx="-709.77368"
cy="-604.74725"
rx="18.120491"
ry="13.981397"
transform="matrix(-0.99991572,0.01298277,0.35376623,-0.93533387,0,0)" />
<ellipse
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.24500002;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#radialGradient5136-0-6-6-8-3-1-9);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.21200001;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path5113-4-3-7-3-1"
cx="-642.59436"
cy="-377.19153"
rx="18.690575"
ry="15.130705"
transform="matrix(-0.82870289,-0.55968877,0.78595684,-0.61828136,0,0)" />
<ellipse
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.24500002;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#radialGradient5136-0-6-6-8-8-8-5);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.21200001;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path5113-4-3-7-3-0"
cx="-632.93744"
cy="-687.5965"
rx="13.370796"
ry="11.351508"
transform="matrix(-0.99900978,0.04449109,0.3468689,-0.93791362,0,0)" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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 "<left>") 'crafted-evil/discourage-arrow-keys)
(define-key evil-normal-state-map (kbd "<right>") 'crafted-evil/discourage-arrow-keys)
(define-key evil-normal-state-map (kbd "<down>") 'crafted-evil/discourage-arrow-keys)
(define-key evil-normal-state-map (kbd "<up>") 'crafted-evil/discourage-arrow-keys)
(evil-global-set-key 'motion (kbd "<left>") 'crafted-evil/discourage-arrow-keys)
(evil-global-set-key 'motion (kbd "<right>") 'crafted-evil/discourage-arrow-keys)
(evil-global-set-key 'motion (kbd "<down>") 'crafted-evil/discourage-arrow-keys)
(evil-global-set-key 'motion (kbd "<up>") '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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -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;
}

View File

@ -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))

View File

@ -1,2 +0,0 @@
#!/bin/sh
printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}')

View File

@ -1,2 +0,0 @@
#!/bin/sh
amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%' | head -1

View File

@ -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;
}

View File

@ -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 "<span font-weight=\"heavy\">${hour}</span><span font-weight=\"heavy\">:${minutes}</span><span font-size=\"xx-small\">${type}</span>" )
(revealer
:reveal date_reveal
:transition "slideright"
:duration "350ms"
:valign "fill"
(label
:valign "fill"
:class "date"
:markup "<span font-size=\"xx-small\">${date}</span>"
))))))
(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")
))))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@ -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 = " "

View File

@ -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 "<span style=\"font-family: CartographCF;\">Charging</span><font size=\"-1\"> ﮣ</font>$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

View File

@ -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

View File

@ -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

View File

@ -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 <layout>, cycle <layout1> <layout2> ... <layoutN>, i3status" && exit)
case $subcommand in
"get")
echo -n $(get_kbdlayout)
;;
"set")
set_kbdlayout "$1"
;;
"cycle")
cycle "$@"
;;
esac

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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):
if is_cjk(string[i]):
start = i
try:
while is_cjk(string[i]): i += 1
yield string[start:i]
except:
yield string[start:i]
i += 1
ogstring = str(sys.argv[1])
string = ogstring[0:20]
if len(ogstring) > len(string):
string = string + "…"
for sub in cjk_substrings(string):
string = string.replace(sub, "<span font-family= \"M PLUS 1\" font-size=\"x-small\" rise=\"3pt\" font-weight=\"bold\">" + sub + "</span>")
print(string)

View File

@ -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 )

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
eww="eww -c $HOME/.config/eww/mybar"
$eww close music || (\
$eww open music )

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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