Compare commits
130 Commits
f4d6589bd1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e87b0ddd24 | ||
|
|
18cfc610e1 | ||
|
|
7277d5b080 | ||
|
|
ed00a90dda | ||
|
|
97b58f141a | ||
|
|
d388d2192a | ||
|
|
41d47f6152 | ||
|
|
df6c1c9402 | ||
|
|
fc548af96a | ||
|
|
1b8db86a98 | ||
|
|
e24078ec81 | ||
|
|
411bf5b0f2 | ||
|
|
7312947723 | ||
|
|
428a1756f3 | ||
|
|
f7afbe6973 | ||
|
|
e917ea97c6 | ||
|
|
8378eec1e0 | ||
|
|
a39f38b3f2 | ||
|
|
aef9169245 | ||
|
|
bb7b073fe9 | ||
|
|
b1a8174ea1 | ||
|
|
4518cccec1 | ||
|
|
8da975b098 | ||
|
|
d452ec86dd | ||
|
|
ed305126a2 | ||
|
|
a59c52a2a3 | ||
|
|
ab380782c3 | ||
|
|
5fd64d47cd | ||
|
|
2956327b0c | ||
|
|
40b3eaba12 | ||
|
|
7fe62ab2ce | ||
|
|
2af075c7dd | ||
|
|
a5cd3713e7 | ||
|
|
c62acaa77f | ||
|
|
39cdbaa430 | ||
|
|
228c57679b | ||
|
|
81fedb6261 | ||
|
|
154b7fb9b2 | ||
|
|
0584a50f5f | ||
|
|
7cbf3cb37b | ||
|
|
6ba393d433 | ||
|
|
e4bf731436 | ||
|
|
eef75973d4 | ||
|
|
25a24fe206 | ||
|
|
d49b475e16 | ||
|
|
6ca66905b1 | ||
|
|
8833cb4f7a | ||
|
|
6a4dcadfba | ||
|
|
f2b20c7acd | ||
|
|
d1b63fe326 | ||
|
|
466ddf2cd9 | ||
|
|
95944b2486 | ||
|
|
32654faf98 | ||
|
|
bf8c91e632 | ||
|
|
3d89540ff8 | ||
|
|
4f70bf991c | ||
|
|
2e3dad1c1b | ||
|
|
87a4d79c71 | ||
|
|
3c23709394 | ||
|
|
481914022c | ||
|
|
14e9bcd7c3 | ||
|
|
a09aedab3f | ||
|
|
ae58914cc2 | ||
|
|
ea276bb6d1 | ||
|
|
360adace1e | ||
|
|
3f06ae0cb2 | ||
|
|
5cce9461c1 | ||
|
|
e716f7cb7d | ||
|
|
042e246b1b | ||
|
|
fa12502c6e | ||
|
|
d0f78cc24f | ||
|
|
ddffe5c9c6 | ||
|
|
062a6f6fa9 | ||
|
|
ccb5760edf | ||
|
|
31d93b8e19 | ||
|
|
06b2440df5 | ||
|
|
e6b0e03a8c | ||
|
|
fbab268555 | ||
|
|
d660b0fb36 | ||
|
|
fffa64bc44 | ||
|
|
b898d0af42 | ||
|
|
3713e4eca1 | ||
|
|
f95a9948a6 | ||
|
|
ad76fdf575 | ||
|
|
0d63549504 | ||
|
|
596736b542 | ||
|
|
84a41bed0f | ||
|
|
8b641e5614 | ||
|
|
b72477414f | ||
|
|
a8f33803ca | ||
|
|
c6ddc5f30f | ||
|
|
3ff5e00d29 | ||
|
|
3b76eed716 | ||
|
|
f97659c7db | ||
|
|
10f4940ae1 | ||
|
|
e9bfdcc27e | ||
|
|
339a62d601 | ||
|
|
9292866a87 | ||
|
|
3aa810d7b3 | ||
|
|
e436a4be3b | ||
|
|
96028c6cad | ||
|
|
177e96ad18 | ||
|
|
098edb7f44 | ||
|
|
ccaca2cbe1 | ||
|
|
69e1dc2eb4 | ||
|
|
ebbbd0d179 | ||
|
|
23e0c5a9c8 | ||
|
|
b907606818 | ||
|
|
05ab00e134 | ||
|
|
8617646685 | ||
|
|
ae6a2fafa3 | ||
|
|
740f440400 | ||
|
|
c335d7b082 | ||
|
|
2d20a13d7d | ||
|
|
4fc20b6d4f | ||
|
|
bba4b6028e | ||
|
|
40d468b433 | ||
|
|
890b05d352 | ||
|
|
cfcc374a69 | ||
|
|
882c04a6bf | ||
|
|
5c609ddd42 | ||
|
|
e22078b34a | ||
|
|
f2f5227384 | ||
|
|
4577adc53f | ||
|
|
5f41530745 | ||
|
|
733246b059 | ||
|
|
2347adc56f | ||
|
|
934ce73d01 | ||
|
|
c3dd5dda65 | ||
|
|
0f4b895d38 |
96
README.org
@@ -1,87 +1,13 @@
|
|||||||
* Installing
|
* NixOS
|
||||||
|
** [[file:docs/install.org][Installing]]
|
||||||
** Fresh system (nixos USB drive)
|
*** Rebuilding
|
||||||
|
|
||||||
1. Open a nix-shell with git:
|
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
nix-shell -p git
|
sudo nixos-rebuild switch --impure --flake ".#${HOST}"
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Clone the flake
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
git clone https://git.lajuntament.space/marc/samfelag.git
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Partition the disk
|
|
||||||
1. Locate the disk
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
lsblk
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Create a GPT partition table
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
sudo parted /dev/nvme0n1 -- mklabel gpt
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Create the root partition
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
sudo parted /dev/nvme0n1 -- mkpart primary 512MB -8GB
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Create the swap partition
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
sudo parted /dev/nvme0n1 -- mkpart primary linux-swap -8GB 100%
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Create the boot partition
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
sudo parted /dev/nvme0n1 -- mkpart ESP fat32 1MB 512MB
|
|
||||||
sudo parted /dev/nvme0n1 -- set 3 esp on
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Format the partitions
|
|
||||||
1. Root partition
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
sudo mkfs.ext4 -L nixos /dev/nvme0n1p1
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Swap partition
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
sudo mkswap -L swap /dev/nvme0n1p2
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Boot partition
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
sudo mkfs.fat -F 32 -n BOOT /dev/nvme0n1p3
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Mount the filesystems
|
|
||||||
1. Root partition
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
sudo mount /dev/disk/by-label/nixos /mnt
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Boot partition
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
sudo mkdir -p /mnt/boot
|
|
||||||
sudo mount /dev/disk/by-label/BOOT /mnt/boot
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Swap partition (if needed)
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
sudo swapon /dev/disk/by-label/swap
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Create the host nix configuration
|
|
||||||
If the host is not present under system/hosts, create a new folder for the host.
|
|
||||||
Generate the hardware configuration file, you can use nixos-generate-config as a base:
|
|
||||||
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
nixos-generate-config --dir <<host directory>> --no-filesystems
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
1. Install nixos!
|
|
||||||
|
|
||||||
#+BEGIN_SRC bash
|
|
||||||
sudo nixos-install --impure --root /mnt --flake .#reykjavik
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
** Modules
|
||||||
|
*** Desktop environment
|
||||||
|
**** Themeing
|
||||||
|
We use [[https://github.com/Misterio77/nix-colors][nix-colors]] to (try to) keep a consistent theme across all applications. This uses [[https://github.com/chriskempson/base16][base-16 themes]] (here is a [[https://github.com/chriskempson/base16/blob/main/styling.md][styiling guide]] for it).
|
||||||
|
* Samfelag Mesh
|
||||||
|
** [[file:docs/hosts.org][Hosts]]
|
||||||
|
** [[file:docs/consul.org][Consul]]
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
font:
|
|
||||||
normal:
|
|
||||||
family: Iosevka Nerd Font
|
|
||||||
style: Regular
|
|
||||||
12
config/alacritty/alacritty.toml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[general]
|
||||||
|
import = ["~/.config/alacritty/theme.toml"]
|
||||||
|
|
||||||
|
[font]
|
||||||
|
size = 12
|
||||||
|
|
||||||
|
[font.normal]
|
||||||
|
family = "Iosevka Nerd Font"
|
||||||
|
style = "Regular"
|
||||||
|
|
||||||
|
[window]
|
||||||
|
opacity = 0.85
|
||||||
15
config/consul.d/client.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"tls": {
|
||||||
|
"defaults": {
|
||||||
|
"verify_incoming": false,
|
||||||
|
"verify_outgoing": true,
|
||||||
|
"ca_file": "/etc/consul.d/certs/consul-agent-ca.pem"
|
||||||
|
},
|
||||||
|
"internal_rpc": {
|
||||||
|
"verify_server_hostname": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"auto_encrypt": {
|
||||||
|
"tls": true
|
||||||
|
}
|
||||||
|
}
|
||||||
25
config/consul.d/common.json
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"datacenter": "samfelag",
|
||||||
|
|
||||||
|
"bind_addr": "{{ GetInterfaceIP \"tailscale0\" }}",
|
||||||
|
"advertise_addr": "{{ GetInterfaceIP \"tailscale0\" }}",
|
||||||
|
"client_addr": "{{ GetInterfaceIP \"tailscale0\" }} 127.0.0.1",
|
||||||
|
|
||||||
|
"ports": {
|
||||||
|
"grpc_tls": 8502
|
||||||
|
},
|
||||||
|
|
||||||
|
"acl": {
|
||||||
|
"enabled": true,
|
||||||
|
"default_policy": "allow",
|
||||||
|
"enable_token_persistence": true
|
||||||
|
},
|
||||||
|
|
||||||
|
"connect": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
|
||||||
|
"performance": {
|
||||||
|
"raft_multiplier": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
5
config/consul.d/server-list.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"retry_join": [
|
||||||
|
"100.99.167.21"
|
||||||
|
]
|
||||||
|
}
|
||||||
22
config/consul.d/server.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"server": true,
|
||||||
|
"bootstrap_expect": 1,
|
||||||
|
"ui_config": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"tls": {
|
||||||
|
"defaults": {
|
||||||
|
"verify_incoming": true,
|
||||||
|
"verify_outgoing": true,
|
||||||
|
"ca_file": "/etc/consul.d/certs/consul-agent-ca.pem",
|
||||||
|
"cert_file": "/etc/consul.d/certs/samfelag-server-consul.pem",
|
||||||
|
"key_file": "/etc/consul.d/certs/samfelag-server-consul-key.pem"
|
||||||
|
},
|
||||||
|
"internal_rpc": {
|
||||||
|
"verify_server_hostname": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"auto_encrypt": {
|
||||||
|
"allow_tls": true
|
||||||
|
}
|
||||||
|
}
|
||||||
162
config/doom/config.el
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Some functionality uses this to identify you, e.g. GPG configuration, email
|
||||||
|
;; clients, file templates and snippets.
|
||||||
|
(setq user-full-name "Marc Sastre Rienitz"
|
||||||
|
user-mail-address "marc@sastre.cat")
|
||||||
|
|
||||||
|
;; 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'.
|
||||||
|
(setq display-line-numbers-type t)
|
||||||
|
|
||||||
|
;; Fonts
|
||||||
|
(setq doom-font (font-spec :family "Iosevka Nerd Font" :size 18))
|
||||||
|
(setq doom-symbol-font (font-spec :family "Iosevka Nerd Font" :size 18))
|
||||||
|
(setq doom-emoji-font (font-spec :family "Noto Color Emoji" :size 18))
|
||||||
|
|
||||||
|
;; Themeing
|
||||||
|
(use-package base16-theme
|
||||||
|
:init (add-to-list 'custom-theme-load-path "~/.config/doom/themes")
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(load-theme 'base16-samfelag t))
|
||||||
|
;; (after! doom-themes
|
||||||
|
;; (load-theme 'doom-nano-dark t))
|
||||||
|
|
||||||
|
;; (use-package! doom-nano-modeline
|
||||||
|
;; :config
|
||||||
|
;; (doom-nano-modeline-mode 1)
|
||||||
|
;; (global-hide-mode-line-mode 1))
|
||||||
|
|
||||||
|
;; Here are some additional functions/macros that could 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.
|
||||||
|
;;
|
||||||
|
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
||||||
|
;; they are implemented.
|
||||||
|
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
(setq-default tab-width 4)
|
||||||
|
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; Emojify
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
(use-package! emojify
|
||||||
|
:config
|
||||||
|
(when (member "Noto Color Emoji" (font-family-list))
|
||||||
|
(set-fontset-font
|
||||||
|
t 'emoji (font-spec :family "Noto Color Emoji") nil 'prepend))
|
||||||
|
(setq emojify-display-style 'image)
|
||||||
|
(setq emojify-emoji-styles '(unicode)))
|
||||||
|
|
||||||
|
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; Projectile
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
(use-package projectile
|
||||||
|
:config
|
||||||
|
(setq projectile-project-search-path '("~/projects")))
|
||||||
|
|
||||||
|
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; vterm
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
(use-package vterm
|
||||||
|
:config
|
||||||
|
(setq vterm-shell "zsh"))
|
||||||
|
|
||||||
|
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; elisp
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
(use-package parinfer
|
||||||
|
:defer t)
|
||||||
|
|
||||||
|
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; LSP
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; (use-package lsp-mode
|
||||||
|
;; :init
|
||||||
|
;; :hook (;;
|
||||||
|
;; (clojure-mode . lsp-deferred)
|
||||||
|
;; (python-mode . lsp-deferred)
|
||||||
|
;; ;; if you want which-key integration
|
||||||
|
;; (lsp-mode . lsp-enable-which-key-integration))
|
||||||
|
;; :commands (lsp lsp-deferred))
|
||||||
|
|
||||||
|
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; Python
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
(defun my-python-mode-hook ()
|
||||||
|
"Do everything I need when entering python mode"
|
||||||
|
(setq fill-column 120)
|
||||||
|
(add-hook! 'before-save-hook :local #'py-autopep8-buffer #'py-isort-buffer)
|
||||||
|
;; accept underscore as part of a word
|
||||||
|
(superword-mode 1)
|
||||||
|
(modify-syntax-entry ?_ "w" python-mode-syntax-table))
|
||||||
|
|
||||||
|
(add-hook 'python-mode-hook 'my-python-mode-hook)
|
||||||
|
|
||||||
|
(use-package py-autopep8
|
||||||
|
:config
|
||||||
|
(setq py-autopep8-options '("--max-line-length=120")))
|
||||||
|
|
||||||
|
(use-package pipenv
|
||||||
|
:config
|
||||||
|
(setq pipenv-with-projectile t)
|
||||||
|
(setenv "PIPENV_MAX_DEPTH" "10"))
|
||||||
|
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; Web (HTML + CSS)
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; (use-package! lsp-tailwindcss)
|
||||||
|
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; Org
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
(setq org-directory "~/org")
|
||||||
|
(setq org-agenda-files (directory-files-recursively "~/org/agenda" "\\.org$"))
|
||||||
|
|
||||||
|
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; Agenix
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
(load! "modules/agenix.el")
|
||||||
|
(setq agenix-age-program "age")
|
||||||
|
(setq agenix-agenix-program "agenix")
|
||||||
|
|
||||||
|
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
;; Appearance - Prettify
|
||||||
|
;; -----------------------------------------------------------------------------
|
||||||
|
(load! "modules/prettify-utils.el")
|
||||||
|
|
||||||
|
(pretty-hook python-mode
|
||||||
|
("def" " ")
|
||||||
|
("class" "𝙘")
|
||||||
|
("None" "∅")
|
||||||
|
("lambda" "λ")
|
||||||
|
("not in" "∉")
|
||||||
|
("in" "∈"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(pretty-hook emacs-lisp-mode)
|
||||||
|
;; ("defun" "𝙛")
|
||||||
|
|
||||||
|
;; (pretty-hook org-mode
|
||||||
|
;; ("[ ]" "☐")
|
||||||
|
;; ("[X]" "☑"))
|
||||||
12
config/doom/custom.el
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
(custom-set-variables
|
||||||
|
;; custom-set-variables was added by Custom.
|
||||||
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
|
;; Your init file should contain only one such instance.
|
||||||
|
;; If there is more than one, they won't work right.
|
||||||
|
'(safe-local-variable-values '((cider-shadow-cljs-default-options . "app"))))
|
||||||
|
(custom-set-faces
|
||||||
|
;; custom-set-faces was added by Custom.
|
||||||
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
|
;; Your init file should contain only one such instance.
|
||||||
|
;; If there is more than one, they won't work right.
|
||||||
|
)
|
||||||
190
config/doom/init.el
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
;;; 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 "Module Index" link where you'll find
|
||||||
|
;; a comprehensive list of Doom's modules and 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
|
||||||
|
;;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
|
||||||
|
|
||||||
|
: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) ; 🙂
|
||||||
|
;; fill-column ; a `fill-column' indicator
|
||||||
|
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
||||||
|
;;hydra
|
||||||
|
;;indent-guides ; highlighted indent columns
|
||||||
|
(ligatures
|
||||||
|
+iosevka) ; 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 ; 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 +onsave) ; 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 ; tasing you for misspelling mispelling
|
||||||
|
;;grammar ; tasing grammar mistake every you make
|
||||||
|
|
||||||
|
:tools
|
||||||
|
;;ansible
|
||||||
|
;;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 +eglot)
|
||||||
|
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
|
||||||
|
;;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...
|
||||||
|
;;cc ; C/C++/Obj-C madness
|
||||||
|
(clojure
|
||||||
|
+lsp) ; 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
|
||||||
|
;;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
|
||||||
|
;;faust ; dsp, but you get to keep your soul
|
||||||
|
;;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
|
||||||
|
;;(haskell +dante) ; 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 +meghanada) ; 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 ; writing papers in Emacs has never been so fun
|
||||||
|
;;lean
|
||||||
|
;;factor
|
||||||
|
;;ledger ; an accounting system in Emacs
|
||||||
|
;;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
|
||||||
|
+journal
|
||||||
|
+pretty) ; organize your plain life in plain text
|
||||||
|
php ; perl's insecure younger brother
|
||||||
|
;;plantuml ; diagrams for confusing people more
|
||||||
|
;;purescript ; javascript, but functional
|
||||||
|
(python
|
||||||
|
+lsp) ; 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) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
||||||
|
;;scala ; java, but good
|
||||||
|
;;scheme ; 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
|
||||||
|
|
||||||
|
:email
|
||||||
|
;;(mu4e +gmail)
|
||||||
|
;;notmuch
|
||||||
|
;;(wanderlust +gmail)
|
||||||
|
|
||||||
|
:app
|
||||||
|
;;calendar
|
||||||
|
;;irc ; how neckbeards socialize
|
||||||
|
;;(rss +org) ; emacs as an RSS reader
|
||||||
|
;;twitter ; twitter client https://twitter.com/vnought
|
||||||
|
|
||||||
|
:config
|
||||||
|
;;literate
|
||||||
|
(default +bindings +smartparens))
|
||||||
231
config/doom/modules/agenix.el
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
;;; agenix.el --- Decrypt and encrypt agenix secrets -*- lexical-binding: t -*-
|
||||||
|
|
||||||
|
;; Copyright (C) 2022-2023 Tomasz Maciosowski (t4ccer)
|
||||||
|
|
||||||
|
;; Author: Tomasz Maciosowski <t4ccer@gmail.com>
|
||||||
|
;; Maintainer: Tomasz Maciosowski <t4ccer@gmail.com>
|
||||||
|
;; Package-Requires: ((emacs "27.1"))
|
||||||
|
;; URL: https://github.com/t4ccer/agenix.el
|
||||||
|
;; Version: 1.0
|
||||||
|
;;
|
||||||
|
;; Modified version by Marc Sastre that allows subdirectories in the secrets folder.
|
||||||
|
|
||||||
|
;; This file is NOT part of GNU Emacs.
|
||||||
|
|
||||||
|
;; This program is free software; you can redistribute it and/or modify
|
||||||
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
;; the Free Software Foundation, either version 3 of the License, or
|
||||||
|
;; (at your option) any later version.
|
||||||
|
|
||||||
|
;; This program is distributed in the hope that it will be useful,
|
||||||
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;; GNU General Public License for more details.
|
||||||
|
|
||||||
|
;; You should have received a copy of the GNU General Public License
|
||||||
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Fully transparent editing of agenix secrets. Open a file, edit it, save it and it will be
|
||||||
|
;; encrypted automatically.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(defcustom agenix-age-program "age"
|
||||||
|
"The age program."
|
||||||
|
:group 'agenix
|
||||||
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom agenix-key-files '("~/.ssh/id_ed25519" "~/.ssh/id_rsa")
|
||||||
|
"List of age key files."
|
||||||
|
:group 'agenix
|
||||||
|
:type '(repeat string))
|
||||||
|
|
||||||
|
(defcustom agenix-pre-mode-hook nil
|
||||||
|
"Hook to run before entering `agenix-mode'.
|
||||||
|
Can be used to set up age binary path."
|
||||||
|
:group 'agenix
|
||||||
|
:type 'hook)
|
||||||
|
|
||||||
|
(defvar-local agenix--encrypted-fp nil)
|
||||||
|
|
||||||
|
(defvar-local agenix--keys nil)
|
||||||
|
|
||||||
|
(defvar-local agenix--undo-list nil)
|
||||||
|
|
||||||
|
(defvar-local agenix--point nil)
|
||||||
|
|
||||||
|
(define-derived-mode agenix-mode text-mode "agenix"
|
||||||
|
"Major mode for agenix files.
|
||||||
|
Don't use directly, use `agenix-mode-if-with-secrets-nix' to ensure that
|
||||||
|
secrets.nix exists."
|
||||||
|
(read-only-mode 1)
|
||||||
|
|
||||||
|
(run-hooks 'agenix-pre-mode-hook)
|
||||||
|
|
||||||
|
(agenix-decrypt-buffer)
|
||||||
|
(goto-char (point-min))
|
||||||
|
(setq buffer-undo-list nil)
|
||||||
|
|
||||||
|
(setq require-final-newline nil)
|
||||||
|
(setq buffer-auto-save-file-name nil)
|
||||||
|
(setq write-contents-functions '(agenix-save-decrypted))
|
||||||
|
|
||||||
|
;; Reverting loads encrypted file back to the buffer, so we need to decrypt it
|
||||||
|
(add-hook 'after-revert-hook
|
||||||
|
(lambda () (when (eq major-mode 'agenix-mode) (agenix-decrypt-buffer)))))
|
||||||
|
|
||||||
|
|
||||||
|
(defun agenix--file-search-upward (directory file)
|
||||||
|
"Search DIRECTORY for FILE and return its full path if found, or NIL if not.
|
||||||
|
|
||||||
|
If FILE is not found in DIRECTORY, the parent of DIRECTORY will be searched."
|
||||||
|
(let ((parent-dir (file-truename (concat (file-name-directory directory) "../")))
|
||||||
|
(current-path (if (not (string= (substring directory (- (length directory) 1)) "/"))
|
||||||
|
(concat directory "/" file)
|
||||||
|
(concat directory file))))
|
||||||
|
(if (file-exists-p current-path)
|
||||||
|
current-path
|
||||||
|
(when (and (not (string= (file-truename directory) parent-dir))
|
||||||
|
(< (length parent-dir) (length (file-truename directory))))
|
||||||
|
(agenix--file-search-upward parent-dir file)))))
|
||||||
|
|
||||||
|
(defun agenix--secrets-nix-path ()
|
||||||
|
"Search for secrets.nix file in the current directory or any parent directory.
|
||||||
|
Return it if found"
|
||||||
|
(agenix--file-search-upward "./" "secrets.nix"))
|
||||||
|
|
||||||
|
(defun agenix--relative-buffer-path ()
|
||||||
|
"Return the filename of the current buffer relative to the secrets.nix path."
|
||||||
|
(file-relative-name
|
||||||
|
(buffer-file-name)
|
||||||
|
(file-name-directory (agenix--secrets-nix-path))))
|
||||||
|
|
||||||
|
(defun agenix--buffer-string* (buffer)
|
||||||
|
"Like `buffer-string' but read from BUFFER parameter."
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(buffer-substring-no-properties (point-min) (point-max))))
|
||||||
|
|
||||||
|
(defun agenix--with-temp-buffer (func)
|
||||||
|
"Like `with-temp-buffer' but doesn't actually switch the buffer.
|
||||||
|
FUNC takes a temporary buffer that will be disposed after the call."
|
||||||
|
(let* ((age-buf (generate-new-buffer "*age-buf*"))
|
||||||
|
(res (funcall func age-buf)))
|
||||||
|
(kill-buffer age-buf)
|
||||||
|
res))
|
||||||
|
|
||||||
|
(defun agenix--process-exit-code-and-output (program &rest args)
|
||||||
|
"Run PROGRAM with ARGS and return the exit code and output in a list."
|
||||||
|
(agenix--with-temp-buffer
|
||||||
|
(lambda (buf) (list (apply #'call-process program nil buf nil args)
|
||||||
|
(agenix--buffer-string* buf)))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun agenix-decrypt-buffer (&optional encrypted-buffer)
|
||||||
|
"Decrypt ENCRYPTED-BUFFER in place.
|
||||||
|
If ENCRYPTED-BUFFER is unset or nil, decrypt the current buffer."
|
||||||
|
(interactive
|
||||||
|
(when current-prefix-arg
|
||||||
|
(list (read-buffer "Encrypted buffer: " (current-buffer) t))))
|
||||||
|
|
||||||
|
(with-current-buffer (or encrypted-buffer (current-buffer))
|
||||||
|
(let* ((nix-res (apply #'agenix--process-exit-code-and-output "nix-instantiate"
|
||||||
|
(list "--strict" "--json" "--eval" "--expr"
|
||||||
|
(format
|
||||||
|
"(import %s).\"%s\".publicKeys"
|
||||||
|
(agenix--secrets-nix-path)
|
||||||
|
(agenix--relative-buffer-path)))))
|
||||||
|
(nix-exit-code (car nix-res))
|
||||||
|
(nix-output (car (cdr nix-res))))
|
||||||
|
|
||||||
|
(if (/= nix-exit-code 0)
|
||||||
|
(warn "Nix evaluation error.
|
||||||
|
Probably file %s is not declared as a secret in 'secrets.nix' file.
|
||||||
|
Error: %s" (buffer-file-name) nix-output)
|
||||||
|
(let* ((keys (json-parse-string nix-output :array-type 'list))
|
||||||
|
(age-flags (list "--decrypt")))
|
||||||
|
|
||||||
|
;; Add all user's keys to the age command
|
||||||
|
(dolist (key-path agenix-key-files)
|
||||||
|
(when (file-exists-p (expand-file-name key-path))
|
||||||
|
(setq age-flags
|
||||||
|
(nconc age-flags (list "--identity" (expand-file-name key-path))))))
|
||||||
|
|
||||||
|
;; Add file-path to decrypt to the age command
|
||||||
|
(setq age-flags (nconc age-flags (list (buffer-file-name))))
|
||||||
|
(setq agenix--encrypted-fp (buffer-file-name))
|
||||||
|
(setq agenix--keys keys)
|
||||||
|
|
||||||
|
;; Check if file already exists
|
||||||
|
(if (not (file-exists-p (buffer-file-name)))
|
||||||
|
(progn
|
||||||
|
(message "Not decrypting. File %s does not exist and will be created when you \
|
||||||
|
will save this buffer." (buffer-file-name))
|
||||||
|
(read-only-mode -1))
|
||||||
|
(let*
|
||||||
|
((age-res
|
||||||
|
(apply #'agenix--process-exit-code-and-output agenix-age-program age-flags))
|
||||||
|
(age-exit-code (car age-res))
|
||||||
|
(age-output (car (cdr age-res))))
|
||||||
|
|
||||||
|
(if (= 0 age-exit-code)
|
||||||
|
(progn
|
||||||
|
;; Replace buffer with decrypted content
|
||||||
|
(read-only-mode -1)
|
||||||
|
(erase-buffer)
|
||||||
|
(insert age-output)
|
||||||
|
|
||||||
|
;; Mark buffer as not modified
|
||||||
|
(set-buffer-modified-p nil)
|
||||||
|
(setq buffer-undo-list agenix--undo-list))
|
||||||
|
(error age-output))))
|
||||||
|
(when agenix--point
|
||||||
|
(goto-char agenix--point)))))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun agenix-save-decrypted (&optional unencrypted-buffer)
|
||||||
|
"Encrypt UNENCRYPTED-BUFFER back to the original .age file.
|
||||||
|
If UNENCRYPTED-BUFFER is unset or nil, use the current buffer."
|
||||||
|
(interactive
|
||||||
|
(when current-prefix-arg
|
||||||
|
(list (read-buffer "Unencrypted buffer: " (current-buffer) t))))
|
||||||
|
(with-current-buffer (or unencrypted-buffer (current-buffer))
|
||||||
|
(let* ((age-flags (list "--encrypt")))
|
||||||
|
(progn
|
||||||
|
(dolist (k agenix--keys)
|
||||||
|
(setq age-flags (nconc age-flags (list "--recipient" k))))
|
||||||
|
(setq age-flags (nconc age-flags (list "-o" agenix--encrypted-fp)))
|
||||||
|
(let* ((decrypted-text (buffer-string))
|
||||||
|
(age-res
|
||||||
|
(agenix--with-temp-buffer
|
||||||
|
(lambda (buf)
|
||||||
|
(list
|
||||||
|
(apply #'call-process-region
|
||||||
|
decrypted-text nil
|
||||||
|
agenix-age-program
|
||||||
|
nil
|
||||||
|
buf
|
||||||
|
t
|
||||||
|
age-flags)
|
||||||
|
(agenix--buffer-string* buf))))))
|
||||||
|
(when (/= 0 (car age-res))
|
||||||
|
(error (car (cdr age-res))))
|
||||||
|
(setq agenix--point (point))
|
||||||
|
(setq agenix--undo-list buffer-undo-list)
|
||||||
|
(revert-buffer :ignore-auto :noconfirm :preserve-modes)
|
||||||
|
(set-buffer-modified-p nil)
|
||||||
|
t)))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun agenix-mode-if-with-secrets-nix ()
|
||||||
|
"Enable `agenix-mode' if the current buffer is in a directory with secrets.nix."
|
||||||
|
(interactive)
|
||||||
|
(when (agenix--secrets-nix-path)
|
||||||
|
(agenix-mode)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.age\\'" . agenix-mode-if-with-secrets-nix))
|
||||||
|
|
||||||
|
(provide 'agenix)
|
||||||
|
;;; agenix.el ends here
|
||||||
227
config/doom/modules/prettify-utils.el
Normal file
@@ -0,0 +1,227 @@
|
|||||||
|
;;; prettify-utils.el --- Helper functions for prettify-symbols-mode -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Copyright © 2016 Ilazki
|
||||||
|
|
||||||
|
;; Author: Ilazki
|
||||||
|
;; Created: 31 Oct 2016
|
||||||
|
;; URL: https://github.com/Ilazki/prettify-utils.el
|
||||||
|
;; Keywords: lisp tools prettify utils prettify-symbols
|
||||||
|
;; Version: 1.0.2
|
||||||
|
;; Package-Version: 20161110.0430
|
||||||
|
;; Package-Requires: ((emacs "24.4"))
|
||||||
|
|
||||||
|
;; This file is not part of GNU Emacs.
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Prettify-utils provides helper functions to simplify configuration of emacs'
|
||||||
|
;; prettify-symbols-mode. For the unfamiliar, prettify-symbols-mode detects
|
||||||
|
;; user-defined character combinations and replaces them with different ones
|
||||||
|
;; (usually ligatures) on-screen without changing the source file. For example,
|
||||||
|
;; it can be used to display "≥" any time ">=" is found.
|
||||||
|
;;
|
||||||
|
;; Unfortunately, setup of prettify-symbols-mode is more complicated than it
|
||||||
|
;; needs to be, especially if you want the replacement string to be multiple
|
||||||
|
;; characters instead of just one. For example, displaying "→ " for "->" in
|
||||||
|
;; order to improve appearance while still preserving the real character length.
|
||||||
|
;;
|
||||||
|
;; To use prettify-symbols, you have to set a buffer-local variable,
|
||||||
|
;; prettify-symbols-alist, to an alist containing string/replacement pairs. This
|
||||||
|
;; package provides a helper macro, prettify-utils-generate, to create the alist
|
||||||
|
;; in a simple, uniform manner, like so:
|
||||||
|
;;
|
||||||
|
;; (setq prettify-symbols-alist
|
||||||
|
;; (prettify-utils-generate
|
||||||
|
;; ("lambda" "λ")
|
||||||
|
;; ("<=" "≤")
|
||||||
|
;; (">=" "≥")
|
||||||
|
;; ("->" "→ ")))
|
||||||
|
;;
|
||||||
|
;;
|
||||||
|
;; Since prettify-symbols uses buffer-local settings, you have to add the alist
|
||||||
|
;; for each buffer. The easiest way to do this is to add it to a mode's hooks.
|
||||||
|
;; Example:
|
||||||
|
;;
|
||||||
|
;; (add-hook 'prog-mode-hook (lambda ()
|
||||||
|
;; (setq prettify-symbols-alist
|
||||||
|
;; (prettify-utils-generate
|
||||||
|
;; ("lambda" "λ")))
|
||||||
|
;; (prettify-symbols-mode 1)))
|
||||||
|
;;
|
||||||
|
;; For convenience, a macro named pretty-hook is also available
|
||||||
|
;; that generates the above automatically.
|
||||||
|
;; Example:
|
||||||
|
;;
|
||||||
|
;; (pretty-hook prog-mode-hook
|
||||||
|
;; ("lambda" "λ")))
|
||||||
|
;;
|
||||||
|
;; Or, if you're using the same alist for multiple modes, you can create a named
|
||||||
|
;; function and pass that to the mode hooks:
|
||||||
|
;;
|
||||||
|
;; (defun my-symbols-alist ()
|
||||||
|
;; (setq prettify-symbols-alist
|
||||||
|
;; (prettify-utils-generate
|
||||||
|
;; ("lambda" "λ")
|
||||||
|
;; ("->" "→")
|
||||||
|
;; ("=>" "⇒"))))
|
||||||
|
;; (add-hook 'prog-mode-hook 'my-symbols-alist)
|
||||||
|
;;
|
||||||
|
;; Generally, prettify-utils-generate and pretty-hook should be the
|
||||||
|
;; only things needed, but some additional helpers are provided in case a need
|
||||||
|
;; arises:
|
||||||
|
;;
|
||||||
|
;; * prettify-utils-generate-f is the function equivalent of using
|
||||||
|
;; prettify-utils-generate. Should only be needed for creating higher-order
|
||||||
|
;; functions.
|
||||||
|
;; * prettify-utils-create-pair is the function used by other functions to create
|
||||||
|
;; alist pairs.
|
||||||
|
;; * prettify-utils-string converts a string into the list format required by
|
||||||
|
;; prettify-symbols-alist.
|
||||||
|
;;
|
||||||
|
;; For more information about any functions or macros provided, as well as
|
||||||
|
;; additional example use, refer to any function's docstring with
|
||||||
|
;; `M-x describe-function`.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(provide 'prettify-utils)
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun prettify-utils--list (l &optional glue)
|
||||||
|
"Takes two lists and interleaves the (optional) second between each element of
|
||||||
|
the first. Used to create multi-character sequences for use with the minor mode
|
||||||
|
`prettify-symbols-mode'. If not supplied, GLUE defaults to '(Br . Bl). For more
|
||||||
|
information about GLUE, refer to the documentation for the `compose-region'
|
||||||
|
function and the `reference-point-alist' variable.
|
||||||
|
This function is used by `prettify-utils-string' to create the lists given to
|
||||||
|
`prettify-symbols-alist'. Calling prettify-utils--list directly is probably not
|
||||||
|
what you want, check the documentation for `prettify-utils-string' and
|
||||||
|
`prettify-utils-generate' instead.
|
||||||
|
Example use:
|
||||||
|
(prettify-utils--list (string-to-list \"hello\") '(Br . Bl))
|
||||||
|
"
|
||||||
|
|
||||||
|
(let ((glue (or glue '(Br . Bl)))
|
||||||
|
(head (car l))
|
||||||
|
(tail (cdr l)))
|
||||||
|
(cond
|
||||||
|
((not (consp l)) '())
|
||||||
|
((not (consp tail)) (list head))
|
||||||
|
(t (cons head
|
||||||
|
(cons glue
|
||||||
|
(prettify-utils--list tail glue)))))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun prettify-utils-string (s &optional glue)
|
||||||
|
"Takes a string and an optional list, and returns a list of the string's
|
||||||
|
characters with GLUE interleaved between each character, for use with
|
||||||
|
`prettify-symbols-mode'. If no GLUE is supplied, uses the
|
||||||
|
`prettify-utils--list' default. For more information about GLUE, refer to the
|
||||||
|
documentation for the `compose-region' function and the `reference-point-alist'
|
||||||
|
variable.
|
||||||
|
This function can be used to simplify multiple-character replacements when
|
||||||
|
manually constructing a `prettify-symbols-alist'. For something more high-level,
|
||||||
|
consider using `prettify-utils-generate' to create the entire alist instead.
|
||||||
|
Example:
|
||||||
|
(prettify-utils-string \"example\" '(Br . Bl))
|
||||||
|
"
|
||||||
|
(prettify-utils--list (append s nil) glue))
|
||||||
|
|
||||||
|
;; Was used during macro creation then removed
|
||||||
|
(defun prettify-utils-create-pair (old new &optional glue)
|
||||||
|
"Takes two strings, OLD and NEW, and an optional GLUE list, and creates an
|
||||||
|
alist pair for use when creating a `prettify-symbols-alist'. For more information
|
||||||
|
about GLUE, refer to the documentation for the `compose-region' function and the
|
||||||
|
`reference-point-alist' variable.
|
||||||
|
This function is primarily for use by the user-friendly `prettify-utils-generate'
|
||||||
|
macro, but may be useful if manual alist creation is desired for some reason.
|
||||||
|
Example:
|
||||||
|
(setq prettify-symbols-alist `((\">=\" ?≥)
|
||||||
|
,(prettify-utils-create-pair \"foo\" \"bar\" '(Br . Bl))))
|
||||||
|
"
|
||||||
|
(cons old (prettify-utils-string new glue)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defmacro prettify-utils-generate (&rest lists)
|
||||||
|
"Generates an alist for use when setting `prettify-symbols-alist'. Takes one or
|
||||||
|
more LISTS, each consisting of two strings and an optional GLUE list to be
|
||||||
|
interleaved between characters in the replacement list. If the optional GLUE
|
||||||
|
list is not supplied, uses the `prettify-utils--list' default of '(Br . Bl). For more
|
||||||
|
information about GLUE, refer to the documentation for the `compose-region'
|
||||||
|
function and the `reference-point-alist' variable.
|
||||||
|
Example #1:
|
||||||
|
(setq prettify-symbols-alist
|
||||||
|
(prettify-utils-generate (\"foo\" \"bar\")
|
||||||
|
(\">=\" \"≥\" (Br . Bl))
|
||||||
|
(\"->\" \"→ \")))
|
||||||
|
Example #2:
|
||||||
|
(setq prettify-symbols-alist
|
||||||
|
(prettify-utils-generate
|
||||||
|
(\"lambda\" \"λ\")
|
||||||
|
(\"|>\" \"▷\")
|
||||||
|
(\"<|\" \"◁\")
|
||||||
|
(\"->>\" \"↠ \")
|
||||||
|
(\"->\" \"→ \")
|
||||||
|
(\"<-\" \"← \")
|
||||||
|
(\"=>\" \"⇒\")
|
||||||
|
(\"<=\" \"≤\")
|
||||||
|
(\">=\" \"≥\")))
|
||||||
|
"
|
||||||
|
(let* ((head (car lists))
|
||||||
|
(tail (cdr lists))
|
||||||
|
(old-string (car head))
|
||||||
|
(new-string (cadr head))
|
||||||
|
(glue-list (caddr head)))
|
||||||
|
(if (not (consp head))
|
||||||
|
'()
|
||||||
|
`(cons (quote ,(prettify-utils-create-pair old-string new-string glue-list))
|
||||||
|
(prettify-utils-generate ,@tail)))))
|
||||||
|
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun prettify-utils-generate-f (&rest lists)
|
||||||
|
"Generates an alist for use when setting `prettify-symbols-alist'. Takes one or
|
||||||
|
more LISTS, each consisting of two strings and an optional GLUE list to be
|
||||||
|
interleaved between characters in the replacement list. If the optional GLUE
|
||||||
|
list is not supplied, uses the `prettify-utils--list' default of '(Br . Bl). For more
|
||||||
|
information about GLUE, refer to the documentation for the `compose-region'
|
||||||
|
function and the `reference-point-alist' variable.
|
||||||
|
This is a function equivalent of the `prettify-utils-generate' macro. Unless
|
||||||
|
you specifically need a function, such as for use with a higher-order function,
|
||||||
|
you should use the `prettify-utils-generate' macro instead.
|
||||||
|
Example:
|
||||||
|
(prettify-utils-generate-f '(\"foo\" \"bar\")
|
||||||
|
'(\">=\" \"≥\" (Br . Bl))
|
||||||
|
'(\"->\" \"→ \"))
|
||||||
|
"
|
||||||
|
(let* ((head (car lists))
|
||||||
|
(tail (cdr lists))
|
||||||
|
(old-string (car head))
|
||||||
|
(new-string (cadr head))
|
||||||
|
(glue-list (caddr head)))
|
||||||
|
(if (not (consp head))
|
||||||
|
'()
|
||||||
|
(cons (prettify-utils-create-pair old-string new-string glue-list)
|
||||||
|
(apply 'prettify-utils-generate-f tail)))))
|
||||||
|
|
||||||
|
;; Macro based on a suggestion and example code by reddit user /u/Kungsgeten
|
||||||
|
;; Github @ https://github.com/Kungsgeten/
|
||||||
|
;;;###autoload
|
||||||
|
(defmacro pretty-hook (mode &rest lists)
|
||||||
|
"Convenience macro for the most likely use case of prettify-utils: using
|
||||||
|
`add-hook' to add LISTS to MODE. LISTS consists of one or more lists of
|
||||||
|
replacements, defined as expected by `prettify-utils-generate'.
|
||||||
|
Example:
|
||||||
|
;; Replace org-mode checkboxes with appropriate unicode boxes
|
||||||
|
(pretty-hook org-mode
|
||||||
|
(\"[ ]\" \"☐\")
|
||||||
|
(\"[X]\" \"☑\")
|
||||||
|
(\"[-]\" \"❍\"))
|
||||||
|
"
|
||||||
|
`(add-hook ',(intern (concat (symbol-name mode) "-hook"))
|
||||||
|
(lambda ()
|
||||||
|
(setq prettify-symbols-alist
|
||||||
|
(prettify-utils-generate ,@lists))
|
||||||
|
(prettify-symbols-mode 1))))
|
||||||
|
|
||||||
|
;;; prettify-utils.el ends here
|
||||||
82
config/doom/packages.el
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
;; -*- no-byte-compile: t; -*-
|
||||||
|
|
||||||
|
;; 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/raxod502/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 raxod502/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)
|
||||||
|
|
||||||
|
(package! base16-theme)
|
||||||
|
(package! parinfer)
|
||||||
|
|
||||||
|
;; Env
|
||||||
|
(package! inheritenv)
|
||||||
|
|
||||||
|
;; Editor
|
||||||
|
(package! dot-mode)
|
||||||
|
|
||||||
|
;; Python
|
||||||
|
(package! py-autopep8)
|
||||||
|
|
||||||
|
;; Web (HTML + CSS)
|
||||||
|
(package! lsp-tailwindcss :recipe (:host github :repo "merrickluo/lsp-tailwindcss"))
|
||||||
|
|
||||||
|
;; Org
|
||||||
|
|
||||||
|
;; Org-Roam UI
|
||||||
|
; (unpin! org-roam)
|
||||||
|
; (package! websocket)
|
||||||
|
; (package! org-roam-ui :recipe (:host github :repo "org-roam/org-roam-ui" :files ("*.el" "out")))
|
||||||
|
|
||||||
|
(package! doom-nano-modeline
|
||||||
|
:recipe (:host github
|
||||||
|
:repo "ronisbr/doom-nano-modeline"))
|
||||||
|
|
||||||
|
;; Agenix
|
||||||
|
;; (package! agenix
|
||||||
|
;; :recipe (:host github
|
||||||
|
;; :repo "t4ccer/agenix.el"
|
||||||
|
;; :branch "main"
|
||||||
|
;; :files ("*.el")))
|
||||||
149
config/eww/bars/top-bar.scss
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
*{
|
||||||
|
all: unset;
|
||||||
|
font-family: Iosevka;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Top bar **/
|
||||||
|
.top-bar {
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
tooltip.background {
|
||||||
|
background-color: $base00;
|
||||||
|
border-radius: 10px;
|
||||||
|
color: $base07;
|
||||||
|
}
|
||||||
|
|
||||||
|
tooltip label {
|
||||||
|
margin: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.module {
|
||||||
|
margin: 0px 0px 0px 0px;
|
||||||
|
border-radius: 0px 0px 0px 0px;
|
||||||
|
padding-left: 8px;
|
||||||
|
padding-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
font-size: 24px;
|
||||||
|
padding-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.separator {
|
||||||
|
padding-left: 4px;
|
||||||
|
padding-right: 4px;
|
||||||
|
color: $base02;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Bluetooth **/
|
||||||
|
.bluetooth {
|
||||||
|
color: $base0D;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bluetooth.icon {
|
||||||
|
padding-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bluetooth-text {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Wifi **/
|
||||||
|
.wifi {
|
||||||
|
color: $base0D;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wifi.icon {
|
||||||
|
padding-right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wifi-text {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Volume **/
|
||||||
|
.volume {
|
||||||
|
color: $base0A;
|
||||||
|
}
|
||||||
|
|
||||||
|
.volume-mute {
|
||||||
|
color: $base04;
|
||||||
|
}
|
||||||
|
|
||||||
|
.volume-bar {
|
||||||
|
padding-left: 8px;
|
||||||
|
highlight {
|
||||||
|
background-color: $base0A;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
trough {
|
||||||
|
background-color: $base04;
|
||||||
|
min-height: 10px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Battery **/
|
||||||
|
.battery.charging {
|
||||||
|
color: $base0B;
|
||||||
|
}
|
||||||
|
|
||||||
|
.battery.discharging {
|
||||||
|
padding-right: 0px;
|
||||||
|
color: $base04;
|
||||||
|
}
|
||||||
|
|
||||||
|
.battery-bar {
|
||||||
|
padding-left: 8px;
|
||||||
|
progress {
|
||||||
|
background-color: $base0B;
|
||||||
|
border-radius: 10px;
|
||||||
|
min-height: 10px;
|
||||||
|
}
|
||||||
|
trough {
|
||||||
|
background-color: $base04;
|
||||||
|
border-radius: 10px;
|
||||||
|
min-height: 10px;
|
||||||
|
min-width: 60px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Clock **/
|
||||||
|
.clock {
|
||||||
|
color: $base05;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clock-time {
|
||||||
|
padding-left: 4px;
|
||||||
|
padding-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clock-date {
|
||||||
|
padding-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clock-year {
|
||||||
|
padding-bottom: 8px;
|
||||||
|
font-size: 75%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Workspaces **/
|
||||||
|
|
||||||
|
.workspace-entry {
|
||||||
|
padding-left: 8px;
|
||||||
|
padding-right: 8px;
|
||||||
|
}
|
||||||
|
.workspace-entry.occupied {
|
||||||
|
color: $base06;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-entry.empty {
|
||||||
|
color: $base02;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-entry.current {
|
||||||
|
color: $base0C;
|
||||||
|
}
|
||||||
44
config/eww/bars/top-bar.yuck
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
(include "./widgets/common.yuck")
|
||||||
|
|
||||||
|
(include "./widgets/battery.yuck")
|
||||||
|
(include "./widgets/bluetooth.yuck")
|
||||||
|
(include "./widgets/clock.yuck")
|
||||||
|
(include "./widgets/volume.yuck")
|
||||||
|
(include "./widgets/workspaces.yuck")
|
||||||
|
(include "./widgets/wifi.yuck")
|
||||||
|
|
||||||
|
(defwindow top-bar
|
||||||
|
:monitor 0
|
||||||
|
:geometry (geometry :x "0%"
|
||||||
|
:y "8px"
|
||||||
|
:width "100%"
|
||||||
|
:height "40px"
|
||||||
|
:anchor "top center")
|
||||||
|
:stacking "fg"
|
||||||
|
:exclusive "true"
|
||||||
|
(box :class "top-bar"
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly "true"
|
||||||
|
(bar-left)
|
||||||
|
(bar-center)
|
||||||
|
(bar-right)))
|
||||||
|
|
||||||
|
(defwidget bar-left []
|
||||||
|
(box :halign "start"
|
||||||
|
:orientation "h"
|
||||||
|
(workspaces-module)))
|
||||||
|
|
||||||
|
(defwidget bar-center []
|
||||||
|
(box :halign "center"
|
||||||
|
:orientation "h"))
|
||||||
|
|
||||||
|
(defwidget bar-right []
|
||||||
|
(box :halign "end"
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly "false"
|
||||||
|
(bluetooth-module)
|
||||||
|
(wifi-module)
|
||||||
|
(battery-module)
|
||||||
|
(volume-module)
|
||||||
|
(sep)
|
||||||
|
(clock-module)))
|
||||||
2
config/eww/eww.scss
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
@import './colour-scheme.scss'
|
||||||
|
@import './bars/top-bar.scss'
|
||||||
1
config/eww/eww.yuck
Normal file
@@ -0,0 +1 @@
|
|||||||
|
(include "./bars/top-bar.yuck")
|
||||||
6
config/eww/scripts/get-active-workspace.sh
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'
|
||||||
|
|
||||||
|
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
|
||||||
|
stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'
|
||||||
7
config/eww/scripts/get-volume-info.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/env bash
|
||||||
|
|
||||||
|
amixer sget Master | \
|
||||||
|
grep 'Left:' | \
|
||||||
|
sed -e 's/[^[]*\[\([0-9]*\)%\][^[]\[\(\w*\)\]/{"volume": \1, "muted": \2}/' \
|
||||||
|
-e 's/on/false/' \
|
||||||
|
-e 's/off/true/'
|
||||||
8
config/eww/scripts/get-wifi-info.sh
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/env bash
|
||||||
|
|
||||||
|
CONN_INFO=$(nmcli -g in-use,ssid,signal dev wifi list | \
|
||||||
|
grep "^*" | \
|
||||||
|
sed -e 's/\*:\([^:]*\):\([0-9]*\)/ ,"ssid": "\1", "signal": \2/')
|
||||||
|
CONNECTED=$([[ -z $CONN_INFO ]] && echo "false" || echo "true")
|
||||||
|
|
||||||
|
echo "{\"connected\": \"$CONNECTED\"$CONN_INFO}"
|
||||||
11
config/eww/scripts/get-workspaces.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/env bash
|
||||||
|
|
||||||
|
spaces (){
|
||||||
|
WORKSPACE_WINDOWS=$(hyprctl workspaces -j | jq 'map({key: .id | tostring, value: .windows}) | from_entries')
|
||||||
|
seq 1 6 | jq --argjson windows "${WORKSPACE_WINDOWS}" --slurp -Mc 'map(tostring) | map({id: ., windows: ($windows[.]//0)})'
|
||||||
|
}
|
||||||
|
|
||||||
|
spaces
|
||||||
|
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
|
||||||
|
spaces
|
||||||
|
done
|
||||||
21
config/eww/widgets/battery.yuck
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
(defvar battery-reveal false)
|
||||||
|
|
||||||
|
(defwidget battery-module []
|
||||||
|
(eventbox :onhover "${EWW_CMD} update battery-reveal=true"
|
||||||
|
:onhoverlost "${EWW_CMD} update battery-reveal=false"
|
||||||
|
(box :class "module battery ${EWW_BATTERY.BAT0.status == "Discharging" ? "discharging" : "charging"}"
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly "false"
|
||||||
|
:tooltip "Battery: ${EWW_BATTERY.BAT0.capacity}%"
|
||||||
|
(label :text {EWW_BATTERY.BAT0.status == "Discharging" ?
|
||||||
|
EWW_BATTERY.BAT0.capacity < 10 ? "" : EWW_BATTERY.BAT0.capacity < 30 ? "" : EWW_BATTERY.BAT0.capacity < 70 ? "" : "" :
|
||||||
|
EWW_BATTERY.BAT0.capacity < 10 ? "" : EWW_BATTERY.BAT0.capacity < 30 ? "" : EWW_BATTERY.BAT0.capacity < 70 ? "" : ""}
|
||||||
|
:class "battery icon")
|
||||||
|
(revealer :transition "slideleft"
|
||||||
|
:duration "750ms"
|
||||||
|
:reveal {battery-reveal}
|
||||||
|
(progress :class "battery-bar"
|
||||||
|
:orientation "h"
|
||||||
|
:valign "center"
|
||||||
|
:width 60
|
||||||
|
:value {EWW_BATTERY.BAT0.capacity})))))
|
||||||
29
config/eww/widgets/bluetooth.yuck
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
(defvar bluetooth-reveal false)
|
||||||
|
(defpoll bluetooth-status
|
||||||
|
:initial ""
|
||||||
|
:interval "10s"
|
||||||
|
"bluetoothctl show | grep -q \"Powered: yes\" && { [[ $(bluetoothctl devices Connected) ]] && echo \"connected\" || echo \"on\"; } || echo \"off\"")
|
||||||
|
(defpoll bluetooth-devices
|
||||||
|
:initial ""
|
||||||
|
:interval "20s"
|
||||||
|
"for device in $(bluetoothctl devices Connected | grep Device | cut -d ' ' -f 2); do bluetoothctl info $device | grep \"Alias\" | cut -d ' ' -f 2-; done;")
|
||||||
|
|
||||||
|
|
||||||
|
(defwidget bluetooth-module []
|
||||||
|
(eventbox :onhover "${EWW_CMD} update bluetooth-reveal=true"
|
||||||
|
:onhoverlost "${EWW_CMD} update bluetooth-reveal=false"
|
||||||
|
:onclick "$HOME/.config/rofi/menus/bluetooth/bluetooth.sh &"
|
||||||
|
(box :class "module bluetooth"
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly "false"
|
||||||
|
:tooltip {bluetooth-status == "connected" ? bluetooth-devices :
|
||||||
|
bluetooth-status == "on" ? "Bluetooth: On" : "Bluetooth: Off"}
|
||||||
|
(label :text {bluetooth-status == "connected" ? "" :
|
||||||
|
bluetooth-status == "on" ? "" : ""}
|
||||||
|
:class "bluetooth icon")
|
||||||
|
(revealer :transition "slideleft"
|
||||||
|
:duration "750ms"
|
||||||
|
:reveal {bluetooth-reveal && winfo.connected}
|
||||||
|
(label :class "bluetooth-text"
|
||||||
|
:text {bluetooth-status == "connected" ? "Connected" :
|
||||||
|
bluetooth-status == "on" ? "On" : "Off"})))))
|
||||||
21
config/eww/widgets/clock.yuck
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
(defpoll clock-time :interval "1s" "date +\"%H:%M:%S\"")
|
||||||
|
(defpoll clock-date :interval "1m" "date +\"%d/%m\"")
|
||||||
|
(defpoll clock-year :interval "1h" "date +\"%Y\"")
|
||||||
|
(defvar date-reveal false)
|
||||||
|
|
||||||
|
(defwidget clock-module []
|
||||||
|
(eventbox :onhover "${EWW_CMD} update date-reveal=true"
|
||||||
|
:onhoverlost "${EWW_CMD} update date-reveal=false"
|
||||||
|
(box :class "module clock"
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly "false"
|
||||||
|
(label :text clock-time
|
||||||
|
:class "clock-time")
|
||||||
|
(revealer :transition "slideleft"
|
||||||
|
:duration "750ms"
|
||||||
|
:reveal {date-reveal}
|
||||||
|
(box :orientation "h"
|
||||||
|
(label :text clock-date
|
||||||
|
:class "clock-date")
|
||||||
|
(label :text clock-year
|
||||||
|
:class "clock-year"))))))
|
||||||
3
config/eww/widgets/common.yuck
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
(defwidget sep []
|
||||||
|
(label :text "|"
|
||||||
|
:class "separator"))
|
||||||
26
config/eww/widgets/volume.yuck
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
(defpoll vinfo
|
||||||
|
:initial "{\"volume\": 0, \"muted\": false}"
|
||||||
|
:interval "1s"
|
||||||
|
"bash ~/.config/eww/scripts/get-volume-info.sh")
|
||||||
|
(defvar volume-reveal false)
|
||||||
|
|
||||||
|
(defwidget volume-module []
|
||||||
|
(eventbox :onhover "${EWW_CMD} update volume-reveal=true"
|
||||||
|
:onhoverlost "${EWW_CMD} update volume-reveal=false"
|
||||||
|
(box :class "module volume"
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly false
|
||||||
|
:tooltip {vinfo.muted? "muted" : "Volume: ${vinfo.volume}%"}
|
||||||
|
(label :text {vinfo.muted ? "" : vinfo.volume < 10 ? "" : vinfo.volume < 70 ? "" : ""}
|
||||||
|
:class "volume icon ${vinfo.muted ? "volume-mute" : ""}")
|
||||||
|
(revealer :transition "slideleft"
|
||||||
|
:duration "750ms"
|
||||||
|
:reveal {volume-reveal && !vinfo.muted}
|
||||||
|
(scale :class "volume-bar"
|
||||||
|
:orientation "h"
|
||||||
|
:valign "center"
|
||||||
|
:width 60
|
||||||
|
:min 0
|
||||||
|
:max 101
|
||||||
|
:value {vinfo.volume}
|
||||||
|
:onchange "amixer sset Master {}% > /dev/null")))))
|
||||||
25
config/eww/widgets/wifi.yuck
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
(defvar wifi-reveal false)
|
||||||
|
(defpoll winfo
|
||||||
|
:initial "{\"connected\": \"false\"}"
|
||||||
|
:interval "10s"
|
||||||
|
"bash ~/.config/eww/scripts/get-wifi-info.sh")
|
||||||
|
|
||||||
|
|
||||||
|
(defwidget wifi-module []
|
||||||
|
(eventbox :onhover "${EWW_CMD} update wifi-reveal=true"
|
||||||
|
:onhoverlost "${EWW_CMD} update wifi-reveal=false"
|
||||||
|
:onclick "$HOME/.config/rofi/menus/wifi/wifi.sh &"
|
||||||
|
(box :class "module wifi"
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly "false"
|
||||||
|
:tooltip {winfo.connected ? "Signal: ${winfo.signal}%" : "Disconnected"}
|
||||||
|
(label :text { !winfo.connected ? "" :
|
||||||
|
winfo.signal < 25 ? "" :
|
||||||
|
winfo.signal < 50 ? "" :
|
||||||
|
winfo.signal < 75 ? "" : ""}
|
||||||
|
:class "wifi icon")
|
||||||
|
(revealer :transition "slideleft"
|
||||||
|
:duration "750ms"
|
||||||
|
:reveal {wifi-reveal && winfo.connected}
|
||||||
|
(label :class "wifi-text"
|
||||||
|
:text {winfo.connected ? winfo.ssid : "Disconnected"})))))
|
||||||
10
config/eww/widgets/workspaces.yuck
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces.sh")
|
||||||
|
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace.sh")
|
||||||
|
(defwidget workspaces-module []
|
||||||
|
(box :space-evenly true
|
||||||
|
(label :text "${workspaces}${current_workspace}"
|
||||||
|
:visible false)
|
||||||
|
(for workspace in workspaces
|
||||||
|
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||||
|
(label :text "${workspace.id == current_workspace ? "" : ""}"
|
||||||
|
:class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}")))))
|
||||||
72
config/grapheio/scripts/brightness.sh
Executable file
@@ -0,0 +1,72 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Dependencies:
|
||||||
|
# - amixer
|
||||||
|
# - pactl
|
||||||
|
# - jq
|
||||||
|
# - libnotify
|
||||||
|
|
||||||
|
ACTION=$1
|
||||||
|
|
||||||
|
get_brightness() {
|
||||||
|
brightnessctl | \
|
||||||
|
grep "Current brightness" | \
|
||||||
|
sed -e 's/^\s\+Current brightness: [0-9]\+ (\([0-9]\+\)%).*$/\1/'
|
||||||
|
}
|
||||||
|
|
||||||
|
get_kb_brightness() {
|
||||||
|
brightnessctl -d platform::kbd_backlight | \
|
||||||
|
grep "Current brightness" | \
|
||||||
|
sed -e 's/^\s\+Current brightness: [0-9]\+ (\([0-9]\+\)%).*$/\1/'
|
||||||
|
}
|
||||||
|
|
||||||
|
notify() {
|
||||||
|
notify-send "$1" "$2" -e -t 1500 -h string:x-canonical-private-synchronous:brightness
|
||||||
|
}
|
||||||
|
|
||||||
|
set_brightness() {
|
||||||
|
# Set the brightness
|
||||||
|
TARGET=$1
|
||||||
|
brightnessctl set $TARGET > /dev/null
|
||||||
|
|
||||||
|
# Send a notification
|
||||||
|
BRIGHTNESS=$(get_brightness)
|
||||||
|
ACTION=$([[ ${TARGET:0:1} == "+" ]] && echo "Brightness Up" || echo "Brightness Down")
|
||||||
|
|
||||||
|
BRIGHTNESS_ICON=""
|
||||||
|
|
||||||
|
TITLE=$(echo "$BRIGHTNESS_ICON $ACTION")
|
||||||
|
BODY=$(echo "$BRIGHTNESS%")
|
||||||
|
notify "$TITLE" "$BODY"
|
||||||
|
}
|
||||||
|
|
||||||
|
set_kb_brightness() {
|
||||||
|
# Set the brightness
|
||||||
|
TARGET=$1
|
||||||
|
brightnessctl -d platform::kbd_backlight set $TARGET > /dev/null
|
||||||
|
|
||||||
|
# Send a notification
|
||||||
|
BRIGHTNESS=$(get_kb_brightness)
|
||||||
|
ACTION=$([[ ${TARGET:0:1} == "+" ]] && echo "Keyboard brightness Up" || echo "Keyboard brightness Down")
|
||||||
|
|
||||||
|
BRIGHTNESS_ICON=""
|
||||||
|
|
||||||
|
TITLE=$(echo "$BRIGHTNESS_ICON $ACTION")
|
||||||
|
BODY=$(echo "$BRIGHTNESS%")
|
||||||
|
notify "$TITLE" "$BODY"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
case $ACTION in
|
||||||
|
set)
|
||||||
|
set_brightness $2
|
||||||
|
;;
|
||||||
|
kb_set)
|
||||||
|
set_kb_brightness $2
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown action"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
27
config/grapheio/scripts/screenshot.sh
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Dependencies:
|
||||||
|
# - slurp
|
||||||
|
# - grim
|
||||||
|
|
||||||
|
ACTION=$1
|
||||||
|
|
||||||
|
DATESTAMP=$(date +"%Y%m%d%H%M%S")
|
||||||
|
OUT_DIR="${HOME}/screenshots"
|
||||||
|
OUT_FILE="capture-${ACTION}-${DATESTAMP}.png"
|
||||||
|
|
||||||
|
case $ACTION in
|
||||||
|
region)
|
||||||
|
[[ ! -d "${OUT_DIR}" ]] && mkdir $OUT_DIR
|
||||||
|
slurp | grim -t png -g - "${OUT_DIR}/${OUT_FILE}"
|
||||||
|
;;
|
||||||
|
screen)
|
||||||
|
[[ ! -d "${OUT_DIR}" ]] && mkdir $OUT_DIR
|
||||||
|
grim -t png "${OUT_DIR}/${OUT_FILE}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown action"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
79
config/grapheio/scripts/volume.sh
Executable file
@@ -0,0 +1,79 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Dependencies:
|
||||||
|
# - amixer
|
||||||
|
# - pactl
|
||||||
|
# - jq
|
||||||
|
# - libnotify
|
||||||
|
|
||||||
|
ACTION=$1
|
||||||
|
|
||||||
|
get_volume_info() {
|
||||||
|
amixer sget Master | \
|
||||||
|
grep 'Left:' | \
|
||||||
|
sed -e 's/[^[]*\[\([0-9]*\)%\][^[]\[\(\w*\)\]/{"volume": \1, "muted": \2}/' \
|
||||||
|
-e 's/on/false/' \
|
||||||
|
-e 's/off/true/'
|
||||||
|
}
|
||||||
|
|
||||||
|
notify() {
|
||||||
|
notify-send "$1" "$2" -e -t 1500 -h string:x-canonical-private-synchronous:volume
|
||||||
|
}
|
||||||
|
|
||||||
|
mute() {
|
||||||
|
pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||||
|
|
||||||
|
VOLUME_INFO=$(get_volume_info)
|
||||||
|
VOLUME=$(echo $VOLUME_INFO | jq .volume)
|
||||||
|
if [ $(echo $VOLUME_INFO | jq .muted) == "true" ]
|
||||||
|
then
|
||||||
|
AUDIO_ICON=""
|
||||||
|
MUTED_STR="Muted"
|
||||||
|
BODY=""
|
||||||
|
else
|
||||||
|
AUDIO_ICON=""
|
||||||
|
MUTED_STR="Unmuted"
|
||||||
|
BODY=$(echo "$VOLUME%")
|
||||||
|
fi
|
||||||
|
|
||||||
|
TITLE=$(echo "$AUDIO_ICON $MUTED_STR")
|
||||||
|
notify "$TITLE" "$BODY"
|
||||||
|
}
|
||||||
|
|
||||||
|
set_volume() {
|
||||||
|
# Set the volume
|
||||||
|
TARGET=$1
|
||||||
|
pactl set-sink-volume @DEFAULT_SINK@ $TARGET
|
||||||
|
|
||||||
|
# Send a notification
|
||||||
|
VOLUME_INFO=$(get_volume_info)
|
||||||
|
ACTION=$([[ ${TARGET:0:1} == "+" ]] && echo "Volume Up" || echo "Volume Down")
|
||||||
|
VOLUME=$(echo $VOLUME_INFO | jq .volume)
|
||||||
|
|
||||||
|
if [ $(echo $VOLUME_INFO | jq .muted) == "true" ]
|
||||||
|
then
|
||||||
|
AUDIO_ICON=""
|
||||||
|
MUTED_STR="[muted]"
|
||||||
|
else
|
||||||
|
AUDIO_ICON=""
|
||||||
|
MUTED_STR=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
TITLE=$(echo "$AUDIO_ICON $ACTION")
|
||||||
|
BODY=$(echo "$VOLUME% $MUTED_STR")
|
||||||
|
notify "$TITLE" "$BODY"
|
||||||
|
}
|
||||||
|
|
||||||
|
case $ACTION in
|
||||||
|
mute)
|
||||||
|
mute
|
||||||
|
;;
|
||||||
|
set)
|
||||||
|
set_volume $2
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown action"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
70
config/kanata/kanata.kbd
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
(defcfg
|
||||||
|
linux-dev-names-exclude (
|
||||||
|
"ZSA Technology Labs Voyager"
|
||||||
|
"ZSA Technology Labs Voyager Consumer Control"
|
||||||
|
"ZSA Technology Labs Voyager Keyboard"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
(deflocalkeys-linux
|
||||||
|
ImpPt 99
|
||||||
|
º 41
|
||||||
|
' 12
|
||||||
|
¡ 13
|
||||||
|
` 26
|
||||||
|
+ 27
|
||||||
|
ñ 39
|
||||||
|
´ 40
|
||||||
|
ç 43
|
||||||
|
< 86
|
||||||
|
- 53
|
||||||
|
)
|
||||||
|
|
||||||
|
(defsrc
|
||||||
|
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ins ImpPt del home end pgup pgdn
|
||||||
|
º 1 2 3 4 5 6 7 8 9 0 ' ¡ Backspace nlck kp/ kp* kp-
|
||||||
|
tab q w e r t y u i o p ` + kp7 kp8 kp9
|
||||||
|
caps a s d f g h j k l ñ ´ ç ret kp4 kp5 kp6 kp+
|
||||||
|
lsft < z x c v b n m , . - rsft kp1 kp2 kp3
|
||||||
|
lctl lmet lalt spc ralt rctl up kp0 kp. kprt
|
||||||
|
left down rght
|
||||||
|
)
|
||||||
|
|
||||||
|
(defvar
|
||||||
|
tap-time 200
|
||||||
|
hold-time 250
|
||||||
|
)
|
||||||
|
|
||||||
|
(defalias
|
||||||
|
caps (tap-hold $tap-time $hold-time caps (layer-while-held layer1))
|
||||||
|
a (tap-hold $tap-time $hold-time a lalt)
|
||||||
|
s (tap-hold $tap-time $hold-time s lsft)
|
||||||
|
d (tap-hold $tap-time $hold-time d lmet)
|
||||||
|
f (tap-hold $tap-time $hold-time f lctl)
|
||||||
|
g (tap-hold $tap-time $hold-time g (layer-while-held layer1))
|
||||||
|
h (tap-hold $tap-time $hold-time h rctl)
|
||||||
|
j (tap-hold $tap-time $hold-time j rmet)
|
||||||
|
k (tap-hold $tap-time $hold-time k rsft)
|
||||||
|
l (tap-hold $tap-time $hold-time l ralt)
|
||||||
|
)
|
||||||
|
|
||||||
|
(deflayer base
|
||||||
|
esc mute vold volu - brdn brup - - - - - - ins ImpPt del home end pgup pgdn
|
||||||
|
º 1 2 3 4 5 6 7 8 9 0 ' ¡ Backspace nlck kp/ kp* kp-
|
||||||
|
tab q w e r t y u i o p ` + kp7 kp8 kp9
|
||||||
|
@caps @a @s @d @f @g @h @j @k @l ñ ´ ç ret kp4 kp5 kp6 kp+
|
||||||
|
lsft < z x c v b n m , . - rsft kp1 kp2 kp3
|
||||||
|
lctl lmet lalt spc ralt rctl up kp0 kp. kprt
|
||||||
|
left down rght
|
||||||
|
)
|
||||||
|
|
||||||
|
(deflayer layer1
|
||||||
|
_ f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 _ _ _ _ _ _ _
|
||||||
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||||
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||||
|
_ _ _ _ _ _ left down up right _ _ _ _ _ _ _ _
|
||||||
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||||
|
_ _ _ _ _ _ _ _ _ _
|
||||||
|
_ _ _
|
||||||
|
)
|
||||||
13
config/nomad.d/client.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"client": {
|
||||||
|
"enabled": true,
|
||||||
|
"network_interface": "tailscale0",
|
||||||
|
|
||||||
|
"options": {
|
||||||
|
"docker.volumes.enabled": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"consul": {
|
||||||
|
"address": "127.0.0.1:8500"
|
||||||
|
}
|
||||||
|
}
|
||||||
11
config/nomad.d/common.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"datacenter": "samfelag",
|
||||||
|
|
||||||
|
"bind_addr": "{{ GetInterfaceIP \"tailscale0\" }}",
|
||||||
|
|
||||||
|
"advertise": {
|
||||||
|
"http": "{{ GetInterfaceIP \"tailscale0\" }}",
|
||||||
|
"rpc": "{{ GetInterfaceIP \"tailscale0\" }}",
|
||||||
|
"serf": "{{ GetInterfaceIP \"tailscale0\" }}"
|
||||||
|
}
|
||||||
|
}
|
||||||
10
config/nomad.d/host-reykjavik.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"client": {
|
||||||
|
"host_volume": {
|
||||||
|
"test": {
|
||||||
|
"path": "/mnt/raid1/nomad_volumes/nextcloud/nextcloud",
|
||||||
|
"read_only": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
40
config/nomad.d/host-thingvellir.hcl
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
client {
|
||||||
|
# --- Network ---
|
||||||
|
|
||||||
|
host_network "public" {
|
||||||
|
interface = "ens3"
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Volumes ---
|
||||||
|
# DNS
|
||||||
|
host_volume "dns-pihole" {
|
||||||
|
path = "/var/lib/nomad_volumes/dns/pihole/etc-pihole"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
host_volume "dns-dnsmasq" {
|
||||||
|
path = "/var/lib/nomad_volumes/dns/pihole/etc-dnsmasq.d"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
# Caddy
|
||||||
|
host_volume "caddyfile" {
|
||||||
|
path = "/var/lib/nomad_volumes/caddy/Caddyfile"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
host_volume "caddy-data" {
|
||||||
|
path = "/var/lib/nomad_volumes/caddy/data"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
# Gitea
|
||||||
|
host_volume "gitea" {
|
||||||
|
path = "/mnt/vatnajokull/nomad_volumes/gitea/data"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
# Folkugat
|
||||||
|
host_volume "folkugat" {
|
||||||
|
path = "/var/lib/nomad_volumes/folkugat"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
}
|
||||||
6
config/nomad.d/server.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"server": {
|
||||||
|
"enabled": true,
|
||||||
|
"bootstrap_expect": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
54
config/polybar/bars/bars.ini
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
include-file = colours.ini
|
||||||
|
include-directory = modules
|
||||||
|
|
||||||
|
[bar/base]
|
||||||
|
dpi = 96
|
||||||
|
width = 100%
|
||||||
|
height = 32
|
||||||
|
offset-x = 0
|
||||||
|
offset-y = 0
|
||||||
|
|
||||||
|
font-0 = "Iosevka Nerd Font:size=10;2"
|
||||||
|
font-1 = "Iosevka Nerd Font:size=16;2"
|
||||||
|
font-2 = "Iosevka Nerd Font:size=20;4"
|
||||||
|
|
||||||
|
background = ${colours/bar.bg}
|
||||||
|
foreground = ${colours/bar.fg}
|
||||||
|
|
||||||
|
border-bottom-size = 5
|
||||||
|
border-top-size = 5
|
||||||
|
border-left-size = 10
|
||||||
|
border-right-size = 10
|
||||||
|
|
||||||
|
border-bottom-color = ${colours/bar.bg}
|
||||||
|
border-top-color = ${colours/bar.bg}
|
||||||
|
border-left-color = ${colours/bar.bg}
|
||||||
|
border-right-color = ${colours/bar.bg}
|
||||||
|
|
||||||
|
spacing = 0
|
||||||
|
padding-left = 0
|
||||||
|
padding-right = 0
|
||||||
|
module-margin-left = 0
|
||||||
|
|
||||||
|
separator = |
|
||||||
|
separator-padding = .5
|
||||||
|
separator-foreground = ${colours/bar.bg}
|
||||||
|
separator-background = ${colours/bar.bg}
|
||||||
|
|
||||||
|
[bar/bottom]
|
||||||
|
inherit = bar/base
|
||||||
|
bottom = true
|
||||||
|
|
||||||
|
modules-left = workspaces
|
||||||
|
modules-right = wireless bluetooth volume battery
|
||||||
|
|
||||||
|
tray-position = center
|
||||||
|
tray-maxsize = 28
|
||||||
|
|
||||||
|
[bar/top]
|
||||||
|
inherit = bar/base
|
||||||
|
bottom = false
|
||||||
|
|
||||||
|
modules-left = spotify
|
||||||
|
modules-center = date
|
||||||
|
modules-right = i3-mode
|
||||||
61
config/polybar/bars/colours.ini
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
[colours]
|
||||||
|
trans = #0000
|
||||||
|
white = #fff
|
||||||
|
black = #000
|
||||||
|
gray = #555
|
||||||
|
|
||||||
|
[colours/bar]
|
||||||
|
bg = ${colour-scheme.base00}
|
||||||
|
fg = ${colour-scheme.base05}
|
||||||
|
|
||||||
|
[colours/date]
|
||||||
|
bg = ${colour-scheme.base00}
|
||||||
|
fg = ${colour-scheme.base05}
|
||||||
|
|
||||||
|
[colours/battery]
|
||||||
|
full-bg = ${colour-scheme.base00}
|
||||||
|
full-fg = ${colour-scheme.base0C}
|
||||||
|
charging-bg = ${colour-scheme.base00}
|
||||||
|
charging-fg = ${colour-scheme.base0D}
|
||||||
|
discharging-bg = ${colour-scheme.base00}
|
||||||
|
discharging-fg = ${colour-scheme.base0F}
|
||||||
|
low-bg = ${colour-scheme.base00}
|
||||||
|
low-fg = ${colour-scheme.base0E}
|
||||||
|
|
||||||
|
[colours/workspaces]
|
||||||
|
focused-bg = ${colour-scheme.base02}
|
||||||
|
focused-fg = ${colour-scheme.base04}
|
||||||
|
unfocused-bg = ${colour-scheme.base01}
|
||||||
|
unfocused-fg = ${colour-scheme.base05}
|
||||||
|
urgent-bg = ${colour-scheme.base0E}
|
||||||
|
urgent-fg = ${colour-scheme.base01}
|
||||||
|
|
||||||
|
[colours/i3-mode]
|
||||||
|
bg = ${colour-scheme.base0E}
|
||||||
|
fg = ${colour-scheme.base01}
|
||||||
|
|
||||||
|
[colours/volume]
|
||||||
|
volume-bg = ${colour-scheme.base00}
|
||||||
|
volume-fg = ${colour-scheme.base0C}
|
||||||
|
muted-bg = ${colour-scheme.base00}
|
||||||
|
muted-fg = ${colour-scheme.base0B}
|
||||||
|
|
||||||
|
[colours/wireless]
|
||||||
|
connected-bg = ${colour-scheme.base00}
|
||||||
|
connected-fg = ${colour-scheme.base0C}
|
||||||
|
disconnected-bg = ${colour-scheme.base00}
|
||||||
|
disconnected-fg = ${colour-scheme.base0B}
|
||||||
|
packetloss-bg = ${colour-scheme.base00}
|
||||||
|
packetloss-fg = ${colour-scheme.base0E}
|
||||||
|
|
||||||
|
[colours/bluetooth]
|
||||||
|
bg = ${colour-scheme.base00}
|
||||||
|
fg = ${colour-scheme.base0C}
|
||||||
|
|
||||||
|
[colours/spotify]
|
||||||
|
bg = ${colour-scheme.base00}
|
||||||
|
fg = ${colour-scheme.base0A}
|
||||||
|
|
||||||
|
[colours/ice]
|
||||||
|
bg = ${colour-scheme.base00}
|
||||||
|
fg = ${colour-scheme.base0A}
|
||||||
31
config/polybar/bars/modules/battery.ini
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
[module/battery]
|
||||||
|
type = internal/battery
|
||||||
|
full-at = 100
|
||||||
|
low-at = 20
|
||||||
|
battery = BAT0
|
||||||
|
adapter = ADP0
|
||||||
|
poll-interval = 1
|
||||||
|
|
||||||
|
format-full = <label-full>
|
||||||
|
label-full = "%{T2}%{T-} %percentage%%"
|
||||||
|
label-full-background = ${colours/battery.full-bg}
|
||||||
|
label-full-foreground = ${colours/battery.full-fg}
|
||||||
|
label-full-padding = 1
|
||||||
|
|
||||||
|
format-charging = <label-charging>
|
||||||
|
label-charging = "%{T2}%{T-} %percentage%%"
|
||||||
|
label-charging-background = ${colours/battery.charging-bg}
|
||||||
|
label-charging-foreground = ${colours/battery.charging-fg}
|
||||||
|
label-charging-padding = 1
|
||||||
|
|
||||||
|
format-discharging = <label-discharging>
|
||||||
|
label-discharging = "%{T2}%{T-} %percentage%%"
|
||||||
|
label-discharging-background = ${colours/battery.discharging-bg}
|
||||||
|
label-discharging-foreground = ${colours/battery.discharging-fg}
|
||||||
|
label-discharging-padding = 1
|
||||||
|
|
||||||
|
format-low = <label-low>
|
||||||
|
label-low = "%{T2}%{T-} %percentage%%"
|
||||||
|
label-low-background = ${colours/battery.low-bg}
|
||||||
|
label-low-foreground = ${colours/battery.low-fg}
|
||||||
|
label-low-padding = 1
|
||||||
9
config/polybar/bars/modules/bluetooth.ini
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[module/bluetooth]
|
||||||
|
type = custom/script
|
||||||
|
exec = ~/.config/rofi/menus/bluetooth/bluetooth.sh --status
|
||||||
|
interval = 5
|
||||||
|
click-left = ~/.config/rofi/menus/bluetooth/bluetooth.sh
|
||||||
|
|
||||||
|
format-background = ${colours/bluetooth.bg}
|
||||||
|
format-foreground = ${colours/bluetooth.fg}
|
||||||
|
format-padding = 1
|
||||||
13
config/polybar/bars/modules/date.ini
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[module/date]
|
||||||
|
type = internal/date
|
||||||
|
interval = 1.0
|
||||||
|
date = %A, %d %B %Y
|
||||||
|
time = %H:%M:%S
|
||||||
|
label = %date% · %time%
|
||||||
|
|
||||||
|
format = <label>
|
||||||
|
format-padding = 0
|
||||||
|
|
||||||
|
label-background = ${colours/date.bg}
|
||||||
|
label-foreground = ${colours/date.fg}
|
||||||
|
label-padding = 1
|
||||||
7
config/polybar/bars/modules/i3-mode.ini
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[module/i3-mode]
|
||||||
|
type = internal/i3
|
||||||
|
format = <label-mode>
|
||||||
|
|
||||||
|
label-mode-background = ${colours/i3-mode.bg}
|
||||||
|
label-mode-foreground = ${colours/i3-mode.fg}
|
||||||
|
label-mode-padding = 2
|
||||||
8
config/polybar/bars/modules/ice.ini
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[module/ice]
|
||||||
|
type = custom/script
|
||||||
|
exec = ~/.config/polybar/scripts/ice.sh
|
||||||
|
interval = 5
|
||||||
|
|
||||||
|
format-background = ${colours/ice.bg}
|
||||||
|
format-foreground = ${colours/ice.fg}
|
||||||
|
format-padding = 1
|
||||||
8
config/polybar/bars/modules/spotify.ini
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[module/spotify]
|
||||||
|
type = custom/script
|
||||||
|
exec = ~/.config/polybar/scripts/spotify.sh
|
||||||
|
interval = 5
|
||||||
|
|
||||||
|
format-background = ${colours/spotify.bg}
|
||||||
|
format-foreground = ${colours/spotify.fg}
|
||||||
|
format-padding = 1
|
||||||
15
config/polybar/bars/modules/volume.ini
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[module/volume]
|
||||||
|
type = internal/pulseaudio
|
||||||
|
interval = 5
|
||||||
|
|
||||||
|
format-volume = <label-volume>
|
||||||
|
label-volume = %{T2} %{T-} %percentage%%
|
||||||
|
label-volume-padding = 1
|
||||||
|
label-volume-foreground = ${colours/volume.volume-fg}
|
||||||
|
label-volume-background = ${colours/volume.volume-bg}
|
||||||
|
|
||||||
|
format-muted = <label-muted>
|
||||||
|
label-muted = %{T2} %{T-} muted
|
||||||
|
label-muted-padding = 1
|
||||||
|
label-muted-foreground = ${colours/volume.muted-fg}
|
||||||
|
label-muted-background = ${colours/volume.muted-bg}
|
||||||
28
config/polybar/bars/modules/wireless.ini
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
[module/wireless]
|
||||||
|
type = internal/network
|
||||||
|
interface-type = wireless
|
||||||
|
interval = 3.0
|
||||||
|
|
||||||
|
accumulate-stats = true
|
||||||
|
;unknown-as-up = true
|
||||||
|
|
||||||
|
; The unit used for displaying network speeds
|
||||||
|
; For example if set to the empty string, a speed of 5 KB/s is displayed as 5 K
|
||||||
|
speed-unit = ''
|
||||||
|
|
||||||
|
format-connected = <label-connected>
|
||||||
|
label-connected = %{T2} %{T-} %essid% (%local_ip%)
|
||||||
|
label-connected-background = ${colours/wireless.connected-bg}
|
||||||
|
label-connected-foreground = ${colours/wireless.connected-fg}
|
||||||
|
label-connected-padding = 1
|
||||||
|
|
||||||
|
format-disconnected = <label-disconnected>
|
||||||
|
label-disconnected = %{T2}
|
||||||
|
label-disconnected-background = ${colours/wireless.disconnected-bg}
|
||||||
|
label-disconnected-foreground = ${colours/wireless.disconnected-fg}
|
||||||
|
label-disconnected-padding = 1
|
||||||
|
|
||||||
|
format-packetloss = <label-connected>*
|
||||||
|
label-packetloss-background = ${colours/wireless.packetloss-bg}
|
||||||
|
label-packetloss-foreground = ${colours/wireless.packetloss-fg}
|
||||||
|
label-packetloss-padding = 1
|
||||||
22
config/polybar/bars/modules/workspaces.ini
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
[module/workspaces]
|
||||||
|
type = internal/i3
|
||||||
|
format = <label-state>
|
||||||
|
index-sort = true
|
||||||
|
wrapping-scroll = false
|
||||||
|
strip-wsnumbers = true
|
||||||
|
pin-workspaces = true
|
||||||
|
|
||||||
|
label-focused = %index%
|
||||||
|
label-focused-background = ${colours/workspaces.focused-bg}
|
||||||
|
label-focused-foreground = ${colours/workspaces.focused-fg}
|
||||||
|
label-focused-padding = 2
|
||||||
|
|
||||||
|
label-unfocused = %index%
|
||||||
|
label-unfocused-background = ${colours/workspaces.unfocused-bg}
|
||||||
|
label-unfocused-foreground = ${colours/workspaces.unfocused-fg}
|
||||||
|
label-unfocused-padding = 2
|
||||||
|
|
||||||
|
label-urgent = %index%
|
||||||
|
label-urgent-background = ${colours/workspaces.urgent-bg}
|
||||||
|
label-urgent-foreground = ${colours/workspaces.urgent-fg}
|
||||||
|
label-urgent-padding = 2
|
||||||
3
config/polybar/config.ini
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# This file is generated by nixos-rebuild
|
||||||
|
include-file = colour-scheme.ini
|
||||||
|
include-file = bars/bars.ini
|
||||||
33
config/polybar/scripts/ice.sh
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Show current train speed on ICE
|
||||||
|
|
||||||
|
main() {
|
||||||
|
status=$(curl -X GET https://iceportal.de/api1/rs/status 2>/dev/null)
|
||||||
|
tripInfo=$(curl -X GET https://iceportal.de/api1/rs/tripInfo/trip 2>/dev/null)
|
||||||
|
|
||||||
|
if [[ -z $status || -z $tripInfo ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Speed
|
||||||
|
speed=$(echo $status | jq ".speed")
|
||||||
|
|
||||||
|
# Next stop
|
||||||
|
nextId=$(echo $tripInfo | jq ".trip.stopInfo.actualNext")
|
||||||
|
nextStop=$(echo $tripInfo | jq ".trip.stops[] | select( .station.evaNr == $nextId )")
|
||||||
|
|
||||||
|
nextStopName=$(echo $nextStop | jq -r ".station.name")
|
||||||
|
nextStopArrival=$(echo $nextStop | jq ".timetable.actualArrivalTime")
|
||||||
|
|
||||||
|
nextStopRemainingSeconds=$(expr $(expr $nextStopArrival / 1000) - $(date +%s))
|
||||||
|
|
||||||
|
if [[ ${nextStopRemainingSeconds:0:1} == "-" ]]; then
|
||||||
|
nextStopRemainingTime="Arribada!"
|
||||||
|
else
|
||||||
|
nextStopRemainingTime=$(date -d@$nextStopRemainingSeconds -u +%Hh%Mm%Ss)
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo " $nextStopName · $nextStopRemainingTime · $speed km/h"
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
20
config/polybar/scripts/spotify.sh
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
main() {
|
||||||
|
pgrep spotify -l | grep -v spotify.sh > /dev/null || return
|
||||||
|
|
||||||
|
cmd="org.freedesktop.DBus.Properties.Get"
|
||||||
|
domain="org.mpris.MediaPlayer2"
|
||||||
|
path="/org/mpris/MediaPlayer2"
|
||||||
|
|
||||||
|
meta=$(dbus-send --print-reply --dest=${domain}.spotify /org/mpris/MediaPlayer2 ${cmd} string:${domain}.Player string:Metadata)
|
||||||
|
|
||||||
|
# Normal track
|
||||||
|
artist=$(echo "$meta" | sed -nr '/xesam:artist"/,+2s/^ +string "(.*)"$/\1/p' | tail -1 | sed 's/\&/\\&/g' | sed 's#\/#\\/#g')
|
||||||
|
album=$(echo "$meta" | sed -nr '/xesam:album"/,+2s/^ +variant +string "(.*)"$/\1/p' | tail -1| sed 's/\&/\\&/g'| sed 's#\/#\\/#g')
|
||||||
|
title=$(echo "$meta" | sed -nr '/xesam:title"/,+2s/^ +variant +string "(.*)"$/\1/p' | tail -1 | sed 's/\&/\\&/g'| sed 's#\/#\\/#g')
|
||||||
|
|
||||||
|
echo " ${*:-%artist% - %title%}" | sed "s/%artist%/$artist/g;s/%title%/$title/g;s/%album%/$album/g"i | sed "s/\&/\&/g" | sed "s#\/#\/#g"
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
139
config/rofi/menus/bluetooth/bluetooth.rasi
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* Author : Marc Sastre, based on Aditya Shakya (adi1090x, Github : @adi1090x)
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
@import "~/.config/rofi/theme.rasi"
|
||||||
|
|
||||||
|
/*****----- Configuration -----*****/
|
||||||
|
configuration {
|
||||||
|
show-icons: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Window -----*****/
|
||||||
|
window {
|
||||||
|
/* properties for window widget */
|
||||||
|
transparency: "real";
|
||||||
|
location: center;
|
||||||
|
anchor: center;
|
||||||
|
fullscreen: false;
|
||||||
|
width: 800px;
|
||||||
|
x-offset: 0px;
|
||||||
|
y-offset: 0px;
|
||||||
|
|
||||||
|
/* properties for all widgets */
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 2px solid;
|
||||||
|
border-radius: 15px;
|
||||||
|
border-color: @background-alt;
|
||||||
|
cursor: "default";
|
||||||
|
background-color: @background;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Box -----*****/
|
||||||
|
mainbox {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 15px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 30px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
children: [ "inputbar", "listview" ];
|
||||||
|
}
|
||||||
|
message {
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 10px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
textbox {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
placeholder-color: @foreground;
|
||||||
|
blink: true;
|
||||||
|
markup: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Inputbar -----*****/
|
||||||
|
inputbar {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 10px;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
children: [ "textbox-prompt-colon", "entry" ];
|
||||||
|
}
|
||||||
|
textbox-prompt-colon {
|
||||||
|
enabled: true;
|
||||||
|
expand: false;
|
||||||
|
str: "";
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
|
entry {
|
||||||
|
enabled: true;
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Listview -----*****/
|
||||||
|
listview {
|
||||||
|
enabled: true;
|
||||||
|
columns: 1;
|
||||||
|
lines: 5;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
scrollbar: false;
|
||||||
|
layout: vertical;
|
||||||
|
reverse: false;
|
||||||
|
fixed-height: true;
|
||||||
|
fixed-columns: true;
|
||||||
|
|
||||||
|
spacing: 5px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: "default";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Elements -----*****/
|
||||||
|
element {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 12px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 100%;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
}
|
||||||
|
element selected.normal {
|
||||||
|
background-color: var(selected);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
322
config/rofi/menus/bluetooth/bluetooth.sh
Executable file
@@ -0,0 +1,322 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# __ _ _ _ _ _ _
|
||||||
|
# _ __ ___ / _(_) | |__ | |_ _ ___| |_ ___ ___ | |_| |__
|
||||||
|
# | '__/ _ \| |_| |_____| '_ \| | | | |/ _ \ __/ _ \ / _ \| __| '_ \
|
||||||
|
# | | | (_) | _| |_____| |_) | | |_| | __/ || (_) | (_) | |_| | | |
|
||||||
|
# |_| \___/|_| |_| |_.__/|_|\__,_|\___|\__\___/ \___/ \__|_| |_|
|
||||||
|
#
|
||||||
|
# Author: Nick Clyde (clydedroid)
|
||||||
|
#
|
||||||
|
# A script that generates a rofi menu that uses bluetoothctl to
|
||||||
|
# connect to bluetooth devices and display status info.
|
||||||
|
#
|
||||||
|
# Inspired by networkmanager-dmenu (https://github.com/firecat53/networkmanager-dmenu)
|
||||||
|
# Thanks to x70b1 (https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/system-bluetooth-bluetoothctl)
|
||||||
|
#
|
||||||
|
# Depends on:
|
||||||
|
# Arch repositories: rofi, bluez-utils (contains bluetoothctl)
|
||||||
|
|
||||||
|
# Constants
|
||||||
|
divider=""
|
||||||
|
goback="Back"
|
||||||
|
|
||||||
|
# For debugging/development purposes
|
||||||
|
# PREFIX=projects/samfelag/config/
|
||||||
|
|
||||||
|
# Rofi command to pipe into, can add any options here
|
||||||
|
dir="$HOME/$PREFIX.config/rofi/menus/bluetooth/"
|
||||||
|
theme='bluetooth'
|
||||||
|
|
||||||
|
rofi_command="rofi -dmenu -theme ${dir}/${theme}.rasi -i -p"
|
||||||
|
|
||||||
|
# rofi -dmenu \
|
||||||
|
# -theme ${dir}/${theme}.rasi
|
||||||
|
|
||||||
|
# Checks if bluetooth controller is powered on
|
||||||
|
power_on() {
|
||||||
|
if bluetoothctl show | grep -q "Powered: yes"; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Toggles power state
|
||||||
|
toggle_power() {
|
||||||
|
if power_on; then
|
||||||
|
bluetoothctl power off
|
||||||
|
show_menu
|
||||||
|
else
|
||||||
|
if rfkill list bluetooth | grep -q 'blocked: yes'; then
|
||||||
|
rfkill unblock bluetooth && sleep 3
|
||||||
|
fi
|
||||||
|
bluetoothctl power on
|
||||||
|
show_menu
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Checks if controller is scanning for new devices
|
||||||
|
scan_on() {
|
||||||
|
if bluetoothctl show | grep -q "Discovering: yes"; then
|
||||||
|
echo "Scan: on"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "Scan: off"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Toggles scanning state
|
||||||
|
toggle_scan() {
|
||||||
|
if scan_on; then
|
||||||
|
kill $(pgrep -f "bluetoothctl scan on")
|
||||||
|
bluetoothctl scan off
|
||||||
|
show_menu
|
||||||
|
else
|
||||||
|
bluetoothctl scan on &
|
||||||
|
echo "Scanning..."
|
||||||
|
sleep 5
|
||||||
|
show_menu
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Checks if controller is able to pair to devices
|
||||||
|
pairable_on() {
|
||||||
|
if bluetoothctl show | grep -q "Pairable: yes"; then
|
||||||
|
echo "Pairable: on"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "Pairable: off"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Toggles pairable state
|
||||||
|
toggle_pairable() {
|
||||||
|
if pairable_on; then
|
||||||
|
bluetoothctl pairable off
|
||||||
|
show_menu
|
||||||
|
else
|
||||||
|
bluetoothctl pairable on
|
||||||
|
show_menu
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Checks if controller is discoverable by other devices
|
||||||
|
discoverable_on() {
|
||||||
|
if bluetoothctl show | grep -q "Discoverable: yes"; then
|
||||||
|
echo "Discoverable: on"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "Discoverable: off"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Toggles discoverable state
|
||||||
|
toggle_discoverable() {
|
||||||
|
if discoverable_on; then
|
||||||
|
bluetoothctl discoverable off
|
||||||
|
show_menu
|
||||||
|
else
|
||||||
|
bluetoothctl discoverable on
|
||||||
|
show_menu
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Checks if a device is connected
|
||||||
|
device_connected() {
|
||||||
|
device_info=$(bluetoothctl info "$1")
|
||||||
|
if echo "$device_info" | grep -q "Connected: yes"; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Toggles device connection
|
||||||
|
toggle_connection() {
|
||||||
|
if device_connected $1; then
|
||||||
|
bluetoothctl disconnect $1
|
||||||
|
device_menu "$device"
|
||||||
|
else
|
||||||
|
bluetoothctl connect $1
|
||||||
|
device_menu "$device"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Checks if a device is paired
|
||||||
|
device_paired() {
|
||||||
|
device_info=$(bluetoothctl info "$1")
|
||||||
|
if echo "$device_info" | grep -q "Paired: yes"; then
|
||||||
|
echo "Paired: yes"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "Paired: no"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Toggles device paired state
|
||||||
|
toggle_paired() {
|
||||||
|
if device_paired $1; then
|
||||||
|
bluetoothctl remove $1
|
||||||
|
device_menu "$device"
|
||||||
|
else
|
||||||
|
bluetoothctl pair $1
|
||||||
|
device_menu "$device"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Checks if a device is trusted
|
||||||
|
device_trusted() {
|
||||||
|
device_info=$(bluetoothctl info "$1")
|
||||||
|
if echo "$device_info" | grep -q "Trusted: yes"; then
|
||||||
|
echo "Trusted: yes"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "Trusted: no"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Toggles device connection
|
||||||
|
toggle_trust() {
|
||||||
|
if device_trusted $1; then
|
||||||
|
bluetoothctl untrust $1
|
||||||
|
device_menu "$device"
|
||||||
|
else
|
||||||
|
bluetoothctl trust $1
|
||||||
|
device_menu "$device"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Prints a short string with the current bluetooth status
|
||||||
|
# Useful for status bars like polybar, etc.
|
||||||
|
print_status() {
|
||||||
|
if power_on; then
|
||||||
|
printf ''
|
||||||
|
|
||||||
|
paired_devices_cmd="paired-devices"
|
||||||
|
|
||||||
|
mapfile -t paired_devices < <(bluetoothctl $paired_devices_cmd | grep Device | cut -d ' ' -f 2)
|
||||||
|
counter=0
|
||||||
|
|
||||||
|
for device in "${paired_devices[@]}"; do
|
||||||
|
if device_connected $device; then
|
||||||
|
device_alias=$(bluetoothctl info $device | grep "Alias" | cut -d ' ' -f 2-)
|
||||||
|
|
||||||
|
if [ $counter -gt 0 ]; then
|
||||||
|
printf ", %s" "$device_alias"
|
||||||
|
else
|
||||||
|
printf " %s" "$device_alias"
|
||||||
|
fi
|
||||||
|
|
||||||
|
((counter++))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
printf "\n"
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# A submenu for a specific device that allows connecting, pairing, and trusting
|
||||||
|
device_menu() {
|
||||||
|
device=$1
|
||||||
|
|
||||||
|
# Get device name and mac address
|
||||||
|
device_name=$(echo $device | cut -d ' ' -f 3-)
|
||||||
|
mac=$(echo $device | cut -d ' ' -f 2)
|
||||||
|
|
||||||
|
# Build options
|
||||||
|
if device_connected $mac; then
|
||||||
|
connected="Connected: yes"
|
||||||
|
else
|
||||||
|
connected="Connected: no"
|
||||||
|
fi
|
||||||
|
paired=$(device_paired $mac)
|
||||||
|
trusted=$(device_trusted $mac)
|
||||||
|
options="$connected\n$paired\n$trusted\n$divider\n$goback\nExit"
|
||||||
|
|
||||||
|
# Open rofi menu, read chosen option
|
||||||
|
chosen="$(echo -e "$options" | $rofi_command "$device_name")"
|
||||||
|
|
||||||
|
# Match chosen option to command
|
||||||
|
case $chosen in
|
||||||
|
"" | $divider)
|
||||||
|
echo "No option chosen."
|
||||||
|
;;
|
||||||
|
$connected)
|
||||||
|
toggle_connection $mac
|
||||||
|
;;
|
||||||
|
$paired)
|
||||||
|
toggle_paired $mac
|
||||||
|
;;
|
||||||
|
$trusted)
|
||||||
|
toggle_trust $mac
|
||||||
|
;;
|
||||||
|
$goback)
|
||||||
|
show_menu
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# Opens a rofi menu with current bluetooth status and options to connect
|
||||||
|
show_menu() {
|
||||||
|
# Get menu options
|
||||||
|
if power_on; then
|
||||||
|
power="Power: on"
|
||||||
|
|
||||||
|
# Human-readable names of devices, one per line
|
||||||
|
# If scan is off, will only list paired devices
|
||||||
|
devices=$(bluetoothctl devices | grep Device | cut -d ' ' -f 3-)
|
||||||
|
|
||||||
|
# Get controller flags
|
||||||
|
scan=$(scan_on)
|
||||||
|
pairable=$(pairable_on)
|
||||||
|
discoverable=$(discoverable_on)
|
||||||
|
|
||||||
|
# Options passed to rofi
|
||||||
|
options="$devices\n$divider\n$power\n$scan\n$pairable\n$discoverable\nExit"
|
||||||
|
else
|
||||||
|
power="Power: off"
|
||||||
|
options="$power\nExit"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Open rofi menu, read chosen option
|
||||||
|
chosen="$(echo -e "$options" | $rofi_command "Bluetooth")"
|
||||||
|
|
||||||
|
# Match chosen option to command
|
||||||
|
case $chosen in
|
||||||
|
"" | $divider)
|
||||||
|
echo "No option chosen."
|
||||||
|
;;
|
||||||
|
$power)
|
||||||
|
toggle_power
|
||||||
|
;;
|
||||||
|
$scan)
|
||||||
|
toggle_scan
|
||||||
|
;;
|
||||||
|
$discoverable)
|
||||||
|
toggle_discoverable
|
||||||
|
;;
|
||||||
|
$pairable)
|
||||||
|
toggle_pairable
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
device=$(bluetoothctl devices | grep "$chosen")
|
||||||
|
# Open a submenu if a device is selected
|
||||||
|
if [[ $device ]]; then device_menu "$device"; fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
--status)
|
||||||
|
print_status
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
show_menu
|
||||||
|
;;
|
||||||
|
esac
|
||||||
147
config/rofi/menus/cliphist/cliphist.rasi
Executable file
@@ -0,0 +1,147 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* Author : Marc Sastre, based on Aditya Shakya (adi1090x, Github : @adi1090x)
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
@import "~/.config/rofi/theme.rasi"
|
||||||
|
|
||||||
|
/*****----- Configuration -----*****/
|
||||||
|
configuration {
|
||||||
|
show-icons: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Window -----*****/
|
||||||
|
window {
|
||||||
|
/* properties for window widget */
|
||||||
|
transparency: "real";
|
||||||
|
location: center;
|
||||||
|
anchor: center;
|
||||||
|
fullscreen: false;
|
||||||
|
width: 800px;
|
||||||
|
x-offset: 0px;
|
||||||
|
y-offset: 0px;
|
||||||
|
|
||||||
|
/* properties for all widgets */
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 2px solid;
|
||||||
|
border-radius: 15px;
|
||||||
|
border-color: @background-alt;
|
||||||
|
cursor: "default";
|
||||||
|
background-color: @background;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Box -----*****/
|
||||||
|
mainbox {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 15px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 30px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
children: [ "inputbar", "listview" ];
|
||||||
|
}
|
||||||
|
message {
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 10px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
textbox {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
placeholder-color: @foreground;
|
||||||
|
blink: true;
|
||||||
|
markup: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Inputbar -----*****/
|
||||||
|
inputbar {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 10px;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
children: [ "textbox-prompt-colon", "entry" ];
|
||||||
|
}
|
||||||
|
textbox-prompt-colon {
|
||||||
|
enabled: true;
|
||||||
|
expand: false;
|
||||||
|
str: "";
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
|
entry {
|
||||||
|
enabled: true;
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Listview -----*****/
|
||||||
|
listview {
|
||||||
|
enabled: true;
|
||||||
|
columns: 1;
|
||||||
|
lines: 5;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
scrollbar: false;
|
||||||
|
layout: vertical;
|
||||||
|
reverse: false;
|
||||||
|
fixed-height: true;
|
||||||
|
fixed-columns: true;
|
||||||
|
|
||||||
|
spacing: 5px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: "default";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Elements -----*****/
|
||||||
|
element {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 12px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 100%;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
}
|
||||||
|
element selected.normal {
|
||||||
|
background-color: var(selected);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
|
element active {
|
||||||
|
background-color: var(active);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
|
element selected.active {
|
||||||
|
background-color: var(selected);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
12
config/rofi/menus/cliphist/cliphist.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# For debugging/development purposes
|
||||||
|
# PREFIX=projects/samfelag/config/
|
||||||
|
|
||||||
|
# Rofi command to pipe into, can add any options here
|
||||||
|
dir="$HOME/$PREFIX.config/rofi/menus/cliphist/"
|
||||||
|
theme='cliphist'
|
||||||
|
|
||||||
|
rofi_command="rofi -dmenu -i -theme ${dir}/${theme}.rasi"
|
||||||
|
|
||||||
|
cliphist list | $rofi_command | cliphist decode | wl-copy
|
||||||
199
config/rofi/menus/launcher/launcher.rasi
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* Author : Marc Sastre, based on Aditya Shakya (adi1090x, Github : @adi1090x)
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
@import "~/.config/rofi/theme.rasi"
|
||||||
|
|
||||||
|
/*****----- Configuration -----*****/
|
||||||
|
configuration {
|
||||||
|
modi: "drun,run,filebrowser,window";
|
||||||
|
show-icons: true;
|
||||||
|
display-drun: "APPS";
|
||||||
|
display-run: "RUN";
|
||||||
|
display-filebrowser: "FILES";
|
||||||
|
display-window: "WINDOW";
|
||||||
|
drun-display-format: "{name}";
|
||||||
|
window-format: "{w} · {c} · {t}";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Window -----*****/
|
||||||
|
window {
|
||||||
|
/* properties for window widget */
|
||||||
|
transparency: "real";
|
||||||
|
location: center;
|
||||||
|
anchor: center;
|
||||||
|
fullscreen: false;
|
||||||
|
width: 1000px;
|
||||||
|
x-offset: 0px;
|
||||||
|
y-offset: 0px;
|
||||||
|
|
||||||
|
/* properties for all widgets */
|
||||||
|
enabled: true;
|
||||||
|
border: 2px solid;
|
||||||
|
border-radius: 15px;
|
||||||
|
border-color: @background-alt;
|
||||||
|
cursor: "default";
|
||||||
|
background-color: @background;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Box -----*****/
|
||||||
|
mainbox {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 0px;
|
||||||
|
background-color: transparent;
|
||||||
|
orientation: horizontal;
|
||||||
|
children: [ "imagebox", "listbox" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
imagebox {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("~/.config/rofi/nix.png", width);
|
||||||
|
orientation: vertical;
|
||||||
|
children: [ "inputbar", "dummy", "mode-switcher" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
listbox {
|
||||||
|
spacing: 20px;
|
||||||
|
padding: 20px;
|
||||||
|
background-color: transparent;
|
||||||
|
orientation: vertical;
|
||||||
|
children: [ "message", "listview" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
dummy {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Inputbar -----*****/
|
||||||
|
inputbar {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 10px;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
children: [ "textbox-prompt-colon", "entry" ];
|
||||||
|
}
|
||||||
|
textbox-prompt-colon {
|
||||||
|
enabled: true;
|
||||||
|
expand: false;
|
||||||
|
str: "";
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
|
entry {
|
||||||
|
enabled: true;
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: text;
|
||||||
|
placeholder: "Search";
|
||||||
|
placeholder-color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Mode Switcher -----*****/
|
||||||
|
mode-switcher{
|
||||||
|
enabled: true;
|
||||||
|
spacing: 20px;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
button selected {
|
||||||
|
background-color: @selected;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Listview -----*****/
|
||||||
|
listview {
|
||||||
|
enabled: true;
|
||||||
|
columns: 1;
|
||||||
|
lines: 8;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
scrollbar: false;
|
||||||
|
layout: vertical;
|
||||||
|
reverse: false;
|
||||||
|
fixed-height: true;
|
||||||
|
fixed-columns: true;
|
||||||
|
|
||||||
|
spacing: 10px;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: "default";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Elements -----*****/
|
||||||
|
element {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 15px;
|
||||||
|
padding: 8px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
element normal.normal {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
|
element normal.urgent {
|
||||||
|
background-color: @urgent;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
element normal.active {
|
||||||
|
background-color: @active;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
element selected.normal {
|
||||||
|
background-color: @selected;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
element selected.urgent {
|
||||||
|
background-color: @urgent;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
element selected.active {
|
||||||
|
background-color: @urgent;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
element-icon {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
size: 32px;
|
||||||
|
cursor: inherit;
|
||||||
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Message -----*****/
|
||||||
|
message {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
textbox {
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
}
|
||||||
|
error-message {
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background-color: @background;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
13
config/rofi/menus/launcher/launcher.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
## Author : Marc Sastre, based on Aditya Shakya (adi1090x, Github : @adi1090x)
|
||||||
|
## Rofi : Launcher
|
||||||
|
|
||||||
|
# For debugging/development purposes
|
||||||
|
# PREFIX=projects/samfelag/config/
|
||||||
|
|
||||||
|
# Rofi command to pipe into, can add any options here
|
||||||
|
dir="$HOME/$PREFIX.config/rofi/menus/launcher/"
|
||||||
|
theme='launcher'
|
||||||
|
|
||||||
|
rofi -show drun -theme ${dir}/${theme}.rasi
|
||||||
147
config/rofi/menus/pass/pass.rasi
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* Author : Marc Sastre, based on Aditya Shakya (adi1090x, Github : @adi1090x)
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
@import "~/.config/rofi/theme.rasi"
|
||||||
|
|
||||||
|
/*****----- Configuration -----*****/
|
||||||
|
configuration {
|
||||||
|
show-icons: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Window -----*****/
|
||||||
|
window {
|
||||||
|
/* properties for window widget */
|
||||||
|
transparency: "real";
|
||||||
|
location: center;
|
||||||
|
anchor: center;
|
||||||
|
fullscreen: false;
|
||||||
|
width: 800px;
|
||||||
|
x-offset: 0px;
|
||||||
|
y-offset: 0px;
|
||||||
|
|
||||||
|
/* properties for all widgets */
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 2px solid;
|
||||||
|
border-radius: 15px;
|
||||||
|
border-color: @background-alt;
|
||||||
|
cursor: "default";
|
||||||
|
background-color: @background;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Box -----*****/
|
||||||
|
mainbox {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 15px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 30px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
children: [ "message", "inputbar", "listview" ];
|
||||||
|
}
|
||||||
|
message {
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 10px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
textbox {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
placeholder-color: @foreground;
|
||||||
|
blink: true;
|
||||||
|
markup: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Inputbar -----*****/
|
||||||
|
inputbar {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 10px;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
children: [ "textbox-prompt-colon", "entry" ];
|
||||||
|
}
|
||||||
|
textbox-prompt-colon {
|
||||||
|
enabled: true;
|
||||||
|
expand: false;
|
||||||
|
str: "";
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
|
entry {
|
||||||
|
enabled: true;
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Listview -----*****/
|
||||||
|
listview {
|
||||||
|
enabled: true;
|
||||||
|
columns: 1;
|
||||||
|
lines: 5;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
scrollbar: false;
|
||||||
|
layout: vertical;
|
||||||
|
reverse: false;
|
||||||
|
fixed-height: true;
|
||||||
|
fixed-columns: true;
|
||||||
|
|
||||||
|
spacing: 5px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: "default";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Elements -----*****/
|
||||||
|
element {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 12px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 100%;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
}
|
||||||
|
element selected.normal {
|
||||||
|
background-color: var(selected);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
|
element active {
|
||||||
|
background-color: var(active);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
|
element selected.active {
|
||||||
|
background-color: var(selected);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
115
config/rofi/menus/powermenu/powermenu.rasi
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* Author : Marc Sastre, based on Aditya Shakya (adi1090x, Github : @adi1090x)
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
@import "~/.config/rofi/theme.rasi"
|
||||||
|
|
||||||
|
/*****----- Configuration -----*****/
|
||||||
|
configuration {
|
||||||
|
show-icons: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Window -----*****/
|
||||||
|
window {
|
||||||
|
/* properties for window widget */
|
||||||
|
transparency: "real";
|
||||||
|
location: center;
|
||||||
|
anchor: center;
|
||||||
|
fullscreen: false;
|
||||||
|
width: 500px;
|
||||||
|
x-offset: 0px;
|
||||||
|
y-offset: 0px;
|
||||||
|
|
||||||
|
/* properties for all widgets */
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 2px solid;
|
||||||
|
border-radius: 15px;
|
||||||
|
border-color: @background-alt;
|
||||||
|
cursor: "default";
|
||||||
|
background-color: @background;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Box -----*****/
|
||||||
|
mainbox {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 15px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 30px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
children: [ "listview" ];
|
||||||
|
}
|
||||||
|
message {
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 10px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
textbox {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
placeholder-color: @foreground;
|
||||||
|
blink: true;
|
||||||
|
markup: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Listview -----*****/
|
||||||
|
listview {
|
||||||
|
enabled: true;
|
||||||
|
columns: 1;
|
||||||
|
lines: 5;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
scrollbar: false;
|
||||||
|
layout: vertical;
|
||||||
|
reverse: false;
|
||||||
|
fixed-height: true;
|
||||||
|
fixed-columns: true;
|
||||||
|
|
||||||
|
spacing: 5px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: "default";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Elements -----*****/
|
||||||
|
element {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 12px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 100%;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
}
|
||||||
|
element selected.normal {
|
||||||
|
background-color: var(selected);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
94
config/rofi/menus/powermenu/powermenu.sh
Executable file
@@ -0,0 +1,94 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
## Author : Marc Sastre, based on Aditya Shakya (adi1090x, Github : @adi1090x)
|
||||||
|
## Rofi : Power Menu
|
||||||
|
|
||||||
|
# Current Theme
|
||||||
|
dir="$HOME/.config/rofi/menus/powermenu/"
|
||||||
|
theme='powermenu'
|
||||||
|
|
||||||
|
# CMDs
|
||||||
|
|
||||||
|
# Options
|
||||||
|
shutdown=' Shutdown'
|
||||||
|
reboot=' Reboot'
|
||||||
|
lock=' Lock'
|
||||||
|
suspend=' Suspend'
|
||||||
|
logout=' Logout'
|
||||||
|
yes='Yes'
|
||||||
|
no='No'
|
||||||
|
|
||||||
|
# Rofi CMD
|
||||||
|
rofi_cmd() {
|
||||||
|
rofi -dmenu \
|
||||||
|
-theme ${dir}/${theme}.rasi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Confirmation CMD
|
||||||
|
confirm_cmd() {
|
||||||
|
rofi -theme-str 'window {location: center; anchor: center; fullscreen: false; width: 250px;}' \
|
||||||
|
-theme-str 'mainbox {children: [ "message", "listview" ];}' \
|
||||||
|
-theme-str 'listview {columns: 2; lines: 1;}' \
|
||||||
|
-theme-str 'element-text {horizontal-align: 0.5;}' \
|
||||||
|
-theme-str 'textbox {horizontal-align: 0.5;}' \
|
||||||
|
-dmenu \
|
||||||
|
-p 'Confirmation' \
|
||||||
|
-mesg 'Are you Sure?' \
|
||||||
|
-theme ${dir}/${theme}.rasi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Ask for confirmation
|
||||||
|
confirm_exit() {
|
||||||
|
echo -e "$yes\n$no" | confirm_cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
# Pass variables to rofi dmenu
|
||||||
|
run_rofi() {
|
||||||
|
echo -e "$lock\n$suspend\n$logout\n$reboot\n$shutdown" | rofi_cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
# Execute Command
|
||||||
|
run_cmd() {
|
||||||
|
selected="$(confirm_exit)"
|
||||||
|
if [[ "$selected" == "$yes" ]]; then
|
||||||
|
if [[ $1 == '--shutdown' ]]; then
|
||||||
|
systemctl poweroff -i
|
||||||
|
elif [[ $1 == '--reboot' ]]; then
|
||||||
|
systemctl reboot
|
||||||
|
elif [[ $1 == '--suspend' ]]; then
|
||||||
|
systemctl suspend
|
||||||
|
elif [[ $1 == '--logout' ]]; then
|
||||||
|
if [[ "$DESKTOP_SESSION" == 'i3' ]]; then
|
||||||
|
i3-msg exit
|
||||||
|
elif [[ ! -z $HYPRLAND_INSTANCE_SIGNATURE ]]; then
|
||||||
|
hyprctl dispatch exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Actions
|
||||||
|
chosen="$(run_rofi)"
|
||||||
|
case ${chosen} in
|
||||||
|
$shutdown)
|
||||||
|
run_cmd --shutdown
|
||||||
|
;;
|
||||||
|
$reboot)
|
||||||
|
run_cmd --reboot
|
||||||
|
;;
|
||||||
|
$lock)
|
||||||
|
if command -v i3lock-color; then
|
||||||
|
i3lock-color -c 808F85 && sleep 1
|
||||||
|
elif command -v hyprlock; then
|
||||||
|
hyprlock
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
$suspend)
|
||||||
|
run_cmd --suspend
|
||||||
|
;;
|
||||||
|
$logout)
|
||||||
|
run_cmd --logout
|
||||||
|
;;
|
||||||
|
esac
|
||||||
147
config/rofi/menus/wifi/wifi.rasi
Executable file
@@ -0,0 +1,147 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* Author : Marc Sastre, based on Aditya Shakya (adi1090x, Github : @adi1090x)
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
@import "~/.config/rofi/theme.rasi"
|
||||||
|
|
||||||
|
/*****----- Configuration -----*****/
|
||||||
|
configuration {
|
||||||
|
show-icons: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Window -----*****/
|
||||||
|
window {
|
||||||
|
/* properties for window widget */
|
||||||
|
transparency: "real";
|
||||||
|
location: center;
|
||||||
|
anchor: center;
|
||||||
|
fullscreen: false;
|
||||||
|
width: 800px;
|
||||||
|
x-offset: 0px;
|
||||||
|
y-offset: 0px;
|
||||||
|
|
||||||
|
/* properties for all widgets */
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 2px solid;
|
||||||
|
border-radius: 15px;
|
||||||
|
border-color: @background-alt;
|
||||||
|
cursor: "default";
|
||||||
|
background-color: @background;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Box -----*****/
|
||||||
|
mainbox {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 15px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 30px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
children: [ "inputbar", "listview" ];
|
||||||
|
}
|
||||||
|
message {
|
||||||
|
enabled: true;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 10px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
||||||
|
textbox {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
placeholder-color: @foreground;
|
||||||
|
blink: true;
|
||||||
|
markup: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Inputbar -----*****/
|
||||||
|
inputbar {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 10px;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
children: [ "textbox-prompt-colon", "entry" ];
|
||||||
|
}
|
||||||
|
textbox-prompt-colon {
|
||||||
|
enabled: true;
|
||||||
|
expand: false;
|
||||||
|
str: "";
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
|
entry {
|
||||||
|
enabled: true;
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Listview -----*****/
|
||||||
|
listview {
|
||||||
|
enabled: true;
|
||||||
|
columns: 1;
|
||||||
|
lines: 5;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
scrollbar: false;
|
||||||
|
layout: vertical;
|
||||||
|
reverse: false;
|
||||||
|
fixed-height: true;
|
||||||
|
fixed-columns: true;
|
||||||
|
|
||||||
|
spacing: 5px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: "default";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Elements -----*****/
|
||||||
|
element {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 12px;
|
||||||
|
border: 0px solid;
|
||||||
|
border-radius: 100%;
|
||||||
|
border-color: @selected;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
}
|
||||||
|
element selected.normal {
|
||||||
|
background-color: var(selected);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
|
element active {
|
||||||
|
background-color: var(active);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
|
element selected.active {
|
||||||
|
background-color: var(selected);
|
||||||
|
text-color: var(background);
|
||||||
|
}
|
||||||
83
config/rofi/menus/wifi/wifi.sh
Executable file
@@ -0,0 +1,83 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Shamelessly stolen from https://github.com/zbaylin/rofi-wifi-menu
|
||||||
|
|
||||||
|
# Starts a scan of available broadcasting SSIDs
|
||||||
|
# nmcli dev wifi rescan
|
||||||
|
|
||||||
|
|
||||||
|
# For debugging/development purposes
|
||||||
|
# PREFIX=projects/samfelag/config/
|
||||||
|
|
||||||
|
# Rofi command to pipe into, can add any options here
|
||||||
|
dir="$HOME/$PREFIX.config/rofi/menus/wifi/"
|
||||||
|
theme='wifi'
|
||||||
|
|
||||||
|
rofi_command="rofi -dmenu -i -theme ${dir}/${theme}.rasi"
|
||||||
|
|
||||||
|
FIELDS=SSID,SECURITY,BARS
|
||||||
|
|
||||||
|
LIST=$(nmcli --fields "$FIELDS" device wifi list | sed '/^--/d')
|
||||||
|
# Gives a list of known connections so we can parse it later
|
||||||
|
KNOWNCON=$(nmcli connection show)
|
||||||
|
# Really janky way of telling if there is currently a connection
|
||||||
|
CONSTATE=$(nmcli -fields WIFI g)
|
||||||
|
CURRSSID=$(LANGUAGE=C nmcli -t -f active,ssid dev wifi | awk -F: '$1 ~ /^yes/ {print $2}')
|
||||||
|
|
||||||
|
if [[ ! -z $CURRSSID ]]; then
|
||||||
|
HIGHLINE=$(echo "$(echo "$LIST" | awk -F "[ ]{2,}" '{print $1}' | grep -Fxn -m 1 "$CURRSSID" | awk -F ":" '{print $1}') + 1" | bc )
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$CONSTATE" =~ "habilitat" ]]; then
|
||||||
|
TOGGLE="toggle off"
|
||||||
|
elif [[ "$CONSTATE" =~ "deshabilitat" ]]; then
|
||||||
|
TOGGLE="toggle on"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
CHENTRY=$(echo -e "$TOGGLE\nmanual\n$LIST" | uniq -u | $rofi_command -p "Wi-Fi SSID: " -a "$HIGHLINE")
|
||||||
|
#echo "$CHENTRY"
|
||||||
|
CHSSID=$(echo "$CHENTRY" | sed 's/\s\{2,\}/\|/g' | awk -F "|" '{print $1}')
|
||||||
|
#echo "$CHSSID"
|
||||||
|
|
||||||
|
# If the user inputs "manual" as their SSID in the start window, it will bring them to this screen
|
||||||
|
if [ "$CHENTRY" = "manual" ] ; then
|
||||||
|
# Manual entry of the SSID and password (if appplicable)
|
||||||
|
MSSID=$(echo "enter the SSID of the network (SSID,password)" | $rofi_command -p "Manual Entry: " -lines 1)
|
||||||
|
# Separating the password from the entered string
|
||||||
|
MPASS=$(echo "$MSSID" | awk -F "," '{print $2}')
|
||||||
|
|
||||||
|
#echo "$MSSID"
|
||||||
|
#echo "$MPASS"
|
||||||
|
|
||||||
|
# If the user entered a manual password, then use the password nmcli command
|
||||||
|
if [ "$MPASS" = "" ]; then
|
||||||
|
nmcli dev wifi con "$MSSID"
|
||||||
|
else
|
||||||
|
nmcli dev wifi con "$MSSID" password "$MPASS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ "$CHENTRY" = "toggle on" ]; then
|
||||||
|
nmcli radio wifi on
|
||||||
|
|
||||||
|
elif [ "$CHENTRY" = "toggle off" ]; then
|
||||||
|
nmcli radio wifi off
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
# If the connection is already in use, then this will still be able to get the SSID
|
||||||
|
if [ "$CHSSID" = "*" ]; then
|
||||||
|
CHSSID=$(echo "$CHENTRY" | sed 's/\s\{2,\}/\|/g' | awk -F "|" '{print $3}')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Parses the list of preconfigured connections to see if it already contains the chosen SSID. This speeds up the connection process
|
||||||
|
if [[ $(echo "$KNOWNCON" | grep "$CHSSID") = "$CHSSID" ]]; then
|
||||||
|
nmcli con up "$CHSSID"
|
||||||
|
else
|
||||||
|
if [[ "$CHENTRY" =~ "WPA2" ]] || [[ "$CHENTRY" =~ "WEP" ]]; then
|
||||||
|
WIFIPASS=$(echo "Enter password, if connection is stored, hit enter" | $rofi_command -p "Password: " -lines 1 )
|
||||||
|
fi
|
||||||
|
nmcli dev wifi con "$CHSSID" password "$WIFIPASS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[[ -x "$(command -v exa)" ]] && {
|
[[ -x "$(command -v eza)" ]] && {
|
||||||
alias ll="exa --group-directories-first --color=auto --git -la"
|
alias ll="eza --group-directories-first --color=auto --icons=auto --git -la"
|
||||||
} || {
|
} || {
|
||||||
alias ll="ls -alh --color=always --group-directories-first"
|
alias ll="ls -alh --color=always --group-directories-first"
|
||||||
}
|
}
|
||||||
4
config/shell/zsh/002-fzf.zsh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
if [ -n "${commands[fzf-share]}" ]; then
|
||||||
|
source "$(fzf-share)/key-bindings.zsh"
|
||||||
|
source "$(fzf-share)/completion.zsh"
|
||||||
|
fi
|
||||||
1
config/shell/zsh/003-p10k-fix.zsh
Normal file
@@ -0,0 +1 @@
|
|||||||
|
unset ZSH_AUTOSUGGEST_USE_ASYNC
|
||||||
1
config/shell/zsh/004-zoxide.zsh
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[[ -x "$(command -v zoxide)" ]] && eval "$(zoxide init --cmd cd zsh)"
|
||||||
93
data/devenv/devenv.sh
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
SANDBOXES_DIR=$HOME/sandbox
|
||||||
|
TEMPLATES_DIR=$XDG_DATA_HOME/devenv/templates
|
||||||
|
|
||||||
|
list_templates() {
|
||||||
|
echo "The available templates are:"
|
||||||
|
ls $TEMPLATES_DIR
|
||||||
|
}
|
||||||
|
|
||||||
|
check_template () {
|
||||||
|
TEMPLATE=$1
|
||||||
|
if [ -z "$TEMPLATE" ]; then
|
||||||
|
echo "No template given"
|
||||||
|
list_templates
|
||||||
|
return 1
|
||||||
|
elif [ ! -e "$TEMPLATES_DIR/$TEMPLATE" ]; then
|
||||||
|
echo "The given template '$TEMPLATE' doesn't exist!"
|
||||||
|
list_templates
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
devenv_install() {
|
||||||
|
TEMPLATE=$1
|
||||||
|
install -m 644 $TEMPLATES_DIR/$TEMPLATE/* ./
|
||||||
|
echo "use flake . --impure" > .envrc
|
||||||
|
direnv allow
|
||||||
|
}
|
||||||
|
|
||||||
|
devenv_init() {
|
||||||
|
TEMPLATE=$1
|
||||||
|
if ! check_template $TEMPLATE ; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
devenv_install $TEMPLATE
|
||||||
|
}
|
||||||
|
|
||||||
|
devenv_sandbox() {
|
||||||
|
DIRECTORY=$1
|
||||||
|
if [ -z "$DIRECTORY" ]; then
|
||||||
|
show_help_sandbox
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
SANDBOX_DIR="$SANDBOXES_DIR/$DIRECTORY"
|
||||||
|
TEMPLATE=$2
|
||||||
|
if [ -z "$TEMPLATE" ]; then
|
||||||
|
TEMPLATE=$DIRECTORY
|
||||||
|
fi
|
||||||
|
if ! check_template $TEMPLATE; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ ! -e $SANDBOX_DIR ]; then
|
||||||
|
echo "Creating sandbox at $SANDBOX_DIR with template $TEMPLATE"
|
||||||
|
mkdir -p $SANDBOX_DIR
|
||||||
|
cd $SANDBOX_DIR
|
||||||
|
devenv_init $TEMPLATE
|
||||||
|
else
|
||||||
|
cd $SANDBOX_DIR
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
show_help_sandbox() {
|
||||||
|
echo "Usage: devenv sandbox <directory> [<template>]"
|
||||||
|
echo ""
|
||||||
|
echo " directory: The sandbox directory to go to."
|
||||||
|
echo " template: If the directory doesn't exist, the template to use for that sandbox"
|
||||||
|
echo " Defaults to directory if not given."
|
||||||
|
echo ""
|
||||||
|
}
|
||||||
|
|
||||||
|
show_help() {
|
||||||
|
echo "Usage: devenv <action>"
|
||||||
|
echo "Available actions:"
|
||||||
|
echo ""
|
||||||
|
echo " init: Initialize a dev env in the current directory"
|
||||||
|
echo " sandbox: Go to a sandbox directory using a template"
|
||||||
|
echo ""
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
init)
|
||||||
|
shift
|
||||||
|
devenv_init $@
|
||||||
|
;;
|
||||||
|
sandbox)
|
||||||
|
shift
|
||||||
|
devenv_sandbox $@
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
show_help
|
||||||
|
;;
|
||||||
|
esac
|
||||||
28
data/devenv/templates/clojure/flake.nix
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
description = "Development flake for this clojure project";
|
||||||
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
|
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
|
projectDependencies = with pkgs; [
|
||||||
|
];
|
||||||
|
|
||||||
|
in {
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
nativeBuildInputs = [ pkgs.bashInteractive ];
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
# Core clojure dependencies
|
||||||
|
clojure
|
||||||
|
leiningen
|
||||||
|
# IDE tools
|
||||||
|
clojure-lsp
|
||||||
|
# Development tools
|
||||||
|
] ++ projectDependencies;
|
||||||
|
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
37
data/devenv/templates/python312/flake.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
description = "Development flake for this python project";
|
||||||
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||||
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
|
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
|
python = pkgs.python312;
|
||||||
|
pythonPackages = pkgs.python312Packages;
|
||||||
|
|
||||||
|
projectDependencies = with pythonPackages; [
|
||||||
|
];
|
||||||
|
|
||||||
|
in {
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
nativeBuildInputs = [ pkgs.bashInteractive ];
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
# Core python dependencies
|
||||||
|
python
|
||||||
|
pythonPackages.pip
|
||||||
|
pythonPackages.virtualenv
|
||||||
|
# IDE tools
|
||||||
|
pythonPackages.isort
|
||||||
|
nodePackages.pyright
|
||||||
|
# Development tools
|
||||||
|
black
|
||||||
|
pythonPackages.ipython
|
||||||
|
pythonPackages.pytest
|
||||||
|
pythonPackages.setuptools
|
||||||
|
] ++ projectDependencies;
|
||||||
|
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
55
data/devenv/templates/ros/flake.nix
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
description = "Development flake for this ROS project";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
|
ros-overlay.url = "github:lopsided98/nix-ros-overlay";
|
||||||
|
ros-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, flake-utils, ros-overlay }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
|
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [ ros-overlay.overlays.default ];
|
||||||
|
};
|
||||||
|
|
||||||
|
in {
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
# Non-ROS packages
|
||||||
|
] ++ (with rosPackages.humble; [
|
||||||
|
# ROS packages
|
||||||
|
(buildEnv {
|
||||||
|
paths = [
|
||||||
|
# Core
|
||||||
|
ros-environment
|
||||||
|
colcon
|
||||||
|
# Ros2
|
||||||
|
ros2run
|
||||||
|
ros2param
|
||||||
|
ros2topic
|
||||||
|
ros2node
|
||||||
|
ros2interface
|
||||||
|
ros2service
|
||||||
|
ros2action
|
||||||
|
ros2pkg
|
||||||
|
# RQT
|
||||||
|
rqt
|
||||||
|
rqt-msg
|
||||||
|
rqt-topic
|
||||||
|
rqt-action
|
||||||
|
rqt-service-caller
|
||||||
|
rqt-graph
|
||||||
|
# Extra
|
||||||
|
];
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
8
data/devenv/templates/rust/Cargo.toml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[package]
|
||||||
|
name = ""
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
32
data/devenv/templates/rust/flake.nix
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
description = "Development flake for this rust project";
|
||||||
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
|
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
|
projectDependencies = with pkgs; [
|
||||||
|
];
|
||||||
|
|
||||||
|
in {
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
nativeBuildInputs = [ pkgs.bashInteractive ];
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
# Core rust dependencies
|
||||||
|
rustc
|
||||||
|
cargo
|
||||||
|
# Development tools
|
||||||
|
rustfmt
|
||||||
|
rust-analyzer
|
||||||
|
clippy
|
||||||
|
] ++ projectDependencies;
|
||||||
|
|
||||||
|
LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath projectDependencies;
|
||||||
|
|
||||||
|
RUST_BACKTRACE = 1;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
100
data/nomad/caddy.nomad
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
job "caddy" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "caddy" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
volume "caddyfile" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "caddyfile"
|
||||||
|
}
|
||||||
|
|
||||||
|
volume "caddy-data" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "caddy-data"
|
||||||
|
}
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 2
|
||||||
|
interval = "2m"
|
||||||
|
delay = "1m"
|
||||||
|
mode = "fail"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" {
|
||||||
|
static = 80
|
||||||
|
to = 80
|
||||||
|
host_network = "public"
|
||||||
|
}
|
||||||
|
|
||||||
|
port "https" {
|
||||||
|
static = 443
|
||||||
|
to = 443
|
||||||
|
host_network = "public"
|
||||||
|
}
|
||||||
|
|
||||||
|
port "config" {
|
||||||
|
static = 2019
|
||||||
|
to = 2019
|
||||||
|
}
|
||||||
|
|
||||||
|
dns {
|
||||||
|
servers = ["100.80.195.56"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# CADDY
|
||||||
|
###
|
||||||
|
|
||||||
|
task "caddy" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "caddyfile"
|
||||||
|
destination = "/etc/caddy/Caddyfile"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "caddy-data"
|
||||||
|
destination = "/data"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "caddy:2.3.0-alpine"
|
||||||
|
ports = ["http", "https", "config"]
|
||||||
|
volumes = [
|
||||||
|
"/mnt/vatnajokull/lajuntament-web:/sites/lajuntament-web",
|
||||||
|
"/mnt/vatnajokull/folkugat-web:/sites/folkugat-web",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 500
|
||||||
|
memory = 128
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "caddy"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "http"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
112
data/nomad/dns.nomad
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
job "dns" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "dns" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 10
|
||||||
|
delay = "15s"
|
||||||
|
}
|
||||||
|
|
||||||
|
# VOLUMES
|
||||||
|
## pihole
|
||||||
|
|
||||||
|
volume "pihole" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "dns-pihole"
|
||||||
|
}
|
||||||
|
|
||||||
|
volume "dnsmasq" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "dns-dnsmasq"
|
||||||
|
}
|
||||||
|
|
||||||
|
## unbound
|
||||||
|
|
||||||
|
volume "unbound" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "dns-unbound"
|
||||||
|
}
|
||||||
|
|
||||||
|
# NETWORK
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "dns" {
|
||||||
|
static = 53
|
||||||
|
}
|
||||||
|
port "http" {
|
||||||
|
to = 80
|
||||||
|
}
|
||||||
|
port "unbound" {
|
||||||
|
static = 5533
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# TASKS
|
||||||
|
|
||||||
|
task "pihole" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "pihole"
|
||||||
|
destination = "/etc/pihole"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "dnsmasq"
|
||||||
|
destination = "/etc/dnsmasq.d"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
TZ = "Europe/Amsterdam"
|
||||||
|
WEBPASSWORD = "elbonfeix"
|
||||||
|
ServerIP = "100.80.195.56"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "pihole/pihole:v5.7"
|
||||||
|
ports = ["dns", "http"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 100
|
||||||
|
memory = 32
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "pihole-gui"
|
||||||
|
port = "http"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "unbound" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "unbound"
|
||||||
|
destination = "/opt/unbound/etc/unbound/"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "mvance/unbound:latest"
|
||||||
|
ports = ["unbound"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 50
|
||||||
|
memory = 32
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
62
data/nomad/folkugat.nomad
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
job "folkugat" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "folkugat" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "15s"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" {
|
||||||
|
to = 80
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Volumes
|
||||||
|
|
||||||
|
volume "folkugat" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "folkugat"
|
||||||
|
}
|
||||||
|
|
||||||
|
# FOLKUGAT WEB
|
||||||
|
task "folkugat" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
env {
|
||||||
|
JWT_SECRET = "12345"
|
||||||
|
ADMIN_PASSWORD = "banshee"
|
||||||
|
URL_SCHEME = "https"
|
||||||
|
DB_DIR = "/folkugat/db"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "marc.sastre.cat/folkugat-web:latest"
|
||||||
|
ports = ["http"]
|
||||||
|
}
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "folkugat"
|
||||||
|
destination = "/folkugat/db"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 100
|
||||||
|
memory = 512
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "folkugat"
|
||||||
|
port = "http"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
71
data/nomad/gitea.nomad
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
job "gitea" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "gitea" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "1m"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" {
|
||||||
|
to = 3000
|
||||||
|
}
|
||||||
|
port "ssh" {
|
||||||
|
static = 2222
|
||||||
|
to = 22
|
||||||
|
host_network = "public"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "gitea" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
env {
|
||||||
|
USER_UID = "1001"
|
||||||
|
USER_GID = "1001"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "gitea/gitea:latest"
|
||||||
|
ports = ["http", "ssh"]
|
||||||
|
volumes = ["/mnt/vatnajokull/nomad_volumes/gitea/data:/data"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 1000
|
||||||
|
memory = 400
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "gitea"
|
||||||
|
port = "http"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "http"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "gitea-ssh"
|
||||||
|
port = "ssh"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "ssh"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
188
data/nomad/nextcloud.nomad
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
job "nextcloud" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "nextcloud" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "1m"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Network
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "nextcloud" {
|
||||||
|
static = 8080
|
||||||
|
to = 80
|
||||||
|
}
|
||||||
|
port "mariadb" {
|
||||||
|
static = 3306
|
||||||
|
to = 3306
|
||||||
|
}
|
||||||
|
# port "collabora" {
|
||||||
|
# to = 9980
|
||||||
|
# }
|
||||||
|
}
|
||||||
|
|
||||||
|
# Volumes
|
||||||
|
|
||||||
|
volume "nextcloud" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "nextcloud"
|
||||||
|
}
|
||||||
|
|
||||||
|
volume "mariadb" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "mariadb"
|
||||||
|
}
|
||||||
|
|
||||||
|
# volume "collabora" {
|
||||||
|
# type = "host"
|
||||||
|
# read_only = false
|
||||||
|
# source = "collabora"
|
||||||
|
# }
|
||||||
|
|
||||||
|
###
|
||||||
|
# NEXTCLOUD
|
||||||
|
###
|
||||||
|
|
||||||
|
task "nextcloud" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
user = 1001
|
||||||
|
|
||||||
|
env {
|
||||||
|
MYSQL_PASSWORD = "hxKOD13MUh"
|
||||||
|
MYSQL_DATABASE = "nextcloud"
|
||||||
|
MYSQL_USER = "nextcloud"
|
||||||
|
MYSQL_HOST = "${NOMAD_ADDR_mariadb}"
|
||||||
|
NEXTCLOUD_TRUSTED_DOMAINS = "nextcloud.samfelag.xyz"
|
||||||
|
OVERWRITEPROTOCOL = "https"
|
||||||
|
}
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "nextcloud"
|
||||||
|
destination = "/var/www/html"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "nextcloud:latest"
|
||||||
|
ports = ["nextcloud"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 2000
|
||||||
|
memory = 512
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "nextcloud"
|
||||||
|
port = "nextcloud"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "nextcloud"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# MARIADB
|
||||||
|
###
|
||||||
|
|
||||||
|
task "mariadb" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
user = 1001
|
||||||
|
|
||||||
|
env {
|
||||||
|
MYSQL_ROOT_PASSWORD = "hxKOD13MUh"
|
||||||
|
MYSQL_ROOT_HOST = "${NOMAD_IP_mariadb}"
|
||||||
|
MYSQL_PASSWORD = "hxKOD13MUh"
|
||||||
|
MYSQL_DATABASE = "nextcloud"
|
||||||
|
MYSQL_USER = "nextcloud"
|
||||||
|
}
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "mariadb"
|
||||||
|
destination = "/var/lib/mysql"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "mariadb:10.5"
|
||||||
|
ports = ["mariadb"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 1000
|
||||||
|
memory = 256
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "mariadb"
|
||||||
|
tags = ["mariadb"]
|
||||||
|
|
||||||
|
port = "mariadb"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "mariadb"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# COLLABORA
|
||||||
|
###
|
||||||
|
|
||||||
|
# task "collabora" {
|
||||||
|
# driver = "docker"
|
||||||
|
|
||||||
|
# env {
|
||||||
|
# aliasgroup1 = "https://nextcloud.lajuntament.space:443"
|
||||||
|
# username = "lajuntament"
|
||||||
|
# password = "eLn1lIm4rc"
|
||||||
|
# }
|
||||||
|
|
||||||
|
# volume_mount {
|
||||||
|
# volume = "collabora"
|
||||||
|
# destination = "/etc/loolwsd"
|
||||||
|
# read_only = false
|
||||||
|
# }
|
||||||
|
|
||||||
|
# config {
|
||||||
|
# image = "collabora/code:latest"
|
||||||
|
# ports = ["collabora"]
|
||||||
|
# }
|
||||||
|
|
||||||
|
# resources {
|
||||||
|
# cpu = 2000
|
||||||
|
# memory = 1024
|
||||||
|
# }
|
||||||
|
|
||||||
|
# service {
|
||||||
|
# name = "collabora"
|
||||||
|
# port = "collabora"
|
||||||
|
|
||||||
|
# check {
|
||||||
|
# type = "tcp"
|
||||||
|
# port = "collabora"
|
||||||
|
# interval = "30s"
|
||||||
|
# timeout = "2s"
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
|
||||||
|
# }
|
||||||
|
}
|
||||||
|
}
|
||||||
67
data/nomad/old/collabora.nomad
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
job "collabora" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "collabora" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "1m"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" {
|
||||||
|
to = 9980
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
volume "collabora" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "collabora"
|
||||||
|
}
|
||||||
|
|
||||||
|
task "collabora" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
env {
|
||||||
|
domain = "nextcloud\\.lajuntament\\.space"
|
||||||
|
username = "lajuntament"
|
||||||
|
password = "eLn1lIm4rc"
|
||||||
|
extra_params = "--o:ssl.enable=false"
|
||||||
|
}
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "collabora"
|
||||||
|
destination = "/etc/loolwsd"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "collabora/code:latest"
|
||||||
|
ports = ["http"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 1500
|
||||||
|
memory = 1024
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "collabora"
|
||||||
|
port = "http"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "http"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
46
data/nomad/old/cua-quinto.nomad
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
job "cua-quinto" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "cua-quinto" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "15s"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" {
|
||||||
|
to = 80
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# CUA-QUINTO APP
|
||||||
|
task "cua-quinto" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
env {
|
||||||
|
API_PREFIX = "/cua-quinto"
|
||||||
|
API_SCHEME = "https"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "marc.sastre.cat/quinto-cua:latest"
|
||||||
|
ports = ["http"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 50
|
||||||
|
memory = 64
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "cua-quinto"
|
||||||
|
port = "http"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
106
data/nomad/old/lwt.nomad
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
job "lwt" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "lwt" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 10
|
||||||
|
delay = "30s"
|
||||||
|
}
|
||||||
|
|
||||||
|
# VOLUMES
|
||||||
|
|
||||||
|
volume "lwt-mariadb" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "lwt-mariadb"
|
||||||
|
}
|
||||||
|
|
||||||
|
volume "lwt" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "lwt"
|
||||||
|
}
|
||||||
|
|
||||||
|
# NETWORK
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "lwt" {
|
||||||
|
to = 80
|
||||||
|
}
|
||||||
|
port "mariadb" {
|
||||||
|
static = 33306
|
||||||
|
to = 3306
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# TASKS
|
||||||
|
|
||||||
|
task "mariadb" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
user = 1001
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "lwt-mariadb"
|
||||||
|
destination = "/var/lib/mysql"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
MYSQL_ALLOW_EMPTY_PASSWORD = "no"
|
||||||
|
MYSQL_ROOT_PASSWORD = "root"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "mariadb:10.7"
|
||||||
|
ports = ["mariadb"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 100
|
||||||
|
memory = 128
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "lwt" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "ghcr.io/hugofara/lwt:master"
|
||||||
|
ports = ["lwt"]
|
||||||
|
}
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "lwt"
|
||||||
|
destination = "/var/www/html/media"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
DB_HOST = "${attr.unique.network.ip-address}:33306" # "100.91.225.117"
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 100
|
||||||
|
memory = 128
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "lwt"
|
||||||
|
port = "lwt"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "lwt"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "10s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
71
data/nomad/old/minecraft.nomad
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
job "minecraft" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "minecraft" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
volume "minecraft" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "minecraft"
|
||||||
|
}
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 2
|
||||||
|
interval = "2m"
|
||||||
|
delay = "1m"
|
||||||
|
mode = "fail"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "server" {
|
||||||
|
static = 25565
|
||||||
|
to = 25565
|
||||||
|
host_network = "minecraft"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# MINECRAFT SERVER
|
||||||
|
###
|
||||||
|
|
||||||
|
task "minecraft" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "minecraft"
|
||||||
|
destination = "/data"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
EULA = "TRUE"
|
||||||
|
TZ = "Europe/Madrid"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "itzg/minecraft-server"
|
||||||
|
ports = ["server"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 2800
|
||||||
|
memory = 1900
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "minecraft"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "server"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
133
data/nomad/old/moimoin.nomad
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
job "moimoin" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "moimoin" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 10
|
||||||
|
delay = "30s"
|
||||||
|
}
|
||||||
|
|
||||||
|
# VOLUMES
|
||||||
|
|
||||||
|
volume "mysql" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "moimoin"
|
||||||
|
}
|
||||||
|
|
||||||
|
# NETWORK
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "moimoin-front" {
|
||||||
|
to = 5000
|
||||||
|
}
|
||||||
|
port "moimoin-back" {
|
||||||
|
to = 3000
|
||||||
|
}
|
||||||
|
port "mysql" {
|
||||||
|
static = 33306
|
||||||
|
to = 3306
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# TASKS
|
||||||
|
|
||||||
|
task "mysql" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
user = 1001
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "mysql"
|
||||||
|
destination = "/var/lib/mysql"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
MYSQL_DATABASE = "xat-osr"
|
||||||
|
MYSQL_ROOT_PASSWORD = "estrell4galicia"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "arm64v8/mysql:latest"
|
||||||
|
ports = ["mysql"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 500
|
||||||
|
memory = 512
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "moimoin-back" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "marc.sastre.cat/moimoin-back:latest"
|
||||||
|
ports = ["moimoin-back"]
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
MYSQL_HOST = "${attr.unique.network.ip-address}" # "100.91.225.117"
|
||||||
|
MYSQL_PORT = "33306"
|
||||||
|
MYSQL_USER = "root"
|
||||||
|
MYSQL_PASSWORD = "estrell4galicia"
|
||||||
|
MYSQL_NAME = "xat-osr"
|
||||||
|
CHAT_ADMIN_PSWD = "cervesaEspecial"
|
||||||
|
CLIENT_HOST = "marc.sastre.cat/moimoin"
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 100
|
||||||
|
memory = 128
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "moimoin-back"
|
||||||
|
port = "moimoin-back"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "moimoin-back"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "10s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "moimoin-front" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "marc.sastre.cat/moimoin-front:latest"
|
||||||
|
ports = ["moimoin-front"]
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
CLIENT_PORT = "5000"
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 100
|
||||||
|
memory = 128
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "moimoin-front"
|
||||||
|
port = "moimoin-front"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "moimoin-front"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "10s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
52
data/nomad/old/organice.nomad
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
job "organice" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "organice" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "1m"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" {
|
||||||
|
to = 5000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "organice" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
env {
|
||||||
|
ORGANICE_WEBDAV_URL = "https://nextcloud.lajuntament.space/remote.php/dav/files/marc/"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "twohundredok/organice:latest"
|
||||||
|
ports = ["http"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 100
|
||||||
|
memory = 128
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "organice"
|
||||||
|
port = "http"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "http"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
70
data/nomad/old/pasta.nomad
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
job "pasta" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "pasta" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "15s"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "backend" {
|
||||||
|
to = 3000
|
||||||
|
}
|
||||||
|
port "client" {
|
||||||
|
to = 80
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# PASTA SERVER
|
||||||
|
task "pasta-server" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
env {
|
||||||
|
PASTA_PORT = "3000"
|
||||||
|
PASTA_DIR = "/pasta"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "marc.sastre.cat/pasta-server"
|
||||||
|
ports = ["backend"]
|
||||||
|
volumes = ["/mnt/vatnajokull/nomad_volumes/pasta:/pasta"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 100
|
||||||
|
memory = 256
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "pasta-server"
|
||||||
|
port = "backend"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# PASTA CLIENT
|
||||||
|
task "pasta-client" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "marc.sastre.cat/pasta-client"
|
||||||
|
ports = ["client"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 50
|
||||||
|
memory = 32
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "pasta-client"
|
||||||
|
port = "client"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
73
data/nomad/old/pihole.nomad
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
job "pihole" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "pihole" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
volume "pihole" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "dns-pihole"
|
||||||
|
}
|
||||||
|
|
||||||
|
volume "dnsmasq" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "dns-dnsmasq"
|
||||||
|
}
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "15s"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "dns" {
|
||||||
|
static = 53
|
||||||
|
}
|
||||||
|
port "http" {
|
||||||
|
to = 80
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "pihole" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "pihole"
|
||||||
|
destination = "/etc/pihole"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "dnsmasq"
|
||||||
|
destination = "/etc/dnsmasq.d"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
TZ = "Europe/Amsterdam"
|
||||||
|
WEBPASSWORD = "elbonfeix"
|
||||||
|
ServerIP = "100.107.148.47"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "pihole/pihole:v5.7"
|
||||||
|
ports = ["dns", "http"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 100
|
||||||
|
memory = 64
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "pihole-gui"
|
||||||
|
port = "http"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
41
data/nomad/old/presencia.nomad
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
job "presencia" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "presencia" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "15s"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" {
|
||||||
|
to = 5000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# PRESENCIA APP
|
||||||
|
task "presencia" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "marc.sastre.cat/presencia"
|
||||||
|
ports = ["http"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 50
|
||||||
|
memory = 64
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "presencia"
|
||||||
|
port = "http"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
47
data/nomad/old/unbound.nomad
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
job "unbound" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "unbound" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
volume "unbound" {
|
||||||
|
type = "host"
|
||||||
|
read_only = false
|
||||||
|
source = "dns-unbound"
|
||||||
|
}
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "15s"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "dns" {
|
||||||
|
static = 5533
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "unbound" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "unbound"
|
||||||
|
destination = "/opt/unbound/etc/unbound/"
|
||||||
|
read_only = false
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "mvance/unbound:latest"
|
||||||
|
ports = ["dns"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 50
|
||||||
|
memory = 64
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
52
data/nomad/old/webhooks.nomad
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
job "webhooks" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "webhooks" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "1m"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" {
|
||||||
|
to = 6000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "webhooks" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
env {
|
||||||
|
CONFIG_FILE = "/app/data/config.json"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "marc.sastre.cat/webhooks:latest"
|
||||||
|
ports = ["http"]
|
||||||
|
volumes = ["/mnt/vatnajokull/nomad_volumes/webhooks:/app/data"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 100
|
||||||
|
memory = 128
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "webhooks"
|
||||||
|
port = "http"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "http"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
52
data/nomad/registry.nomad
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
job "registry" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["samfelag"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "registry" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 5
|
||||||
|
delay = "1m"
|
||||||
|
}
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" {
|
||||||
|
to = 5000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "registry" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
env {
|
||||||
|
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY = "/data"
|
||||||
|
}
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "registry:2"
|
||||||
|
ports = ["http"]
|
||||||
|
volumes = ["/mnt/vatnajokull/nomad_volumes/registry:/data"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 100
|
||||||
|
memory = 256
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "registry"
|
||||||
|
port = "http"
|
||||||
|
|
||||||
|
check {
|
||||||
|
type = "tcp"
|
||||||
|
port = "http"
|
||||||
|
interval = "30s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BIN
data/wallpapers/flors/flor01.png
Normal file
|
After Width: | Height: | Size: 177 KiB |
BIN
data/wallpapers/flors/flor02.png
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
data/wallpapers/flors/flor03.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
data/wallpapers/flors/flor04.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
data/wallpapers/flors/flor05.png
Normal file
|
After Width: | Height: | Size: 122 KiB |
BIN
data/wallpapers/flors/flor06.png
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
data/wallpapers/flors/flor07.png
Normal file
|
After Width: | Height: | Size: 134 KiB |
BIN
data/wallpapers/flors/flor08.png
Normal file
|
After Width: | Height: | Size: 132 KiB |