From 301b57ec06b900033f4866df8be9ee8da8f52169 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 Add fish config Reoganize README.org Add LaTeX relative to .latexmkrc compile hook Globally advise TeX-master-{directory,file} Add skhd and yabai Add comment in README-MacOS.org Remove rustfmt.toml symbolic link Add capnp mode Initial sway migration 1. remove weather widget from eww since it crashes if `wttr.in` is down Add sway workspace handling for eww Ensure capacity with hypr Add julia and lua. Remove tabs 1. Remove centaur-tabs since they don't interact well with emacs daemon mode, and they are not useful cf. ibuffer. 2. Remove transparency (prefer OS transparency). Add clock back to waybar Remove lua. Add zig Move month before day in waybar Troubleshooting and default opacity for swayfx --- .gitignore | 27 + README-MacOS.org | 24 + README-Wayland.org | 104 ++++ README.org | 62 +++ alacritty/alacritty.yml | 2 + doom/.gitignore | 4 + doom/banner.txt | 16 + doom/config.org | 760 ++++++++++++++++++++++++++ doom/init.el | 194 +++++++ eww/bar/eww.scss | 167 ++++++ eww/bar/eww.yuck | 170 ++++++ eww/bar/scripts/get-volume.sh | 3 + eww/bar/scripts/get-workspaces | 126 +++++ eww/bar/scripts/popup | 16 + eww/bar/scripts/workspace.sh | 4 + fish/.gitignore | 5 + fish/config.fish | 16 + fish/fishd_color | 33 ++ fish/functions/fish_mode_prompt.fish | 24 + fish/functions/fish_prompt.fish | 78 +++ fish/functions/fish_right_prompt.fish | 8 + 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 | 5 + skhd/skhdrc | 43 ++ sway/config | 46 ++ sway/keys.conf | 63 +++ sway/launch.conf | 9 + swaylock/config | 27 + waybar/config | 172 ++++++ waybar/style.css | 236 ++++++++ wofi/config | 1 + wofi/style.css | 56 ++ yabai/yabairc | 26 + 39 files changed, 2773 insertions(+) create mode 100644 .gitignore create mode 100644 README-MacOS.org create mode 100644 README-Wayland.org 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/popup create mode 100755 eww/bar/scripts/workspace.sh create mode 100644 fish/.gitignore create mode 100755 fish/config.fish create mode 100755 fish/fishd_color create mode 100755 fish/functions/fish_mode_prompt.fish create mode 100755 fish/functions/fish_prompt.fish create mode 100755 fish/functions/fish_right_prompt.fish 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 100644 rustfmt/rustfmt.toml create mode 100644 skhd/skhdrc create mode 100644 sway/config create mode 100644 sway/keys.conf create mode 100644 sway/launch.conf 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 create mode 100755 yabai/yabairc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b1b6579 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +.* +!.gitignore + +# Programs that keep binary data in .config need to be excluded +borg +dockstation +gimp +qBittorrent +Signal +Slack + +# Programs which require machine-specific data or cache in their rc files +blender +discord +dolphinrc +gwenviewrc +gh +katerc +spectaclerc +systemd +trashrc +vlcrc +zoom.conf +zoomus.conf + +# Doom-emacs manages this automatically (can also be placed in ~/.emacs) +emacs diff --git a/README-MacOS.org b/README-MacOS.org new file mode 100644 index 0000000..34b5900 --- /dev/null +++ b/README-MacOS.org @@ -0,0 +1,24 @@ +# Desktop Environment for MacOS + +* Installation + +Install Homebrew. + +* Desktop Manager + +- [[https://github.com/koekeishiya/yabai][yabai]]: Window manager, see [[https://github.com/koekeishiya/yabai/wiki][setup guide]] + + To avoid space rearranging automatically, go to + /System Settings - Desktop & Dock - Mission Control - Automatically rearrange Spaces .../ + and uncheck. +- [[https://github.com/koekeishiya/skhd][skhd]]: Hotkey manager + + See [[https://github.com/koekeishiya/skhd/issues/1][this guide]] for keybindings + + ~fn~ key is used as the workspace leader key and ~cmd~ key is used as window + leader key. The reason is that ~fn~ and arrow key combinations disable arrow + keys for other applications. +- ~Karabiner-elements~: Install and remap Caps Lock to Meh key. This is the + master key for window operations in ~yabai~. +- [[https://github.com/felixhageloh/uebersicht][Uebersicht]]: Widgets manager +- [[https://github.com/Jean-Tinland/simple-bar][simple-bar]]: Status bar (see page for installation guide) diff --git a/README-Wayland.org b/README-Wayland.org new file mode 100644 index 0000000..876bff3 --- /dev/null +++ b/README-Wayland.org @@ -0,0 +1,104 @@ +#+title: Wayland + +Install [[https://wiki.archlinux.org/title/wayland][wayland]]: ~wayland~, ~xorg-xwayland~ + +* Login Manager + +The login manager is not managed by this configuration but mentioned here since +it interacts with the desktop environment. For ~hyprland~, ~sddm~ is +recommended. + +- ~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 + +* Status Bar and Tray + +- ~waybar~: Status bar, use ~waybar-hyprland-git~ AUR repo to enable clicking! +- ~eww-wayland~: Another status bar, requires ~socat~ to listen for hyprland events. + +* Sway + +This is one choice of a compositor. + +- ~swayfx~: Window manager +- ~python-i3ipc~: Enables inactive window opacity scripts + +** Wallpaper +Use ~multibg-sway~, which assigns a different wallpaper to each workspace and +does not crash. The wallpapers directory ~~/.config/sway/wallpapers~ needs to be setup in this way: +#+begin_src +wallpapers + ├─ eDP-1 + │ ├─ _default.jpg + │ ├─ 1.jpg + │ ├─ 2.png + │ └─ browser.jpg + └─ HDMI-A-1 + ├─ 1.jpg + └─ 3.png +#+end_src +where the output information can be obtained from ~swaymsg -t get_outputs~. + +Supposedly does not work with ~hypr~. + +* Hyprland + +This is another choice of a compositor. + +Note: Setup does not work with NVIDIA GPU without some tweaks. + +- [[https://wiki.archlinux.org/title/Hyprland][hyprland]]: window manager + 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"~ +The command for changing keyboard layouts is handled by ~fcitx5~. + +* Utilities + +- [[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 +- ~wofi~: finding programs, drop in replacement for ~rofi~ +- ~grimblast~: Screenshot engine +- ~dolphin~: File explorer +- ~swaylock-effects~: A simple lockscreen +- ~wl-clipboard~: Provides copying +- ~blueman~: Bluetooth connector + +** Configuration + +- ~lxappearance~: Used to configure GTK3 themes +- ~nwg-look~: Configures cursor +- ~wev~: Wayland event interceptor useful for determining keybinds + +* Troubleshooting + +** Black screen with underscore + +Symptom: The system shows a black screen with an underscore at the top left +corner. Cannot access any TTY via ~C-S-F[1-9]~. Logs look otherwise normal. + +Solution: +1. Boot into live USB. Read `journalctl --since=today` to find out about + erroring packages and reinstall them. +2. Enable wayland for sddm. This requires ~weston~ diff --git a/README.org b/README.org new file mode 100644 index 0000000..9334224 --- /dev/null +++ b/README.org @@ -0,0 +1,62 @@ +#+title: Cross-Platform Configuration Files + +This is a list of cross-platform configuration files which can be placed in +~.config~ directory and enabled at will. + +* 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 + +** Doom emacs + +Install via (can also be placed in ~.emacs~ directory) +#+begin_src bash +git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs +~/.config/emacs/bin/doom sync +~/.config/emacs/bin/doom env +#+end_src + +** Fish + +Install and set the default shell to ~fish~. + +** 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 +- ~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) +- ~btop~/~htop~: Process monitor + +*** Screenfetch + +- ~neofetch~: Screenfetch +- ~macchina~ (aur): Another screenfetch + +* Dot Files + +All the configurations which must appear as dot files are not included: +- ~.bashrc~ +- ~.vimrc~: Workaround is to install NeoVim +- ~.spacemacs~ +The following default files are not included for the same reason: +- ~.astylerc~ +- ~.clang-format~ +- ~.latexmkrc~ 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..32ffb8d --- /dev/null +++ b/doom/config.org @@ -0,0 +1,760 @@ +#+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 Aniva" + user-mail-address "v@leni.sh") +#+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 + +*** Capnproto + +#+begin_src emacs-lisp :tangle packages.el +(package! capnp-mode :recipe ( + :host github + :repo "capnproto/capnproto" + :files ("highlighting/emacs/*.el"))) +#+end_src + +*** 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 + +The ~SPC m c~ command which by default binds to ~TeX-command-run-all~ is +modified so it runs in the directory of the nearest ~.latexmkrc~ file or the +projectile root, whichever is closer. If a ~.latexmkrc~ file is not found, we +fall back to the current directory. We improve this below by decreeing that all +compilation has to happen with the ~.latexmkrc~ file's directory as PWD. +#+begin_src emacs-lisp +(defun custom/TeX-root-directory (start) + (let* ( + (dir-latexmkrc (projectile-locate-dominating-file start ".latexmkrc")) + (dir-projectile (projectile-project-root)) + (is-latexmk-child-of-projectile (and dir-projectile dir-latexmkrc + (string-match-p (regexp-quote dir-projectile) dir-latexmkrc)))) + (cond + ((and dir-latexmkrc is-latexmk-child-of-projectile) dir-latexmkrc) + (dir-projectile dir-projectile) + (t start)))) +(defun custom/TeX-master-directory-filter (dir-master) + (custom/TeX-root-directory dir-master)) +(defun custom/TeX-master-file-filter (file-master) + (concat + (string-remove-prefix (custom/TeX-root-directory default-directory) default-directory) + file-master + )) + +(advice-add 'TeX-master-directory :filter-return #'custom/TeX-master-directory-filter) +(advice-add 'TeX-master-file :filter-return #'custom/TeX-master-file-filter) +#+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..d6bd096 --- /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 +icons) ; 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 +lsp) ; 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..2604de7 --- /dev/null +++ b/eww/bar/eww.yuck @@ -0,0 +1,170 @@ +(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_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") + + +; Weather + +(defwidget widget_weather [orientation] + (box + :class "weather" + :orientation orientation + :space-evenly false + :valign "start" + :halign "center" + :spacing 10 + (button :onclick "scripts/popup weather" "W") + )) + +(defpoll weather_text :initial "" :interval "180s" + "curl --max-time 2 wttr.in") + +(defwindow weather + :geometry (geometry :x "70px" + :y "50%" + :width "270px" + :height "60px") + (box weather_text)) + + +(defwindow calendar + :geometry (geometry :x "70px" + :y "65%" + :width "270px" + :height "60px") + (cal)) + +(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..4c2070d --- /dev/null +++ b/eww/bar/scripts/get-workspaces @@ -0,0 +1,126 @@ +#!/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, subprocess +from typing import Optional + +WORKSPACE_ICONS = [ + (1, "☱"), + (2, "☲"), + (3, "☳"), + (4, "☴"), + (5, "☵"), + (6, "☶"), + (7, "☷"), + (8, "☰"), +] +EXTRA_WORKSPACE_ICONS = [ + (0, "⚌"), + (1, "⚍"), + (2, "⚎"), + (3, "⚏"), +] + +Workspaces = dict[int, bool] + +def get_widgets(workspaces: Workspaces) -> str: + """ + Create widget sexp from workspace information + """ + 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 + "]" + + +# Compositor specific information + +def hypr_get_workspace_info() -> Workspaces: + 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 hypr_listen(socket_addr: str): + sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + try: + sock.connect(socket_addr) + except: + print(f"Could not connect to {socket_addr}", file=sys.stderr) + raise + + # The flush here is very important since python by default buffers! + workspace_info = hypr_get_workspace_info() + print(get_widgets(workspace_info), flush=True) + while sock: + data = sock.recv(1024) + if b"workspace" in data: + workspace_info = hypr_get_workspace_info() + print(get_widgets(workspace_info), flush=True) + + +def sway_get_workspace_info() -> Workspaces: + workspaces = json.loads(os.popen("swaymsg --raw -t get_workspaces").read()) + # REVIEW: This has not been tested on a multi-monitor setup. + workspaces = { + int(w["num"]): w["focused"] + for w in workspaces + } + return workspaces + +def sway_listen(): + proc = subprocess.Popen( + ["swaymsg", "-t", "subscribe", "-m", '["workspace"]'], stdout=subprocess.PIPE + ) + workspace_info = sway_get_workspace_info() + print(get_widgets(workspace_info), flush=True) + while line := proc.stdout.readline(): + # Not needed + info = json.loads(line) + workspace_info = sway_get_workspace_info() + print(get_widgets(workspace_info), flush=True) + + +def detect(): + """ + Main entry point, detects the type of compositor used + """ + if signature := os.environ.get("HYPRLAND_INSTANCE_SIGNATURE", None): + socket_addr = f"/tmp/hypr/{signature}/.socket2.sock" + return hypr_listen(socket_addr) + if signature := os.environ.get("SWAYSOCK", None): + return sway_listen() + + print("No compositor found.", file=sys.stderr) + return None + + +if __name__ == "__main__": + detect() diff --git a/eww/bar/scripts/popup b/eww/bar/scripts/popup new file mode 100755 index 0000000..faef20e --- /dev/null +++ b/eww/bar/scripts/popup @@ -0,0 +1,16 @@ +#!/bin/sh + +toggle_popup() { + LOCK="/tmp/eww-$1.lock" + if [[ ! -f "$LOCK" ]]; then + touch "$LOCK" + eww --config ~/.config/eww/bar open $1 + else + eww --config ~/.config/eww/bar close $1 + rm "$LOCK" + fi +} + +if [ "$1" = weather ]; then + toggle_popup weather +fi 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/fish/.gitignore b/fish/.gitignore new file mode 100644 index 0000000..6242cfe --- /dev/null +++ b/fish/.gitignore @@ -0,0 +1,5 @@ +# Automatically generated or machine specific variables +fish_variables + +# Machine specific fishd +fishd.* diff --git a/fish/config.fish b/fish/config.fish new file mode 100755 index 0000000..0126ede --- /dev/null +++ b/fish/config.fish @@ -0,0 +1,16 @@ +#!/bin/fish + +# Disable the greeting +set fish_greeting + +## Application-specific configurations + +# opam +if test -e ~/.opam/opam-init/init.fish + source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true +end + +# direnv/envrc +if type -q direnv + direnv hook fish | source +end diff --git a/fish/fishd_color b/fish/fishd_color new file mode 100755 index 0000000..581b7da --- /dev/null +++ b/fish/fishd_color @@ -0,0 +1,33 @@ +# This file is automatically generated by the fish. +# Do NOT edit it directly, your changes will be overwritten. +SET __fish_classic_git_prompt_initialized:\x1d +SET __fish_init_2_39_8:\x1d +SET __fish_init_2_3_0:\x1d +SET fish_color_autosuggestion:b2b2b2 +SET fish_color_cancel:\x2dr +SET fish_color_command:ffaf00 +SET fish_color_comment:5C9900 +SET fish_color_cwd:green +SET fish_color_cwd_root:red +SET fish_color_end:005fff +SET fish_color_error:ff5f00 +SET fish_color_escape:bryellow\x1e\x2d\x2dbold +SET fish_color_history_current:\x2d\x2dbold +SET fish_color_host:normal +SET fish_color_match:\x2d\x2dbackground\x3dbrblue +SET fish_color_normal:normal +SET fish_color_operator:bryellow +SET fish_color_param:00afd7 +SET fish_color_quote:00d7af +SET fish_color_redirection:7CB02C +SET fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack +SET fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack +SET fish_color_status:red +SET fish_color_user:brgreen +SET fish_color_valid_path:\x2d\x2dunderline +SET fish_greeting:\x1d +SET fish_key_bindings:fish_default_key_bindings +SET fish_pager_color_completion:\x1d +SET fish_pager_color_description:B3A06D\x1eyellow +SET fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SET fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan diff --git a/fish/functions/fish_mode_prompt.fish b/fish/functions/fish_mode_prompt.fish new file mode 100755 index 0000000..c40bd2b --- /dev/null +++ b/fish/functions/fish_mode_prompt.fish @@ -0,0 +1,24 @@ +#!/bin/fish + +function fish_mode_prompt --description 'Displays the current vi mode' + # Do nothing if not in vi mode + if test "$fish_key_bindings" = "fish_vi_key_bindings" + switch $fish_bind_mode + case default + set_color --bold red + echo -n 🅽 + case insert + set_color --bold green + echo -n 🅸 + case replace_one + set_color --bold green + echo -n 🆁 + case visual + set_color --bold brblue + echo -n 🆅 + end + set_color normal + echo -n ' ' + end +end + diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish new file mode 100755 index 0000000..d3d9ebb --- /dev/null +++ b/fish/functions/fish_prompt.fish @@ -0,0 +1,78 @@ +#!/bin/fish + +set PROMPTDIRS "~":$HOME + +# +# This function takes the $PROMPTDIRS variable and tries to shorten the +# input (i.e. $argv[1]) w.r.t. the variable. +# +# e.g. If $PROMPTDIRS contains the pair $PR:$HOME/Projects, +# +# (prompt_abbr ~/Projects/Applications) +# +# will show "$PR/Applications", and ~/Projects will be converted to $PR. +# +# To set multiple $PROMPTDIRS entry, use successive (where $ABBR is some +# directory to be abbreviated) +# +# set PROMPTDIRS \$ABBR:$ABBR $PROMPTDIRS +# +# with the outermost directory being set first. +# +function prompt_abbr + set in $argv[1] + + for d in $PROMPTDIRS + set -l kv (string split -m 1 ":" $d) + + switch "$in" + case "$kv[2]/*" + set in (string replace $kv[2] $kv[1] $in) + break + case "$kv[2]" + set in "$kv[1]" + break + case "*" + end + end + echo "$in" +end + +function fish_prompt +# set_color white +# echo -n '[' + + set -l FishStatusCodeCache $status + + set_color -o 00FF00 + echo -n (whoami) + + set_color normal + echo -n '@' + + set_color AFD75F + echo -n (hostname) + + set_color white + echo -n ':' + + set_color 8787FF + echo -n (prompt_abbr $PWD) + + set_color 5F87D7 + echo -n (__fish_vcs_prompt) + + if test $FishStatusCodeCache -eq 0 + #set_color 18C412 + else + set_color E84505 + echo -n " [$FishStatusCodeCache]" + end + +# set_color white +# echo -n "]" + + set_color -o white + echo -n "> " + set_color normal +end diff --git a/fish/functions/fish_right_prompt.fish b/fish/functions/fish_right_prompt.fish new file mode 100755 index 0000000..4fd2d57 --- /dev/null +++ b/fish/functions/fish_right_prompt.fish @@ -0,0 +1,8 @@ +#!/bin/fish + +function fish_right_prompt + set_color grey + printf (date '+%H:%M:%S') + set_color normal +end + 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 100644 index 0000000..a14d586 --- /dev/null +++ b/rustfmt/rustfmt.toml @@ -0,0 +1,5 @@ +edition = "2021" +brace_style = "AlwaysNextLine" +hard_tabs = true +tab_spaces = 3 +imports_granularity = "Crate" diff --git a/skhd/skhdrc b/skhd/skhdrc new file mode 100644 index 0000000..e95c8a0 --- /dev/null +++ b/skhd/skhdrc @@ -0,0 +1,43 @@ +# Bind caps lock to meh (cmd + alt + ctrl). + +# Windows +meh - right : yabai -m window --focus east +meh - left : yabai -m window --focus west +meh - up : yabai -m window --focus north +meh - down : yabai -m window --focus south +hyper - right : yabai -m window --swap east +hyper - left : yabai -m window --swap west +hyper - up : yabai -m window --swap north +hyper - down : yabai -m window --swap south + +meh - f : yabai -m window --toggle native-fullscreen +meh - v : yabai -m window --toggle float +meh - s : yabai -m window --toggle sticky +meh - 0x2C : yabai -m window --toggle split +meh - q : yabai -m window --close + +# Spaces + +#meh - n : yabai -m space --create && \ +# index="$(yabai -m query --spaces --display | jq 'map(select(."is-native-fullscreen" == false))[-1].index')" && \ +# yabai -m window --space "${index}" && \ +# yabai -m space --focus "${index}" +#meh - n : yabai -m space --destroy +meh - 1 : yabai -m space --focus 1 +meh - 2 : yabai -m space --focus 2 +meh - 3 : yabai -m space --focus 3 +meh - 4 : yabai -m space --focus 4 +meh - 5 : yabai -m space --focus 5 +meh - 6 : yabai -m space --focus 6 +meh - 7 : yabai -m space --focus 7 +meh - 8 : yabai -m space --focus 8 +meh - 9 : yabai -m space --focus 9 +hyper - 1 : yabai -m window --space 1 +hyper - 2 : yabai -m window --space 2 +hyper - 3 : yabai -m window --space 3 +hyper - 4 : yabai -m window --space 4 +hyper - 5 : yabai -m window --space 5 +hyper - 6 : yabai -m window --space 6 +hyper - 7 : yabai -m window --space 7 +hyper - 8 : yabai -m window --space 8 +hyper - 9 : yabai -m window --space 9 diff --git a/sway/config b/sway/config new file mode 100644 index 0000000..cbcc583 --- /dev/null +++ b/sway/config @@ -0,0 +1,46 @@ +# Terminal +set $term alacritty +# Launcher +set $menu wofi --show drun -I -G +set $lock swaylock +set $screenshot_full gscreenshot -s +set $screenshot_area /usr/share/swayfx/scripts/grimshot copy area + +xwayland enable + +scratchpad_minimize disable + +# Visual Effects +corner_radius 20 +smart_corner_radius enable +blur on +blur_xray off +blur_passes 2 +blur_radius 5 +shadows on +shadows_on_csd off +shadow_blur_radius 20 +shadow_color #0000007F +default_dim_inactive 0.0 +dim_inactive_colors.unfocused #000000FF +dim_inactive_colors.urgent #900000FF + +set $border 2 +default_border pixel $border +default_floating_border pixel $border + +for_window [app_id=".*"] gaps inner all set 5 +for_window [app_id=".*"] gaps outer all set 15 +for_window [app_id=".*"] opacity 1.00 +for_window [app_id=__focused__] opacity 1.00 +for_window [app_id="emacs"] opacity 0.9 +for_window [app_id="alacritty"] opacity 0.9 + +# Include keys +include ~/.config/sway/keys.conf + +# Launching programs +include ~/.config/sway/launch.conf + +# Include systemd fix +include /etc/sway/config.d/* diff --git a/sway/keys.conf b/sway/keys.conf new file mode 100644 index 0000000..8199647 --- /dev/null +++ b/sway/keys.conf @@ -0,0 +1,63 @@ +set $mod Mod4 +set $left h +set $down j +set $up k +set $right l + +bindsym $mod+t exec $term +bindsym $mod+q kill +bindsym $mod+space exec $menu +bindsym $mod+semicolon exec $lock +bindsym $mod+Shift+c reload +bindsym Print exec $screenshot_area +bindsym Shift+Print exec $screenshot_full + +# Drag floating windows by holding down $mod and left mouse button. +# Resize them with right mouse button + $mod. +# Despite the name, also works for non-floating windows. +# Change normal to inverse to use left mouse button for resizing and right +# mouse button for dragging. +floating_modifier $mod normal + +bindsym $mod+f fullscreen +bindsym $mod+v floating toggle + +# Move focus +bindsym $mod+$left focus left +bindsym $mod+$down focus down +bindsym $mod+$up focus up +bindsym $mod+$right focus right +# Or use $mod+[up|down|left|right] +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# Move the focused window with the same, but add Shift +bindsym $mod+Shift+$left move left +bindsym $mod+Shift+$down move down +bindsym $mod+Shift+$up move up +bindsym $mod+Shift+$right move right +# Ditto, with arrow keys +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +bindsym $mod+1 workspace number 1 +bindsym $mod+2 workspace number 2 +bindsym $mod+3 workspace number 3 +bindsym $mod+4 workspace number 4 +bindsym $mod+5 workspace number 5 +bindsym $mod+6 workspace number 6 +bindsym $mod+7 workspace number 7 +bindsym $mod+8 workspace number 8 +# Move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number 1; workspace number 1 +bindsym $mod+Shift+2 move container to workspace number 2; workspace number 2 +bindsym $mod+Shift+3 move container to workspace number 3; workspace number 3 +bindsym $mod+Shift+4 move container to workspace number 4; workspace number 4 +bindsym $mod+Shift+5 move container to workspace number 5; workspace number 5 +bindsym $mod+Shift+6 move container to workspace number 6; workspace number 6 +bindsym $mod+Shift+7 move container to workspace number 7; workspace number 7 +bindsym $mod+Shift+8 move container to workspace number 8; workspace number 8 diff --git a/sway/launch.conf b/sway/launch.conf new file mode 100644 index 0000000..ddd1921 --- /dev/null +++ b/sway/launch.conf @@ -0,0 +1,9 @@ +exec /usr/share/swayfx/scripts/inactive-windows-transparency --opacity 0.8 +exec_always eww --config ~/.config/eww/bar open bar +bar { + position top + swaybar_command waybar +} +exec_always multibg-sway ~/.config/sway/wallpapers +exec swaync +exec fcitx5 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..af69f78 --- /dev/null +++ b/waybar/config @@ -0,0 +1,172 @@ +{ + "layer": "top", + "position": "top", + "height": 20, + "spacing": 4, + "margin": "0 15 0 5", + "modules-left": [ + //"wlr/workspaces", + "hyprland/window", + "sway/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": " {}", + }, + "sway/window": { + "format": " {}", + }, + "keyboard-state": { + "numlock": true, + "capslock": true, + "format": "{name} {icon}", + "format-icons": { + "locked": "", + "unlocked": "", + //"unlocked": "" + } + }, + "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 + }, + "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" + }, + "clock": { + "format": "{: %m/%d  %H:%M}", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": "{:%a, %d %b %Y}" + } +} 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; +} diff --git a/yabai/yabairc b/yabai/yabairc new file mode 100755 index 0000000..d30702b --- /dev/null +++ b/yabai/yabairc @@ -0,0 +1,26 @@ +#!/bin/bash + +yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa" +sudo yabai --load-sa + +yabai -m config \ + layout bsp \ + focus_follows_mouse off \ + mouse_follows_focus off \ + auto_balance off \ + top_padding 20 \ + bottom_padding 20 \ + left_padding 20 \ + right_padding 20 \ + window_gap 10 \ + external_bar main:20:0 \ + window_opacity on \ + active_window_opacity 0.95 \ + normal_window_opacity 0.7 \ + window_border on \ + normal_window_border_color 0x44444444 \ + active_window_border_color 0x4444ffff \ + window_border_width 1 \ + window_border_radius 12 \ + && +echo "yabairc reloaded"