From 5cfa457ce66444d3dd3961ad83f2072aa0704831 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Mon, 28 Aug 2023 15:31:02 -0700 Subject: [PATCH] Initial commit 1. Transfer doomemacs config from common 2. Transfer rustfmt from common --- .gitignore | 13 + README.org | 93 +++++ alacritty/alacritty.yml | 2 + doom/.gitignore | 4 + doom/banner.txt | 16 + doom/config.org | 721 +++++++++++++++++++++++++++++++++ doom/init.el | 194 +++++++++ eww/bar/eww.scss | 167 ++++++++ eww/bar/eww.yuck | 180 ++++++++ eww/bar/scripts/get-volume.sh | 3 + eww/bar/scripts/get-workspaces | 86 ++++ eww/bar/scripts/workspace.sh | 4 + hypr/.gitignore | 1 + hypr/fonts.py | 18 + hypr/hyprland.conf | 201 +++++++++ hypr/hyprpaper.conf | 10 + hypr/wallpaper.sh | 3 + mpd/.gitignore | 3 + mpd/mpd.conf | 10 + rustfmt/rustfmt.toml | 1 + swaylock/config | 27 ++ waybar/config | 177 ++++++++ waybar/style.css | 236 +++++++++++ wofi/config | 1 + wofi/style.css | 56 +++ 25 files changed, 2227 insertions(+) create mode 100644 .gitignore create mode 100644 README.org create mode 100644 alacritty/alacritty.yml create mode 100644 doom/.gitignore create mode 100644 doom/banner.txt create mode 100644 doom/config.org create mode 100644 doom/init.el create mode 100644 eww/bar/eww.scss create mode 100644 eww/bar/eww.yuck create mode 100755 eww/bar/scripts/get-volume.sh create mode 100755 eww/bar/scripts/get-workspaces create mode 100755 eww/bar/scripts/workspace.sh create mode 100644 hypr/.gitignore create mode 100644 hypr/fonts.py create mode 100644 hypr/hyprland.conf create mode 100644 hypr/hyprpaper.conf create mode 100755 hypr/wallpaper.sh create mode 100644 mpd/.gitignore create mode 100644 mpd/mpd.conf create mode 120000 rustfmt/rustfmt.toml create mode 100644 swaylock/config create mode 100644 waybar/config create mode 100644 waybar/style.css create mode 100644 wofi/config create mode 100644 wofi/style.css diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..013cae7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +.* +!.gitignore + +# Programs that keep binary data in .config need to be excluded +borg +gimp + +# Programs which require machine-specific data or cache in their rc files +gwenviewrc +katerc +spectaclerc +trashrc +vlcrc diff --git a/README.org b/README.org new file mode 100644 index 0000000..72d763d --- /dev/null +++ b/README.org @@ -0,0 +1,93 @@ +#+title: Desktop Environment for Mellite + +* Installation + +Install all the packages listed below. Then, +#+begin_src +cd ~/.config +git init +git remote add origin $SOURCE +git pull origin main +#+end_src + +* Login Manager + +- ~sddm~: Enable ~sddm.service~ + + A note about themes: The themes must be placed in ~/usr/share/sddm/themes~. + Then in ~/etc/sddm.conf~, enable the relevant theme. By default the breeze + theme comes with ~plasma-workspace~ which is very bloated to install, so + consider some of the alternative themes. + +* Fonts + +- ~otf-font-awesome~: Needed for ~waybar~ to render icons +- Noto Sans/Serif: System font + +* Hyprland + +Note: Setup does not work with NVIDIA GPU without some tweaks. + +- [[https://wiki.archlinux.org/title/wayland][wayland]]: display manager: ~wayland~, ~xorg-xwayland~ +- [[https://wiki.archlinux.org/title/Hyprland][hyprland]]: window manager +- ~waybar~: Status bar, use ~waybar-hyprland-git~ AUR repo to enable clicking! +- ~eww-wayland~: Another status bar, requires ~socat~ to listen for hyprland events. + + Until [[https://github.com/elkowar/eww/issues/111][tray support]] has been added to ~eww~ in a stable manner, tray will be handled with waybar. +- ~hyprpaper~: Wallpaper engine + + The command to set a wallpaper: + ~hyprctl hyprpaper wallpaper "$DISPLAY,$FILE"~ +- [[https://github.com/Horus645/swww][swww]]: Alternate wallpaper engine + + Note that ~~/.config/hypr/wallpapers~ must have jpeg files ~{1..8}.jpg~. A + handy command can be used crop and resize images: + #+begin_src bash +convert $IN \ + -resize 3840x2160^ \ + -gravity center \ + -extent 3840x2160 \ + $OUT + #+end_src +- ~swaync~: Notification server + +The command for changing keyboard layouts is handled by ~fcitx5~. + +* Utilities + +- ~alacritty~: terminal emulator + + Note that in order to set this as the default terminal, you may need to put + the following in ~~/.config/kdeglobals~: + #+begin_src + [General] + TerminalApplication + #+end_src +- ~wofi~: finding programs, drop in replacement for ~rofi~ +- ~grimblast~: Screenshot engine +- ~dolphin~: File explorer +- ~swaylock-effects~: A simple lockscreen +- ~mpd~: Music player daemon + #+begin_src sh +systemctl enable --user mpd +systemctl start --user mpd + #+end_src + Optionally, install ~mpc~ +- ~cantata~: Controls mpd (other clients are acceptable too) +- ~wl-clipboard~: Provides copying +- ~btop~/~htop~: Process monitor +- ~blueman~: Bluetooth connector + +** Configuration + +- ~lxappearance~: Used to configure GTK3 themes +- ~nwg-look~: Configures cursor + +** Diagnostics + +- ~wev~: Wayland event interceptor useful for determining keybinds +- ~neofetch~: Screenfetch +- ~macchina~ (aur): Another screenfetch + +* Troubleshooting + diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml new file mode 100644 index 0000000..caa81f2 --- /dev/null +++ b/alacritty/alacritty.yml @@ -0,0 +1,2 @@ +font: + size: 14 diff --git a/doom/.gitignore b/doom/.gitignore new file mode 100644 index 0000000..09158e0 --- /dev/null +++ b/doom/.gitignore @@ -0,0 +1,4 @@ +config.el +packages.el +# auto generated env vars +custom.el diff --git a/doom/banner.txt b/doom/banner.txt new file mode 100644 index 0000000..51e43a4 --- /dev/null +++ b/doom/banner.txt @@ -0,0 +1,16 @@ +⠀⠀⠀⠀⠂⠀⠀⠀⠂⠐⠀⡞⢡⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢂⠐ +⠀⠀⠀⠀⠁⠀⠀⠀⠀⢀⣼⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠋⠈ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⡇⢤⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠟⠁⢀⠀ +⠠⠀⠀⠀⠀⠀⠀⠀⣼⣿⠌⠀⠉⠹⡀⠀⠀⠄⠠⠀⣠⣾⣟⠡⠄⠀⠀⠀ +⠐⠀⠀⠀⠀⠀⠀⢰⣿⡿⠀⠀⠀⣠⠎⠈⠉⠙⢕⠺⣿⠟⠁⠀⠑⢎⠀⠀ +⠀⠀⠀⠀⠀⠀⡠⠋⠘⠃⢀⡶⠊⠀⠀⠀⠀⠀⠀⠱⡀⠑⢄⠀⢠⡄⠃⠀ +⠀⠀⠀⠀⠀⡜⠁⠀⠀⠀⠌⠀⠀⠀⢠⡆⠀⠀⠀⠀⢱⡀⠀⠣⣤⠇⠀⠀ +⠀⠀⠀⠀⡘⠀⠀⠀⠀⡜⠀⠀⠀⢠⣁⣇⢰⠀⠀⠀⣸⣡⠀⠀⣵⣀⠀⠀ +⠀⠀⠀⠀⡇⠀⠀⡠⠊⠃⠀⠀⢠⠃⠀⢠⠈⠀⠀⠀⠆⠀⠆⠘⢿⣿⠀⠀ +⠀⠀⠀⠀⣇⡄⠪⠄⠐⡆⠀⢠⢃⣀⣀⣘⠇⠀⠀⡜⣠⣤⣼⡀⢠⢫⢆⠀ +⠀⠀⠀⠀⢰⠀⠀⠀⡄⠹⡀⡿⠋⣿⣿⣽⠁⡠⠺⠘⣿⡿⠈⠇⡘⠣⢈⣢ +⠀⠀⠀⠀⢀⡄⠀⠀⡇⠀⠱⠸⡈⢇⡠⠹⠊⠀⠀⠀⠧⠆⣸⠘⠃⠀⣀⡀ +⠀⠀⠀⠀⡌⢀⠀⠀⢁⠀⠀⢠⣱⡔⠀⠀⠀⠀⠀⠀⠀⠀⢾⠀⠁⠀⠿⠃ +⠀⠀⢀⡜⠄⡆⠀⢀⠘⡤⠀⠀⡆⠁⠀⠀⠀⠀⠐⠀⠀⡠⠃⠀⡀⠀⠀⠀ +⠀⠀⠀⠀⠀⢃⠀⠘⢂⢀⣇⠀⣇⠀⠳⣦⠤⠄⡤⠐⠹⢇⠀⠀⡇⠀⠀⠀ +⠀⠀⠀⠀⠀⠘⠤⢇⡔⠻⣿⣆⣯⡢⣀⢸⢿⣶⡁⠀⠀⠀⠆⢸⠁⠀⠀⠀ diff --git a/doom/config.org b/doom/config.org new file mode 100644 index 0000000..965d894 --- /dev/null +++ b/doom/config.org @@ -0,0 +1,721 @@ +#+TITLE: Doom Emacs Configuration File + +* Installation + +Execute ~doom sync~ after modifying this file to tangle it to ~config.el~. + +Dependencies: +- Doom Emacs: ~git~ ~ripgrep~, ~fd-find~ +- ~lilypond-mode~: ~LilyPond~ +- ~:app everywhere~: ~xwininfo~, ~xdotool~, ~xclip~, ~xprop~ +- Font: Source Code Pro +Individual packages may have other optional dependencies. Execute ~doom doctor~ to find out. + +The following block of comments is from the default configuration. + +#+begin_src emacs-lisp +;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- + +;; Place your private configuration here! Remember, you do not need to run 'doom +;; sync' after modifying this file! + +;; Whenever you reconfigure a package, make sure to wrap your config in an +;; `after!' block, otherwise Doom's defaults may override your settings. E.g. +;; +;; (after! PACKAGE +;; (setq x y)) +;; +;; The exceptions to this rule: +;; +;; - Setting file/directory variables (like `org-directory') +;; - Setting variables which explicitly tell you to set them before their +;; package is loaded (see 'C-h v VARIABLE' to look up their documentation). +;; - Setting doom variables (which start with 'doom-' or '+'). +;; +;; Here are some additional functions/macros that will help you configure Doom. +;; +;; - `load!' for loading external *.el files relative to this one +;; - `use-package!' for configuring packages +;; - `after!' for running code after a package has loaded +;; - `add-load-path!' for adding directories to the `load-path', relative to +;; this file. Emacs searches the `load-path' when you load packages with +;; `require' or `use-package'. +;; - `map!' for binding new keys +;; +;; To get information about any of these functions/macros, move the cursor over +;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). +;; This will open documentation for it, including demos of how they are used. +;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces, +;; etc). +;; +;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how +;; they are implemented. +#+end_src + +These packages are loaded into ~packages.el~. The following comments are provided by default. + +#+begin_src emacs-lisp :tangle packages.el +;; -*- no-byte-compile: t; -*- +;;; $DOOMDIR/packages.el + +;; To install a package with Doom you must declare them here and run 'doom sync' +;; on the command line, then restart Emacs for the changes to take effect -- or +;; use 'M-x doom/reload'. + + +;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: +;(package! some-package) + +;; To install a package directly from a remote git repo, you must specify a +;; `:recipe'. You'll find documentation on what `:recipe' accepts here: +;; https://github.com/radian-software/straight.el#the-recipe-format +;(package! another-package +; :recipe (:host github :repo "username/repo")) + +;; If the package you are trying to install does not contain a PACKAGENAME.el +;; file, or is located in a subdirectory of the repo, you'll need to specify +;; `:files' in the `:recipe': +;(package! this-package +; :recipe (:host github :repo "username/repo" +; :files ("some-file.el" "src/lisp/*.el"))) + +;; If you'd like to disable a package included with Doom, you can do so here +;; with the `:disable' property: +;(package! builtin-package :disable t) + +;; You can override the recipe of a built in package without having to specify +;; all the properties for `:recipe'. These will inherit the rest of its recipe +;; from Doom or MELPA/ELPA/Emacsmirror: +;(package! builtin-package :recipe (:nonrecursive t)) +;(package! builtin-package-2 :recipe (:repo "myfork/package")) + +;; Specify a `:branch' to install a package from a particular branch or tag. +;; This is required for some packages whose default branch isn't 'master' (which +;; our package manager can't deal with; see radian-software/straight.el#279) +;(package! builtin-package :recipe (:branch "develop")) + +;; Use `:pin' to specify a particular commit to install. +;(package! builtin-package :pin "1a2b3c4d5e") + + +;; Doom's packages are pinned to a specific commit and updated from release to +;; release. The `unpin!' macro allows you to unpin single packages... +;(unpin! pinned-package) +;; ...or multiple packages +;(unpin! pinned-package another-pinned-package) +;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) +;(unpin! t) +#+end_src + + +* User specific settings + +Some functionality uses this to identify you, e.g. GPG configuration, email +clients, file templates and snippets. It is optional. This could be changed to +rely on system environment variables. + +#+begin_src emacs-lisp +(setq + user-full-name "Leni Ven" + user-mail-address "leniv@stanford.edu") +#+end_src + +If you use ~org~ and don't want your org files in the default location below, +change ~org-directory~. It must be set before org loads! + +#+begin_src emacs-lisp +(setq org-directory "~/org/") +#+end_src + +* Interface + +** Key Bindings + +Modifications to the default key bindings to mimic spacemacs + +- ~SPC SPC~ is mapped to ~M-x~ (~#'execute-extended-command~) +- ~SPC !~ is mapped to ~M-!~ (~#'shell-command~) +- ~SPC :~ is mapped to ~M-:~ (~#'eval-expression~) +- ~,~ is mapped to the local (major mode) leader ~,~ +- ~SPC b 0~ deletes the current buffer and window like Spacemacs ~SPC b x~ + +#+begin_src emacs-lisp +(setq doom-localleader-key ",") +(map! :leader + :desc "Execute shell command" + "!" #'shell-command) +(map! :leader + :desc "Execute extended command (emacs M-x)" + "SPC" #'execute-extended-command) +(map! :leader + :desc "Evaluate expression (emacs M-:)" + ":" #'eval-expression) +(map! :leader + :desc "Kill buffer and window" + "b 0" #'kill-buffer-and-window) +(map! :leader + (:prefix ("S" . "Set") + :desc "Input method" "i" #'set-input-method + )) +(map! :nvi "C" nil) ; remove this one weird binding + +(map! "" #'toggle-input-method) +#+end_src + +** Font settings + +Doom exposes five (optional) variables for controlling fonts in Doom: + +- ~doom-font~ -- the primary font to use +- ~doom-variable-pitch-font~ -- a non-monospace font (where applicable) +- ~doom-big-font~ -- used for ~doom-big-font-mode~; use this for + presentations or streaming. +- ~doom-unicode-font~ -- for unicode glyphs +- ~doom-serif-font~ -- for the ~fixed-pitch-serif~ face + +See ~C-h v doom-font~ for documentation and more examples of what they +accept. + +If you or Emacs can't find your font, use ~M-x describe-font~ to look them up, +~M-x eval-region~ to execute ELisp code, and ~M-x doom/reload-font~ to refresh +your font settings. If Emacs still can't find your font, it likely wasn't +installed correctly. Font issues are rarely Doom issues! + +There are two ways to load a theme. Both assume the theme is installed and +available. You can either set ~doom-theme~ or manually load a theme with the +~load-theme~ function. + +#+begin_src emacs-lisp +(setq + default-font "Source Code Pro" + default-font-size 14.0 + doom-font (font-spec + :family default-font + :size default-font-size + :weight 'semi-light) + doom-variable-pitch-font (font-spec + :family default-font + :size (+ default-font-size 1.0)) + doom-unicode-font (font-spec + :family default-font + :size default-font-size) + doom-theme 'doom-lantern) +(add-to-list 'default-frame-alist '(alpha . 90)) +#+end_src + +** Splash Screen + +#+begin_src emacs-lisp +(defun custom/doom-banner () + (let* ( + (banner (with-temp-buffer + (insert-file-contents "~/.config/doom/banner.txt") + (split-string (buffer-string) "\n" t))) + (longest-line (apply #'max (mapcar #'length banner))) + ) + (put-text-property + (point) + (dolist (line banner (point)) + (insert + (+doom-dashboard--center + +doom-dashboard--width + (concat line (make-string (max 0 (- longest-line (length line))) 32))) + "\n")) + 'face 'doom-dashboard-banner))) +(setq +doom-dashboard-ascii-banner-fn #'custom/doom-banner) +(set-face-font 'doom-dashboard-banner (font-spec :family "Source Code Pro" :foundry "ADBO")) +#+end_src + +** Line numbers + +This determines the style of line numbers in effect. If set to ~nil~, line +numbers are disabled. For relative line numbers, set this to ~relative~. + +#+begin_src emacs-lisp +(setq display-line-numbers-type 'relative) +#+end_src + +** Indentation Style Hooks + +#+begin_src emacs-lisp +(defun custom/common-program-hook () + (setq + whitespace-style '(face spaces tabs newline trailing space-mark tab-mark newline-mark) + whitespace-line-column 80) + (display-line-numbers-mode) + (display-fill-column-indicator-mode) + (setq + indent-tabs-mode t + indent-line-function 'tab-to-tab-stop + tab-width 3 + standard-indent 3) + (indent-tabs-mode) + (smart-tabs-mode-enable) +) +(defun custom/common-richtext-hook () + (setq whitespace-style '(face spaces tabs newline trailing space-mark tab-mark newline-mark)) + (setq whitespace-line-column nil) + (display-line-numbers-mode) +) + +(add-hook 'text-mode-hook #'custom/common-richtext-hook) +#+end_src + +* Package-specific Settings + +** Editor + +*** Smart Tabs + +#+begin_src emacs-lisp :tangle packages.el +(package! smart-tabs-mode) +#+end_src + +#+begin_src emacs-lisp +(use-package! smart-tabs-mode + :config + (print! "Configuring smart-tabs-mode") + (smart-tabs-insinuate + 'c 'c++ + 'java + 'javascript)) +(setq-default + indent-tabs-mode t + indent-line-function 'tab-to-tab-stop + tab-width 3 + standard-indent 3) +#+end_src + +*** Whitespace mode + +#+begin_src emacs-lisp :tangle packages.el +(package! whitespace) +#+end_src + +#+begin_src emacs-lisp +(use-package! whitespace + :config + (setq + whitespace-style '(face tabs tab-mark spaces space-mark trailing newline newline-mark) + whitespace-line-column 80 + whitespace-display-mappings + '( + (space-mark 32 [183] [46]) ; 32 SPACE 「 」, 183 MIDDLE DOT 「·」, 46 FULL STOP 「.」 + (newline-mark 10 [172 10]) ; 10 LINE FEED, 172 Not Sign「¬」 + (tab-mark 9 [10141 9] [92 9]) ; 9 TAB, 10141 Triangle-headed rightwards arrow 「➝」 + )) + (global-whitespace-mode +1) + ) +#+end_src + +*** Format + +Note that ~onsave~ was intentionally turned off because it messes with version control systems. + +#+begin_src emacs-lisp +(after! format + (print! "Configuring (after! format ...)") + '(not + emacs-lisp-mode + sql-mode ; Broken + ;; tex related modes are broken + tex-mode + latex-mode + bibtex-mode + )) +#+end_src + +*** Spell + +#+begin_src emacs-lisp +(after! flyspell + (print! "Configuring (after! flyspell ...)") + (setq flyspell-default-dictionary "english")) +#+end_src + +** Languages + +*** Emacs Lisp + +#+begin_src emacs-lisp +(defun custom/lisp-family-hook () + (setq + indent-line-function 'tab-to-tab-stop + tab-width 3 + standard-indent 3) + (indent-tabs-mode) + (display-line-numbers-mode) + ) +(add-hook 'lisp-mode-hook #'custom/lisp-family-hook) +(add-hook 'lisp-data-mode-hook #'custom/lisp-family-hook) +(add-hook 'emacs-lisp-mode-hook #'custom/lisp-family-hook) +#+end_src + +*** Epub + +#+begin_src emacs-lisp :tangle packages.el +(package! nov) +#+end_src + +#+begin_src emacs-lisp +(add-hook 'nov-mode-hook (lambda () + (setq nov-text-width t) + (visual-line-mode))) +#+end_src + +*** Org + +Rather than using a common prefix ~, i~ like Spacemacs to consolidate all +insertion operations, we put them in different categories. Some keybindings are +removed. + +#+begin_src emacs-lisp +(map! :after org + :localleader + :map org-mode-map + :desc "LaTeX Preview" "X" #'org-latex-preview + ;; Remove some clutter + "h" nil + "n" nil + "i" nil + "@" nil + "q" nil + "o" nil + "I" nil ; 'org-id-get-create' + "A" nil ; 'org-archive-subtree' + (:prefix ("b". "table") + :desc "Edit formulae" "F" #'org-table-edit-formulas + :desc "Eval formula" "f" #'org-table-eval-formula + (:prefix ("m" . "move") + :desc "Move row up" "K" #'org-table-move-row-up + :desc "Move row down" "J" #'org-table-move-row-down + :desc "Move column left" "H" #'org-table-move-column-left + :desc "Move column right" "L" #'org-table-move-column-right + :desc "Move cell up" "k" #'org-table-move-cell-up + :desc "Move cell down" "j" #'org-table-move-cell-down + :desc "Move cell left" "h" #'org-table-move-cell-left + :desc "Move cell right" "l" #'org-table-move-cell-right + ) + ) + (:prefix ("h" . "headings") + :desc "Consult heading" "." #'consult-org-heading + :desc "Insert heading" "h" #'org-insert-heading + :desc "Insert todo heading" "t" #'org-insert-todo-heading + :desc "Insert subheading" "i" #'org-insert-subheading + :desc "Insert todo subheading" "t" #'org-insert-todo-subheading + :desc "Previous visible heading" "[" #'org-previous-visible-heading + :desc "Next visible heading" "]" #'org-next-visible-heading + ) + (:prefix ("o" . "tags/properties") + :desc "Set tags command" "t" #'org-set-tags-command + :desc "Set property" "s" #'org-set-property + :desc "Delete property" "d" #'org-delete-property + :desc "Property action" "a" #'org-property-action + ) + (:prefix ("i" . "insert") + :desc "Item" "i" #'org-toggle-item + :desc "Citation" "c" #'org-cite-insert + :desc "Footnote" "f" #'org-footnote-new + :desc "Id" "I" #'org-id-get-create + ) + (:prefix ("l" . "links") + ;; Description update + :desc "Insert/Modify Link" "l" #'org-insert-link + ) + ) +#+end_src + +*** LaTeX + +The target indentation style of ~LaTeX~ is as follows: + +#+begin_src tex :tangle no +\section{A section} +% No indent here + +\begin{enumerate}[1.] +\item Some item 1. Note that item is not indented. + + Item 1 continued. 1 level of indentation. +\item + \begin{tikzpicture}[ + xscale=2,yscale=3 + ] + \node[dot] (x) at (0,0); + \node[dot] (y) at (0,1); + \draw (x) -- (y) + \node[midway,fill=white] {$f$}; + \end{tikzpicture} +\end{enumerate} +#+end_src + +For some reason the keymap binding has to use ~LaTeX-mode-map~ or ~TeX-mode-map~ +instead of ~latex-mode-map~. Also some original keybindings are removed so they +can be displayed correctly in prompts. See e.g. ~tex-buf.el~ for an example. + +When unbinding these keys, use ~:g~ flag to ensure no extraneous keys are +introduced. + +#+begin_src emacs-lisp +(after! latex + (print! "Configuring (after! latex ...)") + (add-hook 'tex-mode-hook #'custom/common-program-hook) + (add-hook 'LaTeX-mode-hook #'custom/common-program-hook) + (setq-default TeX-electric-sub-and-superscript nil) + ;(local-unset-key "C-c C-l") + ;(local-unset-key "C-c `") + ) +(map! :after latex + :localleader + :map TeX-mode-map + :desc "View Compilation Log" "l" #'TeX-recenter-output-buffer + :desc "Next Error" "e" #'TeX-next-error + :desc "Close Environment" "]" #'LaTeX-close-environment + (:prefix ("f" . "Fold") + :desc "Fold Mode" "f" #'TeX-fold-mode + :desc "Environment" "e" #'TeX-fold-env + :desc "Buffer" "b" #'TeX-fold-buffer + :desc "Region" "r" #'TeX-fold-region + :desc "Paragraph" "p" #'TeX-fold-paragraph + :desc "Dwim" "d" #'TeX-fold-dwim) + ) +(map! :after latex + :map TeX-mode-map + :g "C-c C-l" nil + :g "C-c `" nil + ) +#+end_src + +*** Lean 3 + +#+begin_src emacs-lisp +(add-hook! lean-mode + (activate-input-method 'Lean) + (if (not indent-tabs-mode) + (indent-tabs-mode)) + ) +(map! :after lean-mode + :localleader + :map lean-mode-map + :desc "Show symbol keystrokes" "k" #'quail-show-key + ) +(map! :after lean-mode + :map TeX-mode-map + :g "C-c C-k" nil + :g "C-c C-r" nil + :g "C-c C-s" nil + :g "C-c C-g" nil + :g "C-c SPC" nil + ) +#+end_src + +*** Lean 4 + +Lean 4 is still volatile and under construction. + +#+begin_src emacs-lisp :tangle packages.el +(package! lean4-mode :recipe ( + :host github + :repo "leanprover/lean4-mode" + :files ("*.el" "data"))) +#+end_src + +#+begin_src emacs-lisp +(add-hook 'lean4-mode-hook (lambda () + (setq tab-width 2))) +(map! :after lean4-mode + :localleader + :map lean4-mode-map + :desc "Execute" "R" #'lean4-execute + :desc "Execute in standalone" "r" #'lean4-std-exe + :desc "Toggle info buffer" "t" #'lean4-toggle-info + (:prefix ("e" . "Error") + :desc "Previous error" "p" #'flycheck-previous-error + :desc "Next error" "n" #'flycheck-next-error + :desc "List error" "l" #'flycheck-list-errors + ) + :desc "Lake build" "b" #'lean4-lake-build + (:prefix ("p" . "leanpkg") + :desc "Test" "t" #'lean4-leanpkg-test + :desc "Build" "b" #'lean4-leanpkg-build + :desc "Configure" "c" #'lean4-leanpkg-configure + ) + ) +#+end_src + +*** LilyPond + +Add the necessary hooks for LilyPond mode. + +#+begin_src emacs-lisp +(use-package! lilypond-mode + :mode ("\\.ly\\'" . LilyPond-mode) + :after-call LilyPond-mode + :config + (add-hook 'LilyPond-mode-hook #'custom/common-program-hook)) +(map! :after lilypond-mode + :localleader + :map LilyPond-mode-map + :desc "Info" "I" #'LilyPond-info + :desc "Info Index Search" "i" #'LilyPond-info-index-search + :desc "Comment/Uncomment" ";" #'LilyPond-comment-region + :desc "What beat" "b" #'LilyPond-what-beat + :desc "Play midi" "m" #'LilyPond-command-current-midi + :desc "Quick insert mode" "q" #'LilyPond-quick-insert-mode + :desc "Insert tag current" "t" #'LilyPond-insert-tag-current + (:prefix ("c" . "command") + :desc "Buffer" "b" #'LilyPond-command-buffer + :desc "Master" "r" #'LilyPond-command-master + :desc "LilyPond" "l" #'LilyPond-command-lilypond + :desc "Format ps" "p" #'LilyPond-command-formatps + :desc "Format midi" "m" #'LilyPond-command-formatmidi + :desc "Kill jobs" "k" #'LilyPond-kill-jobs + ) + ) +#+end_src + +*** Rust + +#+begin_src emacs-lisp +(after! rustic + (setq rustic-indent-offset standard-indent)) +#+end_src + +** Tools + +*** Language Server Protocol (LSP) + +File path is removed from breadcrumb since it is provided by ~doom-modeline~ and +since it clutters the header-line. + +#+begin_src emacs-lisp +(setq-hook! lsp-mode + lsp-headerline-breadcrumb-enable t + lsp-headerline-breadcrumb-enable-symbol-numbers nil + lsp-headerline-breadcrumb-segments '(symbols) +) +#+end_src + +*** Magit + +#+begin_src emacs-lisp +(map! :after magit + :localleader + :map git-commit-mode-map + :desc "Finish" "c" #'with-editor-finish + :desc "Cancel" "q" #'with-editor-cancel + ) +#+end_src + +*** Emacs IPython Notebook (ein) + +Adapted from [[https://gist.github.com/millejoh/8632402a11384a3a0949fa350a1a271b]] + +Usage: Since ~ein:notebooklist-mode~, ~ein:markdown-mode~, and +~ein:traceback-mode~ are major modes, their hotkeys are triggered by the local +leader ~,~ / ~SPC m~. However the ~ein:notebook-mode~ and +~ein:notebook-multilang-mode~ are minor modes and they are triggered by ~C-c~ +instead of ~,~. + +FIXME: Cleanup ~ein:markdown-mode-map~. + +#+begin_src emacs-lisp +(defun custom/ein:worksheet-merge-cell-next () + (interactive) + (ein:worksheet-merge-cell-km (ein:worksheet--get-ws-or-error) (ein:worksheet-get-current-cell) t t)) +(map! :after ein + ;:localleader + :map ein:notebooklist-mode-map ; Major mode + "" nil + :desc "Describe mode" "h" #'describe-mode + :desc "Reload" "r" #'ein:notebooklist-reload + :desc "File open" "o" #'ein:file-open + :desc "Open" "O" #'ein:notebook-open + :desc "Prev item" "[" #'ein:notebooklist-prev-item + :desc "Next item" "]" #'ein:notebooklist-next-item + :desc "New notebook" "n" #'ein:notebooklist-new-notebook + :desc "New notebook with name" "N" #'ein:notebooklist-new-notebook-with-name +) +(map! :after ein + :localleader + :map ein:markdown-mode-map ; Major mode + :desc "Up" "K" #'ein:markdown-move-up + :desc "Down" "J" #'ein:markdown-move-down + :desc "Promote" "H" #'ein:markdown-move-up + :desc "Demote" "L" #'ein:markdown-move-down + :desc "Do" "e" #'ein:markdown-do + :desc "Cycle" "c" #'ein:markdown-cycle +) +(map! :after ein + :map ein:notebook-mode-map ; Minor mode + :prefix "C-c" + "" nil ; Remove all keys + ;; Python + :desc "Jump back" "," #'ein-pytools-jump-back-command + :desc "Jump to source" "." #'ein-pytools-jump-to-source-command + ;; Cell + :desc "Copy cell" "y" #'ein:worksheet-copy-cell-km + :desc "Yank cell" "p" #'ein:worksheet-yank-cell-km + :desc "kill cell" "d" #'ein:worksheet-kill-cell-km + :desc "Insert below" "i" #'ein:worksheet-insert-cell-below-km + :desc "Insert above" "I" #'ein:worksheet-insert-cell-above-km + :desc "Goto next input" "j" #'ein:worksheet-goto-next-input-km + :desc "Goto prev input" "k" #'ein:worksheet-goto-prev-input-km + :desc "Move cell down" "J" #'ein:worksheet-move-cell-down-km + :desc "Move cell up" "K" #'ein:worksheet-move-cell-up-km + :desc "Change cell type" "u" #'ein:worksheet-change-cell-type-km + :desc "Toggle cell type" "t" #'ein:worksheet-toggle-cell-type-km + :desc "Merge cell" "m" #'ein:worksheet-merge-cell-km + :desc "Merge cell next" "M" #'custom/ein:worksheet-merge-cell-next + :desc "Split cell" "s" #'ein:worksheet-split-cell-at-point-km + :desc "Execute cell and goto next" "RET" #'ein:worksheet-execute-cell-and-goto-next-km + ;; Notebook + :desc "Move prev" "H" #'ein:notebook-worksheet-move-prev + :desc "Move next" "L" #'ein:notebook-worksheet-move-next + (:prefix ("o" . "Output") + :desc "Toggle output" "t" #'ein:worksheet-toggle-output-km + :desc "Show traceback" "T" #'ein:tb-show-km + :desc "Clear output" "c" #'ein:worksheet-clear-output + :desc "Clear all output" "C" #'ein:worksheet-clear-all-output + :desc "Set output visibility" "v" #'ein:worksheet-set-output-visibility-all-km + :desc "Show code cell" "s" #'ein:shared-output-show-code-cell-at-point-km + ) + (:prefix ("e" . "Execute") + :desc "All cells" "a" #'ein:worksheet-execute-all-cells + :desc "All cells above" "K" #'ein:worksheet-execute-all-cells-above + :desc "All cells below" "J" #'ein:worksheet-execute-all-cells-below + :desc "Cell and go to next" "RET" #'ein:worksheet-execute-cell-and-goto-next-km + :desc "Cell and insert below" "j" #'ein:worksheet-execute-cell-and-insert-below-km + ) + (:prefix ("f" . "File") + :desc "Open console" "c" #'ein:console-open + :desc "Open prev or last" "h" #'ein:notebook-worksheet-open-prev-or-last + :desc "Open next or first" "l" #'ein:notebook-worksheet-open-next-or-first + :desc "Insert next" "n" #'ein:notebook-worksheet-insert-next + :desc "Open 1" "1" #'ein:notebook-worksheet-open-1th + :desc "Open 2" "2" #'ein:notebook-worksheet-open-2th + :desc "Open 3" "3" #'ein:notebook-worksheet-open-3th + :desc "Open 4" "4" #'ein:notebook-worksheet-open-4th + :desc "Open 5" "5" #'ein:notebook-worksheet-open-5th + :desc "Open 6" "6" #'ein:notebook-worksheet-open-5th + :desc "Open 7" "7" #'ein:notebook-worksheet-open-7th + :desc "Open 8" "8" #'ein:notebook-worksheet-open-8th + :desc "Open last" "9" #'ein:notebook-worksheet-open-last + :desc "Close notebook" "x" #'ein:notebook-close + :desc "Save notebook" "s" #'ein:notebook-save-notebook-command + :desc "Rename sheet" "R" #'ein:worksheet-rename-sheet + :desc "Rename notebook" "C-r" #'ein:notebook-rename-command + :desc "Worksheet Delete" "d" #'ein:notebook-worksheet-delete + ) +) +(map! :after ein-multilang + :map ein:notebook-multilang-mode-map ; Minor mode + :prefix "C-c" + :desc "Execute cell" "RET" #'ein:worksheet-execute-cell + :desc "Execute cell and goto next" "" #'ein:worksheet-execute-cell-and-goto-next + :desc "Goto next input" "gj" 'ein:worksheet-goto-next-input + :desc "Goto prev input" "gk" 'ein:worksheet-goto-prev-input + :desc "Move cell down" "M-j" 'ein:worksheet-move-cell-down + :desc "Move cell up" "M-k" 'ein:worksheet-move-cell-up +) +#+end_src diff --git a/doom/init.el b/doom/init.el new file mode 100644 index 0000000..93760fe --- /dev/null +++ b/doom/init.el @@ -0,0 +1,194 @@ +;;; init.el -*- lexical-binding: t; -*- + +;; This file controls what Doom modules are enabled and what order they load +;; in. Remember to run 'doom sync' after modifying it! + +;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's +;; documentation. There you'll find a link to Doom's Module Index where all +;; of our modules are listed, including what flags they support. + +;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or +;; 'C-c c k' for non-vim users) to view its documentation. This works on +;; flags as well (those symbols that start with a plus). +;; +;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its +;; directory (for easy access to its source code). + +(doom! :input + ;;bidi ; (tfel ot) thgir etirw uoy gnipleh + ;;chinese + japanese + ;;layout ; auie,ctsrnm is the superior home row + + :completion + company ; the ultimate code completion backend + ;;helm ; the *other* search engine for love and life + ;;ido ; the other *other* search engine... + ivy ; a search engine for love and life + vertico ; the search engine of the future + + :ui + deft ; notational velocity for Emacs + doom ; what makes DOOM look the way it does + doom-dashboard ; a nifty splash screen for Emacs + ;;doom-quit ; DOOM quit-message prompts when you quit Emacs + (emoji +unicode) ; 🙂 + hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + ;;hydra + indent-guides ; highlighted indent columns + ligatures ; ligatures and symbols to make your code pretty again + minimap ; show a map of the code on the side + modeline ; snazzy, Atom-inspired modeline, plus API + nav-flash ; blink cursor line after big motions + ;;neotree ; a project drawer, like NERDTree for vim + ophints ; highlight the region an operation acts on + (popup +defaults) ; tame sudden yet inevitable temporary windows + tabs ; a tab bar for Emacs + treemacs ; a project drawer, like neotree but cooler + unicode ; extended unicode support for various languages + (vc-gutter +pretty) ; vcs diff in the fringe + vi-tilde-fringe ; fringe tildes to mark beyond EOB + window-select ; visually switch windows + workspaces ; tab emulation, persistence & separate workspaces + ;;zen ; distraction-free coding or writing + + :editor + (evil +everywhere); come to the dark side, we have cookies + file-templates ; auto-snippets for empty files + fold ; (nigh) universal code folding + format ; automated prettiness + ;;god ; run Emacs commands without modifier keys + ;;lispy ; vim for lisp, for people who don't like vim + multiple-cursors ; editing in many places at once + ;;objed ; text object editing for the innocent + ;;parinfer ; turn lisp into python, sort of + ;;rotate-text ; cycle region at point between text candidates + snippets ; my elves. They type so I don't have to + ;;word-wrap ; soft wrapping with language-aware indent + + :emacs + dired ; making dired pretty [functional] + electric ; smarter, keyword-based electric-indent + ;;ibuffer ; interactive buffer management + undo ; persistent, smarter undo for your inevitable mistakes + vc ; version-control and Emacs, sitting in a tree + + :term + eshell ; the elisp shell that works everywhere + ;;shell ; simple shell REPL for Emacs + ;;term ; basic terminal emulator for Emacs + vterm ; the best terminal emulation in Emacs + + :checkers + syntax ; tasing you for every semicolon you forget + (spell +flyspell) ; tasing you for misspelling mispelling + ;;grammar ; tasing grammar mistake every you make + + :tools + ;;ansible + ;;biblio ; Writes a PhD for you (citation needed) + debugger ; FIXME stepping through code, to help you add bugs + direnv + docker + editorconfig ; let someone else argue about tabs vs spaces + ein ; tame Jupyter notebooks with emacs + (eval +overlay) ; run code, run (also, repls) + ;;gist ; interacting with github gists + lookup ; navigate your code and its documentation + (lsp +peek) ; M-x vscode + magit ; a git porcelain for Emacs + make ; run make tasks from Emacs + pass ; password manager for nerds + pdf ; pdf enhancements + ;;prodigy ; FIXME managing external services & code builders + rgb ; creating color strings + taskrunner ; taskrunner for all your projects + ;;terraform ; infrastructure as code + tmux ; an API for interacting with tmux + tree-sitter ; syntax and parsing, sitting in a tree... + upload ; map local to remote projects via ssh/ftp + + :os + (:if IS-MAC macos) ; improve compatibility with macOS + tty ; improve the terminal Emacs experience + + :lang + ;;agda ; types of types of types of types... + ;;beancount ; mind the GAAP + (cc +lsp) ; C > C++ == 1 + ;;clojure ; java with a lisp + ;;common-lisp ; if you've seen one lisp, you've seen them all + coq ; proofs-as-programs + ;;crystal ; ruby at the speed of c + ;;csharp ; unity, .NET, and mono shenanigans + data ; config/data formats + ;;(dart +flutter) ; paint ui and not much else + ;;dhall + ;;elixir ; erlang done right + ;;elm ; care for a cup of TEA? + emacs-lisp ; drown in parentheses + ;;erlang ; an elegant language for a more civilized age + ;;ess ; emacs speaks statistics + ;;factor + ;;faust ; dsp, but you get to keep your soul + ;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER) + ;;fsharp ; ML stands for Microsoft's Language + ;;fstar ; (dependent) types and (monadic) effects and Z3 + ;;gdscript ; the language you waited for + ;;(go +lsp) ; the hipster dialect + ;;(graphql +lsp) ; Give queries a REST + ;;(haskell +lsp) ; a language that's lazier than I am + ;;hy ; readability of scheme w/ speed of python + ;;idris ; a language you can depend on + json ; At least it ain't XML + ;;(java +lsp) ; the poster child for carpal tunnel syndrome + ;;javascript ; all(hope(abandon(ye(who(enter(here)))))) + ;;julia ; a better, faster MATLAB + ;;kotlin ; a better, slicker Java(Script) + (latex +latexmk +lsp) ; writing papers in Emacs has never been so fun + lean ; for folks with too much to prove + ledger ; be audit you can be + ;;lua ; one-based indices? one-based indices + markdown ; writing docs for people to ignore + ;;nim ; python + lisp at the speed of c + nix ; I hereby declare "nix geht mehr!" + ;;ocaml ; an objective camel + org ; organize your plain life in plain text + ;;php ; perl's insecure younger brother + ;;plantuml ; diagrams for confusing people more + ;;purescript ; javascript, but functional + python ; beautiful is better than ugly + ;;qt ; the 'cutest' gui framework ever + ;;racket ; a DSL for DSLs + ;;raku ; the artist formerly known as perl6 + ;;rest ; Emacs as a REST client + ;;rst ; ReST in peace + ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + (rust +lsp +tree-sitter) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + ;;scala ; java, but good + ;;(scheme +guile) ; a fully conniving family of lisps + sh ; she sells {ba,z,fi}sh shells on the C xor + ;;sml + ;;solidity ; do you need a blockchain? No. + ;;swift ; who asked for emoji variables? + ;;terra ; Earth and Moon in alignment for performance. + web ; the tubes + yaml ; JSON, but readable + ;;zig ; C, but simpler + + :email + ;;(mu4e +org +gmail) + ;;notmuch + ;;(wanderlust +gmail) + + :app + calendar + emms + everywhere ; *leave* Emacs!? You must be joking + ;;irc ; how neckbeards socialize + ;;(rss +org) ; emacs as an RSS reader + ;;twitter ; twitter client https://twitter.com/vnought + + :config + literate + (default +bindings +smartparens)) diff --git a/eww/bar/eww.scss b/eww/bar/eww.scss new file mode 100644 index 0000000..53d49a1 --- /dev/null +++ b/eww/bar/eww.scss @@ -0,0 +1,167 @@ +$window: #eeeeee; +$window_border: rgba(200, 200, 200, 0.7); + +$workspace_inactive: rgba(100, 114, 125, 0.6); +$workspace_inactive_bg: transparent; +$workspace_active: rgba(180, 190, 200, 0.9); +$workspace_active_bg: transparent; +$workspace_focused: rgba(220, 230, 230, 0.9); +$workspace_focused_bg: rgba(100, 114, 125, 0.5); +$workspace_hover: #2E5DFF; + +$widget_bg: rgba(40, 40, 40, 0.5); +$weather: rgba(180, 220, 235, 0.8); +$weather_end: rgba(171, 233, 179, 0.8); +$clock: rgba(171, 233, 179, 1.0); + +$media: rgba(224, 232, 224, 0.7); + +$tray_background: rgba(204, 204, 204, 0.1); +$tray: #c9cbff; +$keyboard: #f2cdcd; +$language: #e8a2af; +$idle_inhibitor: #f28fad; +$audio: #fae3b0; +$backlight: #f8bd96; +$bluetooth: #caa9c7; +$network: #bd93f9; +$cpu: #96cdfb; +$memory: #88bbeb; +$temperature: #ddb6f2; +$temperature_critical: #ff6666; +$battery: #b6b2b3; + + +* { all: unset; } + +.bar { + //background-color: transparent; + margin-left: 5px; + font-size: 15px; + font-family: monospace; +} + +.icon { + font-size: 20px; +} + +.launcher { + font-size: 40px; + margin: -7px -5px 15px -5px; +} + +box .workspaces { + border-radius: 10px; + button { + font-size: 30px; + padding-left: 2px; + margin: -5px -5px -5px -5px; + border-radius: 2px; + } + button:hover { + color: $workspace_hover; + } + .focused { + color: $workspace_focused; + background-color: $workspace_focused_bg; + } + .active { + color: $workspace_active; + background-color: $workspace_active_bg; + } + .inactive { + color: $workspace_inactive; + background-color: $workspace_inactive_bg; + } +} + +box .weather { + color: $weather; + margin-left: 2px; + //margin-right: -1px; + + background-color: $widget_bg; + border-radius: 5; + + .temperature { + color: mix($weather_end, $weather, 0%); + .feelsLike { + font-style: italic; + } + } + .uvIndex { + color: mix($weather_end, $weather, 20%); + } + .humidity { + color: mix($weather_end, $weather, 40%); + } + .precip { + color: mix($weather_end, $weather, 60%); + } + .wind { + color: mix($weather_end, $weather, 80%); + } + .cloud { + color: mix($weather_end, $weather, 100%); + } +} +box .clock { + background-color: $widget_bg; + border-radius: 5; + color: $clock; + margin-bottom: 30px; + padding: 2pt 2pt 2pt 2pt; +} + +.media { + font-family: "Noto Serif"; + padding-left: 5px; + padding-right: 5px; + color: $media; + border: none; +} + +.status { + font-family: monospace; +} + +// Styles on classes (see eww.yuck for more information) + +.status 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; +} diff --git a/eww/bar/eww.yuck b/eww/bar/eww.yuck new file mode 100644 index 0000000..cb76b6d --- /dev/null +++ b/eww/bar/eww.yuck @@ -0,0 +1,180 @@ +(defvar eww "eww --config $HOME/.config/eww/bar") + +(defwindow bar + :exclusive true + :monitor 0 + :windowtype "dock" + :geometry (geometry + :x "0%" + :y "0%" + :width "20px" + :height "100%" + :anchor "center left" + ) + :reserve (struts :side "left" :distance "20px") + (widget_bar)) +(defwidget widget_bar [] + (centerbox :orientation "v" + (box :orientation "v" :space-evenly false :valign "start" + (box :class "launcher" :valign "start" "☯") + (widget_workspaces) + ) + (widget_weather :orientation "v") + (widget_clock) + ;(media) + ;(widget_status) + )) + +(defwidget widget_weather [orientation] + (box + :class "weather" + :orientation orientation + :space-evenly false + :valign "start" + :halign "center" + :spacing 10 + ;(box :class "moon" :orientation "v" moon) ; Not very stable + (box :class "temperature" :orientation orientation + (box :class "icon" "") + "${weather.current_condition[0].temp_C}" + (box :class "feelsLike" "${weather.current_condition[0].FeelsLikeC}") + ) + (box :class "uvIndex" :orientation orientation + (box :class "icon" "") + "${weather.current_condition[0].uvIndex}") + (box :class "humidity" :orientation orientation + (box :class "icon" "") + "${weather.current_condition[0].humidity}" + ) + (box :class "precip" :orientation orientation + (box :class "icon" "") + "${weather.current_condition[0].precipMM}" + ) + (box :class "wind" :orientation orientation + (box :class "icon" "") + "${weather.current_condition[0].windspeedKmph}" + "${weather.current_condition[0].winddir16Point}" + ) + (box :class "cloud" :orientation orientation + (box :class "icon" "") + "${weather.current_condition[0].cloudcover}" + ) + )) + +(defpoll moon :initial "" :interval "180s" + "curl wttr.in/?format=%m") +(defpoll weather :initial "{\"current_condition\": [{\"cloudcover\": \"\"}]}" :interval "180s" + "curl wttr.in/?format=j1") + +(defwidget widget_workspaces [] + (box + :class "workspaces" + :orientation "v" + :space-evenly true + :valign "start" :spacing 10 + :halign "center" + (for workspace in workspaces + (button + :class "${workspace.class}" + :onclick "scripts/workspace.sh ${workspace.id}" + "${workspace.text}")) + )) +(deflisten workspaces :initial "[]" + "scripts/get-workspaces") + + +(defwidget widget_clock [] + (box + :class "clock" + :orientation "v" + :valign "end" + :spacing 1 + (box :class "icon" "") + "${clock.H}" "${clock.M}" + (box :class "icon" "") + "${clock.m}" "${clock.d}" + )) + +(defpoll clock :initial "{}" :interval "10s" + "date '+{\"H\":\"%H\", \"M\":\"%M\", \"d\":\"%d\", \"m\":\"%m\", \"b\":\"%b\", \"Y\":\"%Y\"}'") + + + +; Calendar + +(defwindow calendar + :geometry (geometry :x "70px" + :y "65%" + :width "270px" + :height "60px") +(cal)) + + +(defwidget cal [] + (box :class "cal" + :orientation "v" + (box :class "cal-inner-box" + (calendar :class "cal" + :day calendar_day + :month calendar_month + :year calendar_year)))) +(defpoll calendar_day :interval "10h" + "date '+%d'") +(defpoll calendar_month :interval "10h" + "scripts/calendar") +(defpoll calendar_year :interval "10h" + "date '+%Y'") + +; Unused widgets + +(defwidget widget_status [] + (box + :class "status" + :orientation "v" + :space-evenly false + :valign "end" + (metric :label "" + :value volume + :onchange "amixer -D pulse sset Master {}%") + (metric :label "" + :value {EWW_RAM.used_mem_perc} + :onchange "") + (widget_clock))) + + +(defwidget widget_media [] + (box :class "media" + :orientation "v" + :space-evenly false + :valign "center" + {music_listener != "" ? "『${music_listener}』" : ""} + (box :class "music_status" + :orientation "h" + :space-evenly false + :halign "center" + {music_listener != "" ? "${music_status_listener}" : ""}) + )) + +(deflisten music_listener :initial "" + "playerctl --follow metadata --format '{{ artist }} / {{album}} / {{ title }}' || true") +(deflisten music_status_listener :initial "" + "playerctl --follow metadata --format '{{duration(position)}}/{{duration(mpris:length)}}' || true") + + +(defwidget metric [label value onchange] + (box + :orientation "v" + :class "metric" + :space-evenly false + (box :class "label" label) + (circular-progress :value value) + ;(scale + ; :min 0 :max 101 + ; :active {onchange != ""} + ; :orientation "v" + ; :value value + ; :onchange onchange) + )) + +(defpoll volume :initial 0 :interval "1s" + "scripts/get-volume.sh") diff --git a/eww/bar/scripts/get-volume.sh b/eww/bar/scripts/get-volume.sh new file mode 100755 index 0000000..a868b03 --- /dev/null +++ b/eww/bar/scripts/get-volume.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%' | head -1 diff --git a/eww/bar/scripts/get-workspaces b/eww/bar/scripts/get-workspaces new file mode 100755 index 0000000..c5b2d3c --- /dev/null +++ b/eww/bar/scripts/get-workspaces @@ -0,0 +1,86 @@ +#!/usr/bin/env python + +""" +Utility to generate the workspace buttons for eww bar widget. + +Currently it fetches information from monitor 0. If all monitors have +synchronised workspaces this should not be a problem. +""" +import os, sys, socket, json + +WORKSPACE_ICONS = [ + (1, '☱'), + (2, '☲'), + (3, '☳'), + (4, '☴'), + (5, '☵'), + (6, '☶'), + (7, '☷'), + (8, '☰'), +] +EXTRA_WORKSPACE_ICONS = [ + (0, '⚌'), + (1, '⚍'), + (2, '⚎'), + (3, '⚏'), +] + +def get_workspace_info(): + + workspaces = json.loads(os.popen('hyprctl workspaces -j').read()) + monitors = json.loads(os.popen('hyprctl monitors -j').read()) + if not monitors: + print("No monitor found!", file=sys.stderr) + return [] + + monitor, active = [(m['name'], m['activeWorkspace']['id']) + for m in monitors if m['id'] == 0][0] + workspaces = [(w['id'], w['id'] == active) + for w in workspaces + if w['monitor'] == monitor] + return workspaces + + +def get_widgets(): + # get all workspace keys + workspaces = {k: v for k, v in get_workspace_info()} + def get_class(k): + key = workspaces.get(k, None) + if key is None: + return 'inactive' + elif key: + return 'focused' + else: + return 'active' + + buttons = [ + f'"id": "{k}", "text": "{icon}", "class": "{get_class(k)}"' + for k, icon in WORKSPACE_ICONS + ] + buttons = ', '.join(['{' + b + '}' for b in buttons]) + return '[' + buttons + ']' + + +def listen(): + sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + KEY = 'HYPRLAND_INSTANCE_SIGNATURE' + signature = os.environ.get(KEY, None) + if signature is None: + print("Hyprland variable uninitialised.", file=sys.stderr) + return + server_address = f"/tmp/hypr/{signature}/.socket2.sock" + try: + sock.connect(server_address) + except: + print(f"Could not connect to {server_address}", file=sys.stderr) + raise + + # The flush here is very important since python by default buffers! + print(get_widgets(), flush=True) + while sock: + data = sock.recv(1024) + if b'workspace' in data: + print(get_widgets(), flush=True) + + +listen() diff --git a/eww/bar/scripts/workspace.sh b/eww/bar/scripts/workspace.sh new file mode 100755 index 0000000..1cc571b --- /dev/null +++ b/eww/bar/scripts/workspace.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +hyprctl dispatch workspace $1 +~/.config/hypr/wallpaper.sh $1 diff --git a/hypr/.gitignore b/hypr/.gitignore new file mode 100644 index 0000000..f2b9e24 --- /dev/null +++ b/hypr/.gitignore @@ -0,0 +1 @@ +wallpapers diff --git a/hypr/fonts.py b/hypr/fonts.py new file mode 100644 index 0000000..f8cef40 --- /dev/null +++ b/hypr/fonts.py @@ -0,0 +1,18 @@ +import gi +gi.require_version("Gtk", "3.0") +from gi.repository import Gtk + + +class Example(Gtk.Window): + """Using Pango to get system fonts names""" + + def list_system_fonts(self): + """Yield system fonts families names using Pango""" + context = self.create_pango_context() + for fam in context.list_families(): + yield fam.get_name() + + +a = Example() +system_fonts = list(a.list_system_fonts()) +print(system_fonts) diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf new file mode 100644 index 0000000..ad7c0b5 --- /dev/null +++ b/hypr/hyprland.conf @@ -0,0 +1,201 @@ +# Please note not all available settings / options are set here. +# For a full list, see the wiki +# + +autogenerated = 0 + +# See https://wiki.hyprland.org/Configuring/Monitors/ +monitor=,preferred,auto,auto + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more + +# waybar is executed after eww to have the intersection effect at top left +exec-once = hyprpaper & swaync & fcitx5 & eww --config ~/.config/eww/bar open bar & waybar + +# Source a file (multi-file configs) +# source = ~/.config/hypr/myColors.conf + +# Some default env vars. +env = XCURSOR_SIZE,24 + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = us + kb_variant = + kb_model = + kb_options = + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = no + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 5 + gaps_out = 15 + border_size = 2 + col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + col.inactive_border = rgba(595959aa) + + layout = dwindle +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 10 + blur = yes + blur_size = 3 + blur_passes = 1 + blur_new_optimizations = on + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) + + active_opacity = 0.95 + inactive_opacity = 0.7 +} + +animations { + enabled = yes + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default, slidevert +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true +} + +gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = off +} + +input { + kb_layout = us +} + +# Dropped in favour of fcitx5 +#input { +# kb_layout = us,ca,jp +# kb_options = grp:toggle +#} + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + +$mainMod = SUPER + +bind = $mainMod, Q, killactive, +bind = $mainMod, M, exit, +bind = $mainMod, V, togglefloating, +bind = $mainMod, B, pin, +bind = $mainMod, F, fullscreen +bind = $mainMod, P, pseudo, +bind = $mainMod, slash, togglesplit, +bind = $mainMod, G, togglegroup, +bind = $mainMod, comma, changegroupactive, b +bind = $mainMod, period, changegroupactive, f + +bind = $mainMod, T, exec, alacritty +bind = $mainMod, L, exec, swaylock -C ~/.config/swaylock/config +bind = $mainMod, N, exec, swaync-client -t +bind = $mainMod, space, exec, wofi --show drun -I -G + +# Dropped in favour of fcitx5 +#bind = $mainMod, X, exec, hyprctl switchxkblayout wooting-wootingtwo next + +# code:107 = PrintSc +bind = $mainMod, code:107, exec, grimblast copy screen +bind = $mainMod SHIFT, code:107, exec, grimblast copy area + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d +bind = $mainMod SHIFT, left, movewindow, l +bind = $mainMod SHIFT, right, movewindow, r +bind = $mainMod SHIFT, up, movewindow, u +bind = $mainMod SHIFT, down, movewindow, d + +# Workspaces +$w1 = ~/.config/hypr/wallpaper.sh 1 +$w2 = ~/.config/hypr/wallpaper.sh 2 +$w3 = ~/.config/hypr/wallpaper.sh 3 +$w4 = ~/.config/hypr/wallpaper.sh 4 +$w5 = ~/.config/hypr/wallpaper.sh 5 +$w6 = ~/.config/hypr/wallpaper.sh 6 +$w7 = ~/.config/hypr/wallpaper.sh 7 +$w8 = ~/.config/hypr/wallpaper.sh 8 +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 1, exec, $w1 +bind = $mainMod, 2, exec, $w2 +bind = $mainMod, 3, exec, $w3 +bind = $mainMod, 4, exec, $w4 +bind = $mainMod, 5, exec, $w5 +bind = $mainMod, 6, exec, $w6 +bind = $mainMod, 7, exec, $w7 +bind = $mainMod, 8, exec, $w8 +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 1, exec, $w1 +bind = $mainMod SHIFT, 2, exec, $w2 +bind = $mainMod SHIFT, 3, exec, $w3 +bind = $mainMod SHIFT, 4, exec, $w4 +bind = $mainMod SHIFT, 5, exec, $w5 +bind = $mainMod SHIFT, 6, exec, $w6 +bind = $mainMod SHIFT, 7, exec, $w7 +bind = $mainMod SHIFT, 8, exec, $w8 + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow diff --git a/hypr/hyprpaper.conf b/hypr/hyprpaper.conf new file mode 100644 index 0000000..53ac11a --- /dev/null +++ b/hypr/hyprpaper.conf @@ -0,0 +1,10 @@ +preload = ~/.config/hypr/wallpapers/1.jpg +preload = ~/.config/hypr/wallpapers/2.jpg +preload = ~/.config/hypr/wallpapers/3.jpg +preload = ~/.config/hypr/wallpapers/4.jpg +preload = ~/.config/hypr/wallpapers/5.jpg +preload = ~/.config/hypr/wallpapers/6.jpg +preload = ~/.config/hypr/wallpapers/7.jpg +preload = ~/.config/hypr/wallpapers/8.jpg + +wallpaper = DP-1,~/.config/hypr/wallpapers/1.jpg diff --git a/hypr/wallpaper.sh b/hypr/wallpaper.sh new file mode 100755 index 0000000..892a4ec --- /dev/null +++ b/hypr/wallpaper.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +hyprctl hyprpaper wallpaper "DP-1,~/.config/hypr/wallpapers/$1.jpg" diff --git a/mpd/.gitignore b/mpd/.gitignore new file mode 100644 index 0000000..6bfb513 --- /dev/null +++ b/mpd/.gitignore @@ -0,0 +1,3 @@ +pid +state +sticker.sql diff --git a/mpd/mpd.conf b/mpd/mpd.conf new file mode 100644 index 0000000..964de91 --- /dev/null +++ b/mpd/mpd.conf @@ -0,0 +1,10 @@ +music_directory "~/Music" + +# refresh the database whenever files in the music_directory are changed +auto_update "yes" + +playlist_directory "~/Music/playlists" + +pid_file "~/.config/mpd/pid" +state_file "~/.config/mpd/state" +sticker_file "~/.config/mpd/sticker.sql" diff --git a/rustfmt/rustfmt.toml b/rustfmt/rustfmt.toml new file mode 120000 index 0000000..dbc9b16 --- /dev/null +++ b/rustfmt/rustfmt.toml @@ -0,0 +1 @@ +../../common/home/rustfmt.toml \ No newline at end of file diff --git a/swaylock/config b/swaylock/config new file mode 100644 index 0000000..a1fb458 --- /dev/null +++ b/swaylock/config @@ -0,0 +1,27 @@ +# Lock +ignore-empty-password +show-failed-attempts +grace=2 + +# Clock +clock +timestr=%H:%M:%S +datestr=%a, %d %b %Y + +# Indicator +font=Noto Serif +indicator +indicator-idle-visible +indicator-caps-lock +indicator-thickness=20 +indicator-radius=250 + +ring-color=caa9c7 +text-color=a287d2 + +# Effects: +screenshots +effect-pixelate=32 +effect-blur=10x2 +effect-vignette=0.5:0.5 +fade-in=0.3 diff --git a/waybar/config b/waybar/config new file mode 100644 index 0000000..25999b1 --- /dev/null +++ b/waybar/config @@ -0,0 +1,177 @@ +{ + "layer": "top", + "position": "top", + "height": 20, + "spacing": 4, + "margin": "0 15 0 5", + "modules-left": [ + //"wlr/workspaces", + "hyprland/window"], + "modules-center": ["mpd"], + "modules-right": [ + "tray", + "idle_inhibitor", "keyboard-state", + "pulseaudio", "bluetooth", "network", "cpu", "memory", "temperature", "battery" + //"clock" + ], + "wlr/workspaces": { + "format": "{icon}", // {name} + "format-icons": { + "1": "☱", + "2": "☲", + "3": "☳", + "4": "☴", + "5": "☵", + "6": "☶", + "7": "☷", + "8": "☰", + "9": "⚏", + "10": "⚌", + "default": "⚍", + "focused": "☯" + }, + "on-click": "activate", + "sort-by-number": true, + }, + "hyprland/window": { + "format": " {}", + "separate-outputs": true + }, + "keyboard-state": { + "numlock": true, + "capslock": true, + "format": "{name} {icon}", + "format-icons": { + "locked": "", + "unlocked": "", + //"unlocked": "" + } + }, + "hyprland/language": { + "format": "{}", + "format-en": "🇺🇸", + "format-fr": "🇨🇦", + "format-ja": "🇯🇵", + "tooltip-format": "{}", + "tooltip": true + }, + "mpd": { + "format": "『{artist} - {album} - {title} 』{stateIcon} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}", + "format-disconnected": "Disconnected", + "format-stopped": "『』", + "unknown-tag": "N/A", + "interval": 2, + "consume-icons": { + "on": " " + }, + "random-icons": { + "on": " " + }, + "repeat-icons": { + "on": " " + }, + "single-icons": { + "on": "1 " + }, + "state-icons": { + "paused": "", + "playing": "" + }, + "tooltip-format": "MPD (connected)", + "tooltip-format-disconnected": "MPD (disconnected)" + }, + "user": { + "format": "{user} ↑ {work_d} {work_H}:{work_M}", + "interval": 60, + "height": 30, + "width": 30 + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + "icon-size": 21, + "spacing": 10 + }, + "clock": { + "format": "{: %H:%M  %d/%m}", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": "{:%a, %d %b %Y}" + }, + "cpu": { + "align": 0, + "interval": 2, + "min-length": 6, + "format": " {usage}%", + "on-click": "alacritty -e btop", + "tooltip": true + }, + "memory": { + "align": 0, + "interval": 2, + "min-length": 6, + "format": " {}%" + }, + "temperature": { + "thermal-zone": 2, + "align": 0, + "interval": 2, + "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + "format-critical": "{icon} {temperatureC}°C", + "format": "{icon} {temperatureC}°C", + "format-icons": ["", "", ""] + }, + "battery": { + "align": 0, + "format": "{icon}", + "tooltip": "{time} {power} {capacity}%", + "format-icons": ["", "", "", "", ""] + }, + "network": { + "interval": 10, + "align": 0, + "min-width": 25, + "format-wifi": "{icon} {essid}", + "format-icons": ["", "", ""], + "format-ethernet": " {ipaddr}/{cidr}", + "format-linked": " {ifname} (No IP)", + "format-disconnected": "⚠ Disconnected", + "format-alt": "{bandwidthUpBytes} {bandwidthDownBytes}", + "tooltip-format": "{ifname} via {gwaddr}: {ipaddr}/{cidr}" + }, + "bluetooth": { + "align": 0, + "format": " {status}", + "format-connected": " {device_alias}", + "format-connected-battery": " {device_alias} {device_battery_percentage}%", + "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", + "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", + "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%", + "on-click": "blueman-manager" + }, + "pulseaudio": { + "scroll-step": 1, + "format": "{icon} {volume}% {format_source}", + "format-bluetooth": "{icon} {volume}% {format_source}", + "format-bluetooth-muted": "{icon}  {format_source}", + "format-muted": " {format_source}", + "format-source": " {volume}%", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + } +} diff --git a/waybar/style.css b/waybar/style.css new file mode 100644 index 0000000..e0ad534 --- /dev/null +++ b/waybar/style.css @@ -0,0 +1,236 @@ +/* + * Author: L. Aniva + * + * The central theme of this config is the "stars on a nightsky" effect. Each + * module doesn't have a background (however dark) and floats on top of the + * dark-themed wallpaper like stars. + * + * The theme is tuned to 3840x2160 screen sizes with horizontal waybar. Some + * tuning of font sizes may be needed on smaller screens. + * + * Credit: Code Breaker for inspiring this colour palette + */ + +@define-color window #eeeeee; +@define-color window_border rgba(80%, 80%, 80%, 0.7); + +@define-color workspace #bbbbbb; +@define-color workspace_bg transparent; +@define-color workspace_active #eeeeee; +@define-color workspace_active_bg alpha(#64727D, 0.5); + +@define-color mpd rgba(88%, 91%, 88%, 0.7); + +@define-color tray_background rgba(80%, 80%, 80%, 0.1); +@define-color tray #c9cbff; +@define-color keyboard #f2cdcd; +@define-color language #e8a2af; +@define-color idle_inhibitor #f28fad; +@define-color audio #fae3b0; +@define-color backlight #f8bd96; +@define-color bluetooth #caa9c7; +@define-color network #bd93f9; +@define-color cpu #96cdfb; +@define-color memory #88bbeb; +@define-color temperature #ddb6f2; +@define-color temperature_critical #ff6666; +@define-color battery #b6b2b3; +@define-color clock #abe9b3; +@define-color user #89dceb; + +window#waybar { + background: transparent; +} + +/* Do not use * selector since it modifies the menus. */ +#window, #workspaces { + font-family: monospace; + font-size: 20px; + min-height: 15px; + padding-left: 5px; + padding-right: 5px; + padding-top: 2px; + margin-top: 1px; + margin-bottom: 0px; + border: none; + background: transparent; + border-radius: 10; +} +#tray, #idle_inhibitor, #keyboard-state, #language, #user, +#backlight, #clock, #cpu, #bluetooth, #network, #memory, #pulseaudio, #temperature { + font-family: monospace; + font-size: 20px; + min-height: 15px; + padding-left: 5px; + padding-right: 5px; + padding-top: 2px; + margin-top: 1px; + margin-bottom: 0px; + border: none; + background: transparent; + border-radius: 0; + border-top: 2px solid; +} + + +/* Left */ +widget #window { + font-family: "Noto Sans"; + color: @window; + /* Three different styles */ + border-top: none; + /* + border-top: 2px dotted @window_border; + border-radius: 0; + */ + /* + border-right: 2px solid @window_border; + border-radius: 30; + */ + /* + border-left: 2px solid @window_border; + border-right: 2px solid @window_border; + border-radius: 5; + */ + background: transparent; + padding-left: 5px; + padding-right: 15px; +} +#workspaces label { + font-family: monospace; + font-size: 30px; + min-width: 30px; + padding: 0 0 0 0; + /* Ensure the symbols are much bigger */ + margin: -6 -6 -6 -6; +} +#workspaces button { + color: @workspace; + background: @workspace_bg; + margin: 0 0 0 0; + padding-top: 10px; + border-radius: 5; +} +#workspaces button.active { + color: @workspace_active; + background: @workspace_active_bg; + margin: 0 0 0 0; + padding-top: 10px; + border-radius: 5; +} +#workspaces button.hidden button.urgent { + color: #0000FF; + background: @workspace_active_bg; + margin: 0 0 0 0; + padding-top: 10px; + border-radius: 5; +} + +/* Centre */ +widget #mpd { + font-family: "Noto Serif"; + padding-left: 5px; + padding-right: 5px; + color: @mpd; + border: none; +} + +/* Right */ +widget #tray { + /* + border-left: 2px solid @tray; + border-right: 2px solid @tray; + min-width: 5px; + border-radius: 20;*/ + background: @tray_background; + padding-right: 10px; + color: @tray; + border-top: 2px dotted alpha(@tray, 0.5); +} + + +widget #idle_inhibitor.activated { + min-width: 25px; + color: @idle_inhibitor; + border-top-color: alpha(@idle_inhibitor, 0.5); +} +widget #idle_inhibitor.deactivated { + min-width: 25px; + color: alpha(@idle_inhibitor, 0.5); + border-top-color: alpha(@idle_inhibitor, 0.5); +} +widget #keyboard-state { + color: @keyboard; + border-top-color: alpha(@keyboard, 0.5); +} +/* Ensure toggling doesn't affect layout */ +#keyboard-state label { + opacity: 0.5; + min-width: 80px; +} +#keyboard-state label.locked { + opacity: 1.0; + min-width: 80px; +} + +widget #language { + color: @language; + border-top-color: alpha(@language, 0.5); +} +widget #pulseaudio { + color: @audio; + border-top-color: alpha(@audio, 0.5); +} +widget #backlight { + color: @backlight; + border-top-color: alpha(@backlight, 0.5); +} +widget #bluetooth { + color: @bluetooth; + border-top-color: alpha(@bluetooth, 0.5); +} +widget #bluetooth.on #bluetooth.connected #bluetooth.discoverable #bluetooth.discovering #bluetooth.pairable { + opacity: 1.0; +} +widget #bluetooth.off { + opacity: 0.5; +} +widget #bluetooth.disabled { + opacity: 0.5; +} +widget #network { + color: @network; + border-top-color: alpha(@network, 0.5); +} +widget #cpu { + color: @cpu; + border-top-color: alpha(@cpu, 0.5); +} +widget #memory { + color: @memory; + border-top-color: alpha(@memory, 0.5); +} +widget #temperature { + min-width: 60px; + color: @temperature; + border-top-color: alpha(@temperature, 0.5); +} +widget #temperature.critical { + min-width: 60px; + color: @temperature_critical; + border-top-color: alpha(@temperature, 0.5); +} +widget #battery { + color: @battery; + border-top-color: alpha(@battery, 0.5); +} +widget #clock { + color: @clock; + border-top-color: alpha(@clock, 0.5); +} + +widget #user { + color: @user; + border-top-color: alpha(@user, 0.5); + font-family: "Noto Serif"; +} diff --git a/wofi/config b/wofi/config new file mode 100644 index 0000000..4c0992b --- /dev/null +++ b/wofi/config @@ -0,0 +1 @@ +term=alacritty diff --git a/wofi/style.css b/wofi/style.css new file mode 100644 index 0000000..48e0e6b --- /dev/null +++ b/wofi/style.css @@ -0,0 +1,56 @@ +window { + opacity: 1.0; + border: 2px solid #886688; + border-radius: 20px; + font-family: "Noto Sans"; + font-size: 20px; + background-color: rgba(10%, 10%, 10%, 0.9); +} + +#input { + /* + border-radius: 10px 10px 0px 0px; + border: 0px;*/ + padding: 10px; + margin: 0px; + font-size: 25px; + color: #DDDDDD; + border: 2px solid #886688; + border-radius: 20px; + /*border-bottom: 2px solid white;*/ + background-color: transparent; + background-color: #111111; +} + +#inner-box { + margin: 0px; + color: #EBDBB2; + background-color: transparent; +} + +#outer-box { + margin: 0px; + background-color: transprent; + border-radius: 10px; +} + +#selected { + color: #FCECC3; + background-color: #876087; +} + +#entry { + padding: 0px; + margin: 0px; + background-color: transparent; +} + +#scroll { + margin: 5px; + background-color: transparent; +} + +#text { + margin: 0px; + padding: 2px 2px 2px 10px; +}