Compare commits
234 Commits
436a6dfa34
...
nixos
| Author | SHA1 | Date | |
|---|---|---|---|
|
b86cc94d23
|
|||
|
95825c6ff1
|
|||
|
3e7e404d4c
|
|||
|
bb4c77208d
|
|||
|
1f53cd2efb
|
|||
|
d9f8c16011
|
|||
|
4335805701
|
|||
|
|
4a18ae77fc | ||
|
|
5ebf3c9c5e | ||
|
|
f4e5628238 | ||
|
|
bf00621b02 | ||
|
|
ec8d9fafdd | ||
|
539b46393e
|
|||
|
|
e686aef94e | ||
|
54c45411fe
|
|||
|
|
23d6f855ee | ||
|
|
346c304427 | ||
|
0bab44bf04
|
|||
|
5579bf49c3
|
|||
|
11a8dfebff
|
|||
| c2a1654be8 | |||
|
6d431bdf9d
|
|||
|
5dc4e6d3c0
|
|||
|
5c1c326baf
|
|||
| 4e5b555498 | |||
|
895a495b3f
|
|||
|
7e4a6ac8fe
|
|||
|
cd52be2620
|
|||
|
34b2c4d015
|
|||
|
|
943956f119 | ||
|
|
27f3b76ab7 | ||
|
|
4decf54e13 | ||
|
|
abd567a8a5 | ||
|
5785832cbe
|
|||
|
0eacdcdc27
|
|||
|
0890c49887
|
|||
|
fb94547fa2
|
|||
|
c10e121604
|
|||
|
8a87dc6c93
|
|||
|
5db9d23792
|
|||
|
1651bb9356
|
|||
|
a9d4f6de5a
|
|||
|
404f35c0b9
|
|||
|
9baf54ef33
|
|||
|
5a9ff77a29
|
|||
|
87a6c1a862
|
|||
|
43660ff173
|
|||
|
fe6d79edb5
|
|||
|
da4309e2e0
|
|||
|
e1e72965f9
|
|||
|
0979956f16
|
|||
|
28c9799f60
|
|||
|
f9e29ce77f
|
|||
|
f4a8493dce
|
|||
|
e097c9d25f
|
|||
|
58ab2f07a7
|
|||
|
e1faa10e24
|
|||
|
f9ed56123d
|
|||
|
30934f006c
|
|||
|
31bec468c8
|
|||
|
6c1400e295
|
|||
|
8d3bbe9d75
|
|||
|
4f96bcda1d
|
|||
|
0ecd267fa8
|
|||
|
c590fb01dc
|
|||
|
d9a9d110de
|
|||
|
09f2e19683
|
|||
|
8b12178bfc
|
|||
|
4f0f6021e5
|
|||
|
00ead02ff1
|
|||
|
5e54dfded8
|
|||
|
|
eac8c77797 | ||
|
|
3aab004b55 | ||
|
270d7c2fe4
|
|||
|
4c87e635ab
|
|||
|
129fa4973f
|
|||
|
075ee51920
|
|||
|
aeb370f299
|
|||
|
edf8d639b3
|
|||
|
090c069a11
|
|||
|
f230a60a73
|
|||
|
ca1ea8f701
|
|||
|
570bafce6a
|
|||
|
8fd337d099
|
|||
|
7737bc5137
|
|||
|
f44ddb256b
|
|||
|
3d2befc555
|
|||
|
194f03c578
|
|||
|
d0a53ea9a3
|
|||
|
c1134662a9
|
|||
|
afbfff8e96
|
|||
|
87fcf277f5
|
|||
|
5af717ac53
|
|||
|
f6f228f990
|
|||
|
c86fb8b6d3
|
|||
|
00ea23f65c
|
|||
|
a882cc48b4
|
|||
|
684b9a41cc
|
|||
|
48e46b465f
|
|||
|
510cc18de3
|
|||
|
51281913ac
|
|||
|
2831c62ee2
|
|||
|
111920a63f
|
|||
|
faedfb51ae
|
|||
|
f748daba0f
|
|||
|
c1c4714fa2
|
|||
|
29acfc513e
|
|||
|
15f03999d3
|
|||
|
ded1e9c202
|
|||
|
856d49ee10
|
|||
|
ed71d6459c
|
|||
|
e0a9283d2e
|
|||
|
855dd5d445
|
|||
| d4554d43ae | |||
| e281e912d8 | |||
| 1fc6e8cd96 | |||
| ff831dc3e0 | |||
| e06bc88784 | |||
| 4682d7814b | |||
| 78f440f69c | |||
| cfa5a8d1b8 | |||
| c33a30be60 | |||
| 8f7781f293 | |||
| f88702525b | |||
| 149dbe2e33 | |||
| be59cc0e8a | |||
| 0e4ac5dfe5 | |||
| 04dc801925 | |||
| bfe8ae35b8 | |||
| 8e3a3aca2b | |||
| f31eb4c876 | |||
| 5652340dae | |||
| a739d6de6d | |||
| c8d74d3af8 | |||
| ab43a24e08 | |||
| 8c32c34bc7 | |||
| 1626936630 | |||
| e732d5514d | |||
| 8899dbdaee | |||
| c87410b1aa | |||
| a4173c855e | |||
| 5e4c51a4ed | |||
| df34f1fffc | |||
| 67a7c8ea27 | |||
| ec6533a782 | |||
| 5fef417fb0 | |||
| 950cf357d1 | |||
| b3fac02b73 | |||
| 7ed47be803 | |||
| 969eb05a7a | |||
| de2688145e | |||
| a18f8b7295 | |||
| cb779f9d35 | |||
| 97bc35cb07 | |||
| 6f7e8a749a | |||
| 15e6418361 | |||
| 01ab8d54b9 | |||
| 2ff04267b6 | |||
| e6cb5b2615 | |||
| aaf19ee844 | |||
| dfd8c57b60 | |||
| 42843126e3 | |||
| d654ab9463 | |||
| eac8edecd9 | |||
| df682cdebe | |||
| b09e4cf2ea | |||
| 78a51754a4 | |||
| 4f49f4f0ec | |||
| f4ce7e6aa9 | |||
| 3f4abeee23 | |||
| df4ba5fff7 | |||
| 0f648a6a90 | |||
| 436e1016d7 | |||
| 07325d0112 | |||
| 7b9bfc900c | |||
| ba36e86aec | |||
| b305a2ea68 | |||
| ddbb19952d | |||
| 67f879cfc1 | |||
| f9723b1f11 | |||
| 05a1c4707b | |||
| 3da8b6ba31 | |||
| 9289d0f172 | |||
| 3b95e2700d | |||
| b4d37cfc45 | |||
| 90bdddcabc | |||
| fc7a90ef64 | |||
| fffbd0530c | |||
| 1a22236a97 | |||
| 661910f8d6 | |||
| e8120c9a57 | |||
| 3cb1266f60 | |||
| 6faf1756d3 | |||
| 994a22a6da | |||
| c9879b147d | |||
| c7c5dfd651 | |||
| 81c072b34f | |||
| a66daf3ac6 | |||
| 423c2236b7 | |||
| d13815136b | |||
| c805f3e58a | |||
| f878d1e343 | |||
| d4f56a19e9 | |||
| f89fefa53d | |||
| 04da549117 | |||
| d65b3d0db2 | |||
| a2dfe8bea3 | |||
| 2bac5bafcd | |||
| d8b0b372f8 | |||
| 71774333bb | |||
| e2e9d5ec0f | |||
| ed3bf181ef | |||
| 81452ba490 | |||
| e88dd9b031 | |||
| 26f2fdfd0c | |||
| 53b18802dd | |||
| c27c8c3c56 | |||
| c858af7768 | |||
| ea164bddf8 | |||
| 7690f5e954 | |||
| 97530d7f6c | |||
| a1921a342b | |||
| c9e27b621d | |||
| b729daba56 | |||
| fd7dfff321 | |||
| 5ec98401aa | |||
| b8d1f01af5 | |||
| 32a4b8e5c2 | |||
| 0033e909ab | |||
| bca3b14713 | |||
| 2223c5942e | |||
| dd96dacbf7 | |||
| 881512cf97 | |||
| 72ea26c17e |
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
flake.lock linguist-generated
|
||||
*.yuck linguist-language=lisp
|
||||
**/emacs/config.org linguist-language=elisp
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -1,2 +1,8 @@
|
||||
.github
|
||||
noise.nix
|
||||
\#*\#
|
||||
.*.~*~
|
||||
~*~
|
||||
*~
|
||||
*.html
|
||||
result
|
||||
.sass-cache
|
||||
|
||||
38
README.md
38
README.md
@@ -1,38 +0,0 @@
|
||||
# Personal Dotfiles
|
||||
|
||||
## TODO
|
||||
1. Add user specific traditional dotfiles.
|
||||
2. ~~Try home-manager~~
|
||||
3. ~~Try nix flakes~~
|
||||
|
||||
## How install workey
|
||||
either do
|
||||
```
|
||||
git clone https://github.com/natto1784/dotfiles
|
||||
cd dotfiles
|
||||
nixos-rebuild switch --flake .#Satori
|
||||
```
|
||||
or
|
||||
`nixos-rebuild switch --flake github:natto1784/dotfiles#Satori`\
|
||||
Replace Satori with whatever system you want or replace to whatever hostname you want in the config
|
||||
|
||||
## How home-manager workey
|
||||
Either clone repo and do `./hm-switch` inside it (login as the user you want to change config as!!!)
|
||||
or
|
||||
```
|
||||
nix build github:natto1784/dotfiles#hm-configs.{USER}.activationPackage -o hm-result
|
||||
./hm-result/activate
|
||||
```
|
||||
You can unlink "hm-result" after that
|
||||
replace {USER} with 'natto' or whatever is availabe (or change it in the config)
|
||||
|
||||
## How packages workey
|
||||
To build or run any of the packages in this flake do\
|
||||
`nix <"run"/"build"> github:natto1784/dotfiles#pkgs.<your_arch>.<package_name>`
|
||||
|
||||
Following are the people whose configs I took inspiration from and learned stuff from
|
||||
- [fufexan](https://github.com/fufexan)
|
||||
- [NobbZ](https://github.com/NobbZ)
|
||||
- [dramforever](https://github.com/dramforever)
|
||||
|
||||
I'm grateful to all of them
|
||||
26
README.org
Normal file
26
README.org
Normal file
@@ -0,0 +1,26 @@
|
||||
#+TITLE: Personal Dotfiles
|
||||
#+AUTHOR: Amneesh Singh
|
||||
#+OPTIONS: toc:nil num:nil
|
||||
|
||||
NixOS configurations for several hosts, now with [[https://flake.parts][flake-parts]].
|
||||
|
||||
* How home-manager workey
|
||||
Just do
|
||||
#+begin_src sh
|
||||
nix run nixpkgs#home-manager switch -- --flake "git+https://git.weirdnatto.in/natto1784/dotfiles?ref=nixos"
|
||||
#+end_src
|
||||
|
||||
* How packages workey
|
||||
To build or run any of the packages in this flake do
|
||||
#+begin_src sh
|
||||
nix <"run"/"build"> "git+https://git.weirdnatto.in/natto1784/dotfiles?ref=nixos"#<package_name>
|
||||
#+end_src
|
||||
|
||||
-----
|
||||
|
||||
* I took help from these people and their dotfiles
|
||||
+ [[https://github.com/fufexan][fufexan]]
|
||||
+ [[https://github.com/NobbZ][NobbZ]]
|
||||
+ [[https://github.com/dramforever][dramforever]]
|
||||
|
||||
I'm grateful to all of them
|
||||
52
cert.pem
52
cert.pem
@@ -1,29 +1,29 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIE6zCCAtOgAwIBAgIUNNSWTkJnI0dCgQaJdOCX3JAWHc0wDQYJKoZIhvcNAQEL
|
||||
BQAwFDESMBAGA1UEAwwJMTAuNTUuMC4yMB4XDTIxMDYyNTEzNTYzMFoXDTIyMDYy
|
||||
NTEzNTYzMFowFDESMBAGA1UEAwwJMTAuNTUuMC4yMIICIjANBgkqhkiG9w0BAQEF
|
||||
AAOCAg8AMIICCgKCAgEAxMeQxG3pdasufk1FoJHs9gB9SjV8KwDtp3fWrF9IvU+Y
|
||||
S/AemARwcublbom8VHfAKAQymUd6ySPrxtfGfY3/p1gfiYVQDEW6tEpLas5mkrPG
|
||||
zKY3L7ORCuCcxCc6gJZIjSHQv4LpJutcsJDvGiwrw+2M+8mMD2EL0QHT8zYMefhV
|
||||
Rm9opkcgzE9uWzyzlgqEEVu7FFkBIc6s0f27ZQzYtSrabU0qeCc3jrxlux/0jupM
|
||||
73LG79CvPo3sTocDmol2Rqi85OE7KuR7CgMqa5ZkR4uLLTnp8Zia0Ha4UuMRANHN
|
||||
FxIfnXcTgkx8SQZH9JH8GAD1af5CJFvdJ1AB6QvnTSPoEGVDVlAJhq0CIakMdA/b
|
||||
HALiM1+o7M39HyHv2f8UZ2CsESmCpgxVsISCKkVeGt4VrsvgxmJU+NQPGci8Vgwx
|
||||
Vv5KueenzfmyX1DYRm1IJz4IufG3wypGSMWwrIDFCLfFhBm1buJLdU+mLddD+jA3
|
||||
tc0JnxB7VINEhb0DiK1OuxeRhRrp6IjDUurMdQ+euyTToJAttfm0USUQx+43aNot
|
||||
hd4ZwfX43oN//N+wGr0gKENmO5mF95mQTmPdH+1JlKsyMgXoWerezE8kFsCfK6Z6
|
||||
1eEvaFtqsPYN/dmXQRQQGW80iQKPFdmwk33KyH5TLBSLDlJCuz/ml9HC6CSQ+zMC
|
||||
MIIE6zCCAtOgAwIBAgIUYwGtP4yx0u86Vhmz/QMYny9UZNkwDQYJKoZIhvcNAQEL
|
||||
BQAwFDESMBAGA1UEAwwJMTAuNTUuMC4yMB4XDTIyMDEyMTA3NTI1M1oXDTMyMDEx
|
||||
OTA3NTI1M1owFDESMBAGA1UEAwwJMTAuNTUuMC4yMIICIjANBgkqhkiG9w0BAQEF
|
||||
AAOCAg8AMIICCgKCAgEA8WLjrsuY8F1dAIVxYDwZSl8IXh2msJJw/mQlpKXS4UKm
|
||||
ypwYNuV/onEwqX+J4j09+IKFD5CDOXJ6ttUkdYRBt+sJ3irR82PBJWw1VN0Hx4XX
|
||||
4ln8nVyZzM5DXERGjk9odN0B0ItKrYR7IoX4peabuU8mHamLbnO0k2TOjChFqFC1
|
||||
1C7m2KRJ8RSAP17oYnwi7zUs8ZCBHaoxD1mhcCrCTgA2fGiv1CAtkoYuPLabxgwA
|
||||
o9flmw+s2f95dGmWAybKzRGHXXy26CfU0HWwujkEPWORwuh2aISY+nVY+jigqae8
|
||||
5SuL2qHnQW5CxViUjG8tzsuSq/Tad+EbQ8UsxjPgzoD3NdK0Ynk4vUKoBShVPqkk
|
||||
Psut7eaVykJ7E3Epv/BnJlvfTvqnR0VwCI5A0QQd37inBU2Qlv5cK3sKKmN4xdMt
|
||||
r26eVYG05u+d3PbC7GW/Ocydu74U8vUtBN/ev5QzYFPwjz6shabfIRdjNy1o38tX
|
||||
CZjCvdh19WJinQjCoRqBMqD29pM7QBb4ubn4Yj2xTdGu5jbeHwSwk5aof3kZi7OD
|
||||
yZJvidkz1xwvTfhDFIMmGwdEofeVcn3UpYzTN8/+6dQVk1SyGHf1+UOe3d8xcXQf
|
||||
KEHOJsOlq9W54VtAj+WfPvAEF6dI8GdIMc9rjvPVUWtJdEYIVA1RL20tt0CL1BkC
|
||||
AwEAAaM1MDMwCwYDVR0PBAQDAgQwMBMGA1UdJQQMMAoGCCsGAQUFBwMBMA8GA1Ud
|
||||
EQQIMAaHBAo3AAIwDQYJKoZIhvcNAQELBQADggIBAAMB4ykzYA6bAPRftL82VrkM
|
||||
Ls8p5xdXogiE68QegoGVIV1R4j6JEotPSdDsvt5B77RVgL1aJ/rIsjfX26IkN9me
|
||||
wTE0NlhOSWY2ShsPJ9YRHPV0UAyrzE0KPVqnpeQWuS6Vt7aNaAcNXR/Xgs+DJCab
|
||||
SfWN6uZHbgYxoMzbV7Xk5HOinJmxt2r31+LZL4rCUajobpNdod6a1s2XQz8vwKgA
|
||||
c7tUEfTe48YOXeLT4GcugYDL+JliaDTwXWJ5VzQByJeBvwLsggVRBtsxT2tbr0iT
|
||||
FBPRK+vT20vZVACzxUlRpvzUGau16IdzF2u8/KO+0Zbpm9k/EzPRvJcxt5mBp+Mh
|
||||
joqTtp3SG/nCbs+6z8FYzZYHzWPHg1YdcZcnWj7YUDDIZLLJMX+0hGUcWLKV9+MV
|
||||
VCGpRGY8IZ+Ke3KN0J0IkJLfERezQdyVrSJlgvKAjICQ4dboLCFFm1EvEp/beSnW
|
||||
9STGWRREyId7e3UeL0EBnISd3ym7O+oY2QcbCTj+WPaFefovwBfixG4AFEJlJsYp
|
||||
1gQClz28AvDT6aDYSKWodQKXSbz5j0BLG5ez7IBEdvXzmcZU53kKmn5oW9pE7q2M
|
||||
0OCu628xx51ePG2FgF50vvA5rzJjDIN+vwS+oBSNKG8KscsxGt3V4g3Hmzzh9qg+
|
||||
LUHIEflezPJoCBc1CBBm
|
||||
EQQIMAaHBAo3AAIwDQYJKoZIhvcNAQELBQADggIBABElHiY1vOY2ksNNAr/McpgH
|
||||
1OHhQhMt91Ah1fXsyo25MebTq2MUz5E/csBaHU+iRHVJ2IDhKh9xQtzvvnuLHSHe
|
||||
of7Tm4GkHpeTq8p8FuCP7r6BN7ehJm4z9zewExPP6QtRXgkJsOeud47yKCgW/9sH
|
||||
UVwUSB0pBpz8E87VbxnAqbjpfAWY2L5y/7o/g6iaX5Kwn5mNtgWHrjTD1Itdl738
|
||||
+ESurei7JDBF0zJAEDxqvIuuVl1rkoTru7MaCT12Y9tfWYUyYDbXgZ3daIrAhnWs
|
||||
ZZveNOLbtpB1099L/sdsbITfNg4pDtMvOTp3NCN4jkt+vFopwMpUYxXSADrJ14MJ
|
||||
3dUdYtlFcqtP7j2Da74ldw+5U7T8DJi8fOQ+KpNpGaE+OG+X9pl+1QPdisRBADuc
|
||||
pCDFgAitiL9XUnErlm6G+pbgFdC2sXRDsBfawp9ApWOCdNb5VQ9KwJPoD1ZxQBkx
|
||||
x/7eCtKy6q6XyPkT/Feib0R1Fsiet6PYaCt9sWercvEogqgJSVbtihebj0z5Bl2W
|
||||
q3j22H7UL/P5yiQlDs4t+OUfDVd3wk9l5DD+b8jhawuOSYwbUU8X+fex+8nt08AY
|
||||
MxKS3xXoO872XiW4zq6ymOyGzpTZRkPywQzrQdpjrs4umJa8hFf207liMWdHflte
|
||||
sr09NMvxcPr+WNEuKV6r
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
45
conf/colors.nix
Normal file
45
conf/colors.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
#Catpuccin Mocha
|
||||
let
|
||||
colors = rec {
|
||||
rosewater = "#F5E0DC";
|
||||
flamingo = "#F2CDCD";
|
||||
pink = "#F5C2E7";
|
||||
mauve = "#CBA6F7";
|
||||
red = "#F38BA8";
|
||||
maroon = "#EBA0AC";
|
||||
peach = "#FAB387";
|
||||
yellow = "#F9E2AF";
|
||||
green = "#A6E3A1";
|
||||
teal = "#94E2D5";
|
||||
sky = "#89DCEB";
|
||||
sapphire = "#74C7EC";
|
||||
blue = "#89B4FA";
|
||||
lavender = "#B4BEFE";
|
||||
|
||||
text = "#CDD6F4";
|
||||
subtext1 = "#BAC2DE";
|
||||
subtext0 = "#A6ADC8";
|
||||
overlay2 = "#9399B2";
|
||||
overlay1 = "#7F849C";
|
||||
overlay0 = "#6C7086";
|
||||
surface2 = "#585B70";
|
||||
surface1 = "#45475A";
|
||||
surface0 = "#313244";
|
||||
|
||||
base = "#1E1E2E";
|
||||
mantle = "#181825";
|
||||
crust = "#11111B";
|
||||
|
||||
background = base;
|
||||
foreground = text;
|
||||
};
|
||||
in
|
||||
rec {
|
||||
default = with builtins; mapAttrs (_: color: substring 1 6 color) colors; # hex without hash
|
||||
hex = colors; # hex with hash
|
||||
argb =
|
||||
{
|
||||
a ? "ff",
|
||||
}:
|
||||
builtins.mapAttrs (_: color: a + color) default; # ARGB
|
||||
}
|
||||
11
conf/default.nix
Normal file
11
conf/default.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ inputs, self, ... }:
|
||||
{
|
||||
config._module.args.globalArgs = {
|
||||
inherit inputs self;
|
||||
flake = self;
|
||||
conf = {
|
||||
colors = import ./colors.nix;
|
||||
network = import ./network.nix;
|
||||
};
|
||||
};
|
||||
}
|
||||
31
conf/network.nix
Normal file
31
conf/network.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
addresses = rec {
|
||||
wireguard = rec {
|
||||
ipPrefix = "10.55.0";
|
||||
prefixLength = 24;
|
||||
ipsWithPrefixLength = "10.55.0.0/24";
|
||||
ips = {
|
||||
remilia = "${ipPrefix}.1";
|
||||
marisa = "${ipPrefix}.2";
|
||||
satori = "${ipPrefix}.3";
|
||||
hina = "${ipPrefix}.4";
|
||||
okina = "${ipPrefix}.5";
|
||||
suwako = "${ipPrefix}.6";
|
||||
};
|
||||
};
|
||||
domain = {
|
||||
natto = "weirdnatto.in";
|
||||
amneesh = "amneesh.com";
|
||||
chutiya = "chutiya.online";
|
||||
};
|
||||
};
|
||||
|
||||
commonSSHKeys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJHingN2Aho+KGgEvBMjtoez+W1svl9uVoa4vG0d646j"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPX1HDzWpoaOcU8GDEGuDzXgxkCpyeqxRR6gLs/8JgHw"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOSQnDNrNP69tIK7U2D7qaMjycfIjpgx0at4U2D5Ufib"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK5V/hdkTTQSkDLXaEwY8xb/T8+sWtw5c6UjYOPaTrO8"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKFyKi0HYfkgvEDvjzmDRGwAq2z2KOkfv7scTVSnonBh"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICEow6+G9F0JjvVwnyrFoObFAKKBQQ2wwScST0Xzs1l"
|
||||
];
|
||||
}
|
||||
18
consul-agent-ca.pem
Normal file
18
consul-agent-ca.pem
Normal file
@@ -0,0 +1,18 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC7jCCApSgAwIBAgIRAMFIx6TUVrRAUeIXb57HF3gwCgYIKoZIzj0EAwIwgbkx
|
||||
CzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNj
|
||||
bzEaMBgGA1UECRMRMTAxIFNlY29uZCBTdHJlZXQxDjAMBgNVBBETBTk0MTA1MRcw
|
||||
FQYDVQQKEw5IYXNoaUNvcnAgSW5jLjFAMD4GA1UEAxM3Q29uc3VsIEFnZW50IENB
|
||||
IDI1NjkxODg5NzgxODk0ODY5MDk5NjUyNTU0MzM3NjIzMzYzMzY1NjAeFw0yMjEw
|
||||
MjMxMjUxMDRaFw0yNzEwMjIxMjUxMDRaMIG5MQswCQYDVQQGEwJVUzELMAkGA1UE
|
||||
CBMCQ0ExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xGjAYBgNVBAkTETEwMSBTZWNv
|
||||
bmQgU3RyZWV0MQ4wDAYDVQQREwU5NDEwNTEXMBUGA1UEChMOSGFzaGlDb3JwIElu
|
||||
Yy4xQDA+BgNVBAMTN0NvbnN1bCBBZ2VudCBDQSAyNTY5MTg4OTc4MTg5NDg2OTA5
|
||||
OTY1MjU1NDMzNzYyMzM2MzM2NTYwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQv
|
||||
tcFGqOowIT/b5BefJv01uQaRCnaGnFJVC1TXe9WEyA4Lw1/+N8LQwiPSv4jp+IUF
|
||||
ec8n6fHbX0XgHxQYgeMYo3sweTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUw
|
||||
AwEB/zApBgNVHQ4EIgQgNli2bO4+L+2+K/cSffjSKMGowla+pq5nW2ygI94ies8w
|
||||
KwYDVR0jBCQwIoAgNli2bO4+L+2+K/cSffjSKMGowla+pq5nW2ygI94ies8wCgYI
|
||||
KoZIzj0EAwIDSAAwRQIhAO9CkARtyOsZnTNgTUOwKX28UV0YEYus12iv/rDVpK0y
|
||||
AiBgmfIEzC+Lkitst6O3pahAneltSKid65Racp8lGKrRhg==
|
||||
-----END CERTIFICATE-----
|
||||
1182
flake.lock
generated
1182
flake.lock
generated
File diff suppressed because it is too large
Load Diff
201
flake.nix
201
flake.nix
@@ -1,138 +1,85 @@
|
||||
{
|
||||
inputs = {
|
||||
stable.url = github:nixos/nixpkgs/nixos-21.11;
|
||||
nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable;
|
||||
master.url = github:nixos/nixpkgs/master;
|
||||
home-manager.url = github:nix-community/home-manager;
|
||||
home-manager-stable.url = github:nix-community/home-manager/release-21.11;
|
||||
nur.url = github:nix-community/NUR;
|
||||
agenix.url = github:ryantm/agenix;
|
||||
utils.url = github:numtide/flake-utils;
|
||||
nvim.url = github:nix-community/neovim-nightly-overlay;
|
||||
mailserver.url = gitlab:simple-nixos-mailserver/nixos-mailserver;
|
||||
nbfc.url = github:natto1784/nbfc-linux/yawr;
|
||||
emacs.url = github:nix-community/emacs-overlay;
|
||||
nix-gaming.url = github:fufexan/nix-gaming;
|
||||
rust.url = github:oxalica/rust-overlay;
|
||||
};
|
||||
description = "dotfiles";
|
||||
|
||||
outputs = inputs@{self, nixpkgs, stable, master, ... }:
|
||||
inputs.utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
mkPkgs = channel: system: import channel {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
channels = final: prev: {
|
||||
stable = mkPkgs stable prev.system;
|
||||
unstable = mkPkgs nixpkgs prev.system;
|
||||
master = mkPkgs master prev.system;
|
||||
};
|
||||
overlays = [
|
||||
(import ./overlays/overridesandshit.nix)
|
||||
(import ./overlays/packages.nix)
|
||||
];
|
||||
in
|
||||
{
|
||||
legacyPackages = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = overlays ++ [
|
||||
inputs.nur.overlay
|
||||
inputs.nvim.overlay
|
||||
inputs.rust.overlay
|
||||
inputs.emacs.overlay
|
||||
channels
|
||||
( _: _: {
|
||||
nbfc-linux=inputs.nbfc.defaultPackage.${system};
|
||||
games = inputs.nix-gaming.packages.${system};
|
||||
})
|
||||
outputs =
|
||||
inputs@{ self, ... }:
|
||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
config.allowUnfree = true;
|
||||
config.allowBroken = true;
|
||||
};
|
||||
}) //
|
||||
(
|
||||
let
|
||||
personalModules = [
|
||||
./modules/nvidia-offload.nix
|
||||
./modules/sound.nix
|
||||
./modules/xorg.nix
|
||||
./modules/emacs
|
||||
];
|
||||
commonModules = [
|
||||
./modules/nvim
|
||||
./modules/vault-agent.nix
|
||||
];
|
||||
serverModules = [
|
||||
./modules/builder.nix
|
||||
./modules/min-pkgs.nix
|
||||
./modules/min-stuff.nix
|
||||
];
|
||||
in
|
||||
{
|
||||
hm-configs = {
|
||||
natto = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
system = "x86_64-linux";
|
||||
configuration = { lib, ... }: {
|
||||
imports = [
|
||||
./home/natto.nix
|
||||
];
|
||||
nixpkgs = {
|
||||
overlays = self.legacyPackages.x86_64-linux.overlays;
|
||||
config.allowUnfree = true;
|
||||
config.allowBroken = true;
|
||||
config.permittedInsecurePackages = [
|
||||
"electron-9.4.4"
|
||||
];
|
||||
|
||||
imports = [
|
||||
./hosts
|
||||
./home
|
||||
./pkgs
|
||||
./conf
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{ system, pkgs, ... }:
|
||||
rec {
|
||||
formatter = pkgs.nixfmt-tree;
|
||||
devShells.default =
|
||||
with pkgs;
|
||||
mkShell {
|
||||
packages = [
|
||||
nixd
|
||||
formatter
|
||||
];
|
||||
};
|
||||
_module.args.pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
};
|
||||
homeDirectory = "/home/natto";
|
||||
username = "natto";
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
#Home laptop
|
||||
Satori = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./hosts/satori
|
||||
inputs.agenix.nixosModules.age
|
||||
{
|
||||
nixpkgs.pkgs = self.legacyPackages.x86_64-linux;
|
||||
}
|
||||
]
|
||||
++ personalModules
|
||||
++ commonModules;
|
||||
};
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
#Home server (RPi4)
|
||||
Marisa = nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
./hosts/servers/marisa.nix
|
||||
#inputs.mailserver.nixosModules.mailserver
|
||||
{
|
||||
nixpkgs.pkgs = self.legacyPackages.aarch64-linux;
|
||||
}
|
||||
]
|
||||
++ commonModules
|
||||
++ serverModules;
|
||||
};
|
||||
stable.url = "github:nixos/nixpkgs/release-24.05";
|
||||
|
||||
#Oracle Cloud VM
|
||||
Remilia = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./hosts/servers/remilia.nix
|
||||
inputs.mailserver.nixosModules.mailserver
|
||||
{
|
||||
nixpkgs.pkgs = self.legacyPackages.x86_64-linux;
|
||||
}
|
||||
]
|
||||
++ commonModules
|
||||
++ serverModules;
|
||||
};
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
});
|
||||
|
||||
mailserver = {
|
||||
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
filehost = {
|
||||
url = "github:natto1784/yamaf";
|
||||
};
|
||||
|
||||
nix-gaming.url = "github:fufexan/nix-gaming";
|
||||
|
||||
nbfc = {
|
||||
url = "github:nbfc-linux/nbfc-linux";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
||||
|
||||
nvim-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
||||
|
||||
hyprland = {
|
||||
type = "git";
|
||||
url = "https://github.com/hyprwm/Hyprland";
|
||||
submodules = true;
|
||||
};
|
||||
|
||||
hyprland-contrib = {
|
||||
url = "github:hyprwm/contrib";
|
||||
};
|
||||
|
||||
agenix.url = "github:ryantm/agenix";
|
||||
|
||||
ags.url = "github:Aylur/ags/v1";
|
||||
|
||||
nixgl.url = "github:nix-community/nixGL";
|
||||
};
|
||||
}
|
||||
|
||||
21
hm-switch
21
hm-switch
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "You're about to switch your home-manager configuration as '$USER'"
|
||||
read -p "Continue (y/n)?" conf
|
||||
|
||||
if [ ${conf,,} != "y" ]; then
|
||||
echo "If this is not you, then log into your profile first!"
|
||||
exit 1
|
||||
else
|
||||
|
||||
read -p "Do you want to use sudo instead of doas? (y/n)" conf2
|
||||
elev="doas"
|
||||
if [ ${conf2,,} == "y" ]; then
|
||||
elev="sudo"
|
||||
fi
|
||||
|
||||
$elev nix build .\#hm-configs.$USER.activationPackage -o hm-result
|
||||
./hm-result/activate
|
||||
$elev unlink hm-result
|
||||
fi
|
||||
|
||||
8
home/README
Normal file
8
home/README
Normal file
@@ -0,0 +1,8 @@
|
||||
natto : default user for okina (desktop - NixOS Unstable)
|
||||
natto-laptop : default user for satori (laptop - NixOS Unstable)
|
||||
bat : default user for remilia (Oracle VM - NixOS Unstable)
|
||||
spin : default user for hina (Oracle VM - NixOS Unstable)
|
||||
spark : default user for marisa (RPi4 - NixOS Unstable)
|
||||
kero : default user for suwako (ARM OracleVM - NixOS Unstable)
|
||||
amneesh : default user for nightbug (Workplace PC - Arch Linux)
|
||||
|
||||
37
home/amneesh/default.nix
Normal file
37
home/amneesh/default.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home = {
|
||||
homeDirectory = "/home/amneesh";
|
||||
username = "amneesh";
|
||||
stateVersion = "24.05";
|
||||
};
|
||||
|
||||
targets.genericLinux.enable = true;
|
||||
|
||||
imports = [
|
||||
./pkgs.nix
|
||||
./nixgl.nix
|
||||
./screen.nix
|
||||
./wayvnc.nix
|
||||
|
||||
# From personal
|
||||
../natto/ags
|
||||
../natto/emacs.nix
|
||||
../natto/browser.nix
|
||||
../natto/dunst.nix
|
||||
../natto/gtk.nix
|
||||
../natto/cursor.nix
|
||||
../natto/wayland.nix
|
||||
../natto/hypridle.nix
|
||||
../natto/hyprlock.nix
|
||||
../natto/hyprpaper.nix
|
||||
../natto/hyprland.nix
|
||||
../natto/tofi.nix
|
||||
../natto/foot.nix
|
||||
];
|
||||
}
|
||||
29
home/amneesh/nixgl.nix
Normal file
29
home/amneesh/nixgl.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (inputs) nixgl;
|
||||
inherit (inputs.hyprland.packages.${pkgs.system}) hyprland;
|
||||
inherit (config.lib.nixGL) wrap;
|
||||
in
|
||||
{
|
||||
nixGL = {
|
||||
packages = nixgl.packages;
|
||||
defaultWrapper = "mesa";
|
||||
offloadWrapper = "nvidiaPrime";
|
||||
installScripts = [
|
||||
"mesa"
|
||||
"nvidiaPrime"
|
||||
];
|
||||
};
|
||||
|
||||
# hyprland
|
||||
wayland.windowManager.hyprland.package = lib.mkForce (wrap hyprland);
|
||||
|
||||
# hypridle
|
||||
services.hypridle.package = lib.mkForce (wrap pkgs.hypridle);
|
||||
}
|
||||
29
home/amneesh/pkgs.nix
Normal file
29
home/amneesh/pkgs.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
xdg.mime.enable = true;
|
||||
programs = {
|
||||
bash.enable = true;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
cmake
|
||||
corkscrew
|
||||
dtc
|
||||
file
|
||||
htop
|
||||
llvmPackages.clang
|
||||
(nattovim.override { nvimPackage = inputs.nvim-overlay.packages.${pkgs.system}.neovim; })
|
||||
meson
|
||||
ninja
|
||||
thunderbird
|
||||
wget
|
||||
xfce.thunar
|
||||
libreoffice
|
||||
git-repo
|
||||
];
|
||||
}
|
||||
12
home/amneesh/screen.nix
Normal file
12
home/amneesh/screen.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home = {
|
||||
packages = [ pkgs.screen ];
|
||||
|
||||
file = {
|
||||
".screenrc".text = ''
|
||||
defscrollback 10000
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
13
home/amneesh/wayvnc.nix
Normal file
13
home/amneesh/wayvnc.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.wayvnc = rec {
|
||||
enable = true;
|
||||
autoStart = enable;
|
||||
settings = {
|
||||
address = "0.0.0.0";
|
||||
port = 5900;
|
||||
};
|
||||
};
|
||||
}
|
||||
4
home/common/direnv/default.nix
Normal file
4
home/common/direnv/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.direnv.enable = true;
|
||||
}
|
||||
20
home/common/fonts/default.nix
Normal file
20
home/common/fonts/default.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
fira-code
|
||||
fira-mono
|
||||
monoid
|
||||
font-awesome
|
||||
material-icons
|
||||
material-design-icons
|
||||
lohit-fonts.devanagari
|
||||
lohit-fonts.gurmukhi
|
||||
office-code-pro
|
||||
eb-garamond
|
||||
noto-fonts-cjk-sans
|
||||
takao
|
||||
liberation_ttf
|
||||
];
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
}
|
||||
9
home/common/laptop.nix
Normal file
9
home/common/laptop.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.isLaptop = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether this device is a laptop or not";
|
||||
};
|
||||
}
|
||||
28
home/common/zsh/default.nix
Normal file
28
home/common/zsh/default.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
autocd = true;
|
||||
history = rec {
|
||||
expireDuplicatesFirst = true;
|
||||
size = 30000;
|
||||
save = size;
|
||||
};
|
||||
autosuggestion.enable = true;
|
||||
enableCompletion = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
prezto = {
|
||||
enable = true;
|
||||
prompt.theme = "pure";
|
||||
autosuggestions.color = "fg=yellow,bold";
|
||||
utility.safeOps = false;
|
||||
extraConfig = lib.mkBefore ''
|
||||
export GREP_COLORS="mt=01;31"
|
||||
'';
|
||||
};
|
||||
initContent = lib.mkAfter ''
|
||||
unsetopt extendedGlob
|
||||
[[ -f ~/.zsh_custom ]] && source ~/.zsh_custom
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
#! /bin/sh
|
||||
bspc rule -r "*"
|
||||
##Autostart
|
||||
pgrep -x sxhkd > /dev/null || sxhkd &
|
||||
picom --experimental-backends &
|
||||
feh --bg-scale ~/Downloads/gruvbox.jpg &
|
||||
killall "polybar"
|
||||
polybar main &
|
||||
killall node
|
||||
node /mnt/Stuff/code/muhbot
|
||||
|
||||
|
||||
|
||||
bspc monitor -d
|
||||
#bspc monitor -d I II III IV V VI VII VIII IX X
|
||||
|
||||
bspc config border_width 2
|
||||
bspc config window_gap 10
|
||||
bspc config focus_follows_pointer true
|
||||
|
||||
bspc config split_ratio 0.52
|
||||
bspc config borderless_monocle true
|
||||
bspc config gapless_monocle true
|
||||
bspc config single_monocle true
|
||||
bspc config top_padding 50
|
||||
|
||||
bspc config normal_border_color "#ffffff"
|
||||
bspc config active_border_color "#1bb1b1"
|
||||
bspc config focused_border_color "#fe8019"
|
||||
bspc config urgent_border_color "#fe8019"
|
||||
@@ -1,66 +0,0 @@
|
||||
[global]
|
||||
monitor = 0
|
||||
follow = mouse
|
||||
geometry = "250x20-50+20"
|
||||
|
||||
# Turn on the progess bar
|
||||
progress_bar = true
|
||||
progress_bar_height = 3
|
||||
progress_bar_frame_width = 1
|
||||
progress_bar_min_width = 125
|
||||
progress_bar_max_width = 250
|
||||
indicate_hidden = yes
|
||||
shrink = no
|
||||
|
||||
transparency = 0.8
|
||||
separator_height = 2
|
||||
padding = 5
|
||||
text_icon_padding = 4
|
||||
frame_width = 3
|
||||
frame_color = "#ebdbb2"
|
||||
separator_color = frame
|
||||
sort = yes
|
||||
idle_threshold = 120
|
||||
font = Fira Mono 10
|
||||
markup = full
|
||||
format = "<b>%a<b> - %s\n%b"
|
||||
alignment = left
|
||||
vertical_alignment = center
|
||||
show_age_threshold = 60
|
||||
word_wrap = yes
|
||||
ellipsize = middle
|
||||
ignore_newline = no
|
||||
stack_duplicates = true
|
||||
hide_duplicate_count = false
|
||||
show_indicators = yes
|
||||
icon_position = left
|
||||
min_icon_size = 0
|
||||
max_icon_size = 32
|
||||
icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
|
||||
sticky_history = yes
|
||||
history_length = 20
|
||||
dmenu = /usr/bin/dmenu -p dunst:
|
||||
browser = /usr/bin/firefox -new-tab
|
||||
always_run_script = true
|
||||
title = Dunst
|
||||
class = Dunst
|
||||
startup_notification = false
|
||||
verbosity = mesg
|
||||
corner_radius = 1
|
||||
ignore_dbusclose = false
|
||||
|
||||
[urgency_low]
|
||||
background = "#222222"
|
||||
foreground = "#888888"
|
||||
timeout = 10
|
||||
|
||||
[urgency_normal]
|
||||
background = "#285577"
|
||||
foreground = "#ffffff"
|
||||
timeout = 10
|
||||
|
||||
[urgency_critical]
|
||||
background = "#900000"
|
||||
foreground = "#ffffff"
|
||||
frame_color = "#ff0000"
|
||||
timeout = 10
|
||||
@@ -1 +0,0 @@
|
||||
../../../modules/emacs/init.el
|
||||
@@ -1,2 +0,0 @@
|
||||
Shamelessly taken from https://github.com/mut-ex/minimal-functional-fox
|
||||
and added gruvbox colors
|
||||
@@ -1,355 +0,0 @@
|
||||
:root {
|
||||
|
||||
/* Minimal Functional Fox variables*/
|
||||
--mff-bg: #1d2021;
|
||||
--mff-icon-color: #bbbbbb;
|
||||
--mff-nav-toolbar-padding: 8px;
|
||||
--mff-sidebar-bg: var(--mff-bg);
|
||||
--mff-sidebar-color: #e0fbfc;
|
||||
--mff-tab-border-radius: 0px;
|
||||
--mff-tab-color: #ebdbb2;
|
||||
--mff-tab-font-family: "Fira Mono for Powerline", sans;
|
||||
--mff-tab-font-size: 11pt;
|
||||
--mff-tab-font-weight: 400;
|
||||
--mff-tab-height: 32px;
|
||||
--mff-tab-pinned-bg: #70c1b3;
|
||||
--mff-tab-selected-bg: #ebdbb2;
|
||||
--mff-tab-selected-color: #1d2021;
|
||||
--mff-tab-soundplaying-bg: #818181;
|
||||
--mff-tab-soundplaying-color: #1d2021;
|
||||
--mff-urlbar-color: #98c1d9;
|
||||
--mff-urlbar-focused-color: #e0fbfc;
|
||||
--mff-urlbar-font-family: "Fira Mono for Powerline", serif;
|
||||
--mff-urlbar-font-size: 12pt;
|
||||
--mff-urlbar-font-weight: 500;
|
||||
--mff-urlbar-results-color: #e0fbfc;
|
||||
--mff-urlbar-results-font-family: "Fira Mono for Powerline", serif;
|
||||
--mff-urlbar-results-font-size: 12pt;
|
||||
--mff-urlbar-results-font-weight: 500;
|
||||
--mff-urlbar-results-url-color: #98c1d9;
|
||||
/* --mff-tab-selected-bg: linear-gradient(90deg, rgba(232,74,95,1) 0%, rgba(255,132,124,1) 50%, rgba(254,206,168,1) 100%); */
|
||||
/* --mff-urlbar-font-weight: 600; */
|
||||
|
||||
/* Overriden Firefox variables*/
|
||||
--autocomplete-popup-background: var(--mff-bg) !important;
|
||||
--default-arrowpanel-background: var(--mff-bg) !important;
|
||||
--default-arrowpanel-color: #fefefa !important;
|
||||
--lwt-toolbarbutton-icon-fill: var(--mff-icon-color) !important;
|
||||
--panel-disabled-color: #f9f9fa80;
|
||||
--toolbar-bgcolor: var(--mff-bg) !important;
|
||||
--urlbar-separator-color: transparent !important;
|
||||
}
|
||||
|
||||
/*
|
||||
_____ _ ___ ___
|
||||
|_ _/_\ | _ ) __|
|
||||
| |/ _ \| _ \__ \
|
||||
|_/_/ \_\___/___/
|
||||
|
||||
*/
|
||||
|
||||
.tab-background[selected="true"] {
|
||||
background: var(--mff-tab-selected-bg) !important;
|
||||
}
|
||||
.tab-text[selected="true"] {
|
||||
color: var(--mff-tab-selected-color) !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
.tab-background:not[visuallyselected] {
|
||||
background: var(--mff-tab-selected-bg) !important;
|
||||
opacity: 0.5 !important;
|
||||
}
|
||||
|
||||
/* This positions the tabs under the navaigator container */
|
||||
#titlebar {
|
||||
-moz-box-ordinal-group: 3 !important;
|
||||
}
|
||||
|
||||
.tabbrowser-tab::after,
|
||||
.tabbrowser-tab::before {
|
||||
border-left: none !important;
|
||||
}
|
||||
|
||||
.tab-background {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.tabbrowser-arrowscrollbox {
|
||||
margin-inline-start: 4px !important;
|
||||
margin-inline-end: 0px !important;
|
||||
}
|
||||
|
||||
.tab-close-button {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-family: var(--mff-tab-font-family);
|
||||
font-weight: var(--mff-tab-font-weight);
|
||||
font-size: var(--mff-tab-font-size) !important;
|
||||
color: var(--mff-tab-color);
|
||||
}
|
||||
|
||||
/* Hide the favicon for tabs */
|
||||
hbox.tab-content .tab-icon-image {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Show the favicon for tabs that are pinned */
|
||||
hbox.tab-content[pinned=true] .tab-icon-image {
|
||||
display: initial !important;
|
||||
}
|
||||
|
||||
hbox.tab-content[pinned=true] .tab-text {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#tabbrowser-tabs {
|
||||
--tab-loading-fill: #033433 !important;
|
||||
|
||||
}
|
||||
|
||||
.tab-label-container:not([textoverflow]) {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
justify-content: center;
|
||||
width: 50% !important;
|
||||
max-width: 50% !important;
|
||||
min-width: 50% !important;
|
||||
}
|
||||
|
||||
/* .tab-label-container::after {
|
||||
content: "?" !important;
|
||||
|
||||
} */
|
||||
|
||||
.tab-line {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.tabbrowser-tab {
|
||||
border-radius: var(--mff-tab-border-radius) !important;
|
||||
border-width: 0;
|
||||
height: var(--mff-tab-height) !important;
|
||||
margin-bottom: 4px !important;
|
||||
margin-inline-end: 4px !important;
|
||||
margin-top: 4px !important;
|
||||
max-height: var(--mff-tab-height) !important;
|
||||
min-height: var(--mff-tab-height) !important;
|
||||
}
|
||||
|
||||
.tabbrowser-tab[soundplaying="true"] {
|
||||
background-color: var(--mff-tab-soundplaying-bg) !important;
|
||||
}
|
||||
|
||||
#tabs-newtab-button {
|
||||
list-style-image: url("https://raw.githubusercontent.com/mut-ex/minimal-functional-fox/master/add.svg") !important;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.tab-icon-sound {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/*
|
||||
_____ ___ ___ _ ___ _ ___
|
||||
|_ _/ _ \ / _ \| | | _ ) /_\ | _ \
|
||||
| || (_) | (_) | |__| _ \/ _ \| /
|
||||
|_| \___/ \___/|____|___/_/ \_\_|_\
|
||||
*/
|
||||
|
||||
.urlbar-icon > image {
|
||||
fill: var(--mff-icon-color) !important;
|
||||
color: var(--mff-icon-color) !important;
|
||||
}
|
||||
|
||||
.toolbarbutton-text {
|
||||
color: var(--mff-icon-color) !important;
|
||||
}
|
||||
.urlbar-icon {
|
||||
color: var(--mff-icon-color) !important;
|
||||
|
||||
}
|
||||
|
||||
.toolbarbutton-icon {
|
||||
/* filter: drop-shadow(0 0 0.75rem crimson); */
|
||||
}
|
||||
|
||||
#urlbar-results {
|
||||
font-family: var(--mff-urlbar-results-font-family);
|
||||
font-weight: var(--mff-urlbar-results-font-weight);
|
||||
font-size: var(--mff-urlbar-results-font-size) !important;
|
||||
color: var(--mff-urlbar-results-color) !important;
|
||||
}
|
||||
|
||||
.urlbarView-row[type="bookmark"] > span{
|
||||
color: green !important;
|
||||
}
|
||||
|
||||
.urlbarView-row[type="switchtab"] > span{
|
||||
color: orange !important;
|
||||
}
|
||||
|
||||
.urlbarView-url, .search-panel-one-offs-container {
|
||||
color: var(--mff-urlbar-results-url-color) !important;
|
||||
font-family: var(--mff-urlbar-font-family);
|
||||
font-weight: var(--mff-urlbar-results-font-weight);
|
||||
font-size: var(--mff-urlbar-font-size) !important;
|
||||
}
|
||||
|
||||
.urlbarView-favicon, .urlbarView-type-icon {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#urlbar-input {
|
||||
font-size: var(--mff-urlbar-font-size) !important;
|
||||
color: var(--mff-urlbar-color) !important;
|
||||
font-family: var(--mff-urlbar-font-family) !important;
|
||||
font-weight: var(--mff-urlbar-font-weight)!important;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
#tracking-protection-icon-container, #identity-box {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#back-button > .toolbarbutton-icon{
|
||||
--backbutton-background: transparent !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
#back-button {
|
||||
list-style-image: url("https://raw.githubusercontent.com/mut-ex/minimal-functional-fox/master/left-arrow.svg") !important;
|
||||
}
|
||||
|
||||
#forward-button {
|
||||
list-style-image: url("https://raw.githubusercontent.com/mut-ex/minimal-functional-fox/master/right-arrow.svg") !important;
|
||||
}
|
||||
|
||||
toolbar {
|
||||
background-image: none !important;
|
||||
}
|
||||
|
||||
#urlbar-background {
|
||||
opacity: .98 !important;
|
||||
}
|
||||
|
||||
#navigator-toolbox, toolbaritem {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
#urlbar-background {
|
||||
background-color: var(--mff-bg) !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.toolbar-items {
|
||||
background-color: var(--mff-bg) !important;
|
||||
}
|
||||
|
||||
#sidebar-search-container {
|
||||
background-color: var(--mff-sidebar-bg) !important;
|
||||
}
|
||||
|
||||
box.panel-arrowbox {
|
||||
display: none;
|
||||
}
|
||||
|
||||
box.panel-arrowcontent {
|
||||
border-radius: 8px !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
tab.tabbrowser-tab {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
tab.tabbrowser-tab:hover {
|
||||
box-shadow: 0 1px 4px rgba(0,0,0,.05);
|
||||
}
|
||||
|
||||
image#star-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
toolbar#nav-bar {
|
||||
padding: var(--mff-nav-toolbar-padding) !important;
|
||||
}
|
||||
|
||||
toolbar#nav-bar {
|
||||
padding: 4px !important;
|
||||
}
|
||||
|
||||
#urlbar {
|
||||
max-width: 70% !important;
|
||||
margin: 0 15% !important;
|
||||
/* position: unset!important; */;
|
||||
}
|
||||
|
||||
#urlbar-input:focus {
|
||||
color: var(--mff-urlbar-focused-color) !important;
|
||||
}
|
||||
|
||||
|
||||
.megabar[breakout-extend="true"]:not([open="true"]) > #urlbar-background {
|
||||
box-shadow: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
toolbarbutton {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
___ ___ ___ ___ ___ _ ___
|
||||
/ __|_ _| \| __| _ ) /_\ | _ \
|
||||
\__ \| || |) | _|| _ \/ _ \| /
|
||||
|___/___|___/|___|___/_/ \_\_|_\
|
||||
*/
|
||||
|
||||
.close-icon, .urlbar-icon {
|
||||
fill: var(--mff-icon-color) !important;
|
||||
}
|
||||
|
||||
.sidebar-placesTree {
|
||||
color: var(--mff-sidebar-color) !important;
|
||||
}
|
||||
|
||||
#sidebar-switcher-target {
|
||||
/* color: white !important; */
|
||||
}
|
||||
|
||||
#sidebar-box {
|
||||
--sidebar-background-color: var(--mff-sidebar-bg) !important;
|
||||
}
|
||||
|
||||
splitter#sidebar-splitter {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
|
||||
splitter#sidebar-splitter {
|
||||
border: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
image#sidebar-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
_ ___ ___ _____ _____ _ _ _ ___ _
|
||||
/_\ | _ \ _ \/ _ \ \ / / _ \/_\ | \| | __| |
|
||||
/ _ \| / / (_) \ \/\/ /| _/ _ \| .` | _|| |__
|
||||
/_/ \_\_|_\_|_\\___/ \_/\_/ |_|/_/ \_\_|\_|___|____|
|
||||
*/
|
||||
|
||||
.panel-arrowcontent {
|
||||
padding: 0px !important;
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
toolbarseparator {
|
||||
display: none;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
@import url("userChrome.css");
|
||||
|
||||
/* Removes white loading page */
|
||||
@-moz-document url(about:blank), url(about:newtab), url(about:home) {
|
||||
html:not(#ublock0-epicker), html:not(#ublock0-epicker) body, #newtab-customize-overlay {
|
||||
background: var(--mff-bg) !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Hide scrollbar */
|
||||
|
||||
:root{
|
||||
scrollbar-width: none !important;
|
||||
}
|
||||
|
||||
|
||||
@-moz-document url(about:privatebrowsing) {
|
||||
|
||||
:root{
|
||||
scrollbar-width: none !important;
|
||||
}
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
#
|
||||
# wm independent hotkeys
|
||||
#
|
||||
|
||||
# terminal emulator
|
||||
super + Return
|
||||
st
|
||||
|
||||
# program launcher
|
||||
super + d
|
||||
rofi -show drun
|
||||
|
||||
# make sxhkd reload its configuration files:
|
||||
super + alt + c
|
||||
pkill -USR1 -x sxhkd
|
||||
|
||||
|
||||
# quit/restart bspwm
|
||||
super + shift + {e,r}
|
||||
bspc {quit,wm -r}
|
||||
|
||||
# close and kill
|
||||
super + {_,shift + }q
|
||||
bspc node -{c,k}
|
||||
|
||||
# alternate between the tiled and monocle layout
|
||||
super + shift + f
|
||||
bspc desktop -l next
|
||||
|
||||
# send the newest marked node to the newest preselected node
|
||||
#super + y
|
||||
# bspc node newest.marked.local -n newest.!automatic.local
|
||||
|
||||
# swap the current node and the biggest window
|
||||
#super + g
|
||||
# bspc node -s biggest.window
|
||||
|
||||
#
|
||||
# state/flags
|
||||
#
|
||||
|
||||
# set the window state
|
||||
super + {t,shift + t,s,f}
|
||||
bspc node -t {\~tiled,\~pseudo_tiled,\~floating,\~fullscreen}
|
||||
|
||||
# set the node flags
|
||||
#super + ctrl + {m,x,y,z}
|
||||
# bspc node -g {marked,locked,sticky,private}
|
||||
|
||||
#
|
||||
# focus/swap
|
||||
#
|
||||
|
||||
# focus the node in the given direction
|
||||
super + shift + {h,j,k,l}
|
||||
bspc node -s {west,south,north,east}
|
||||
|
||||
super + {h,j,k,l}
|
||||
bspc node -f {west,south,north,east}
|
||||
|
||||
# focus the code for the given path jump
|
||||
#super + {p,b,comma,period}
|
||||
# bspc node -f @{parent,brother,first,second}
|
||||
|
||||
# focus the next/previous window in the current desktop
|
||||
super + {_,shift + }c
|
||||
bspc node -f {next,prev}.local.!hidden.window
|
||||
|
||||
# focus the next/previous desktop in the current monitor
|
||||
super + bracket{left,right}
|
||||
bspc desktop -f {prev,next}.local
|
||||
|
||||
# focus the last node/desktop
|
||||
#super + {grave,Tab}
|
||||
# bspc {node,desktop} -f last
|
||||
|
||||
# focus the older or newer node in the focus history
|
||||
super + {o,i}
|
||||
bspc wm -h off; \
|
||||
bspc node {older,newer} -f; \
|
||||
bspc wm -h on
|
||||
|
||||
# focus or send to the given desktop
|
||||
super + {_,shift + }{1-9,0}
|
||||
bspc {desktop -f,node -d} '^{1-9,10}'
|
||||
|
||||
#
|
||||
# preselect
|
||||
#
|
||||
|
||||
# preselect the direction
|
||||
super + ctrl + {h,j,k,l}
|
||||
bspc node -p {west,south,north,east}
|
||||
|
||||
# preselect the ratio
|
||||
super + ctrl + {1-9}
|
||||
bspc node -o 0.{1-9}
|
||||
|
||||
# cancel the preselection for the focused node
|
||||
super + ctrl + space
|
||||
bspc node -p cancel
|
||||
|
||||
# cancel the preselection for the focused desktop
|
||||
super + ctrl + shift + space
|
||||
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
|
||||
|
||||
#
|
||||
# move/resize
|
||||
#
|
||||
|
||||
# expand a window by moving one of its side outward
|
||||
super + alt + {h,j,k,l}
|
||||
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
|
||||
|
||||
# contract a window by moving one of its side inward
|
||||
super + alt + shift + {h,j,k,l}
|
||||
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
|
||||
|
||||
# move a floating window
|
||||
super + {Left,Down,Up,Right}
|
||||
bspc node -v {-20 0,0 20,0 -20,20 0}
|
||||
|
||||
#
|
||||
# Screenshotting
|
||||
#
|
||||
@Print
|
||||
flameshot & flameshot full -p ~/Pictures
|
||||
# exec scrot '%d-%m-%Y_%I-%M-%S%p.png' -e 'mv ~/$f ~/Pictures/'
|
||||
shift + @Print
|
||||
flameshot & flameshot gui -p ~/Pictures
|
||||
# exec scrot -s '%d-%m-%Y_%I-%M-%S%p.png' -e 'mv ~/$f ~/Pictures/'
|
||||
#super + @Print
|
||||
#flameshot gui full -p ~/Pictures
|
||||
# exec scrot -u '%d-%m-%Y_%I-%M-%S%p.png' -e 'mv ~/$f ~/Pictures/'
|
||||
alt + @Print
|
||||
flameshot & flameshot gui -d 10000 -p ~/Pictures
|
||||
# exec scrot -d 10 '%d-%m-%Y_%I-%M-%S%p.png' -e 'mv ~/$f ~/Pictures/'
|
||||
|
||||
#
|
||||
#mpd/ncmpcpp
|
||||
#
|
||||
|
||||
super + shift + n
|
||||
mpc prev
|
||||
|
||||
super + shift + m
|
||||
mpc next
|
||||
|
||||
super + shift + space
|
||||
mpc toggle
|
||||
super + A
|
||||
mpc seek +00:00:05
|
||||
super + D
|
||||
mpc seek -00:00:05
|
||||
@@ -1,28 +0,0 @@
|
||||
Config {
|
||||
position = Static { xpos = 0 , ypos = 0, width = 1805, height = 23 },
|
||||
font = "xft:Fira Mono:style=Regular:antialias=true:pixelsize=16,Font Awesome 5 Brands:pixelsize=16,Font Awesome 5 Free:pixelsize=16:style=Solid,Lohit Devanagari:style=Regular:pixelsize=16,Lohit Gurmukhi:style=Regular:pixelsize=16,Noto Sans CJK JP:style=Regular:pixelsize=16,Noto Sans CJK KR:style=Regular:pixelsize=16,Noto Sans CJK SC:style=Regular:pixelsize=16"
|
||||
additionalFonts = [ "xft:Font Awesome 5 Free:pixelsize=15:style=Solid",
|
||||
"xft:Font Awesome 5 Brands:pixelsize=15"
|
||||
]
|
||||
bgColor = "#1d2021",
|
||||
fgColor = "#d5c4a1",
|
||||
lowerOnStart = False,
|
||||
overrideRedirect = False,
|
||||
allDesktops = True,
|
||||
persistent = True,
|
||||
commands = [
|
||||
Run MultiCpu ["-t","<fn=1>\xf2db</fn> <total>%","-L","20","-H","80","-h","#D3869B","-l","#8EC07C","-n","#EBDBB2"] 10,
|
||||
Run Memory ["-t","<fn=1>\xf538</fn> <usedratio>%","-H","12288","-L","6144","-h","#D3869B","-l","#8EC07C","-n","#EBDBB2"] 20,
|
||||
Run BatteryP ["BAT1","BAT0","BAT2"] ["-t", "<acstatus>", "-L", "10", "-H", "80", "-l", "#D3869B", "-h", "#8EC07C", "-n", "#EBDBB2", "--", "-O", "Charging", "-o", "<left>%", "-a", "notify-send -u critical 'Battery running out!'", "-A", "5", "--lows", "<fn=1>\xf243</fn> ", "--mediums", "<fn=1>\xf242</fn> ", "--highs", "<fn=1>\xf240</fn> "] 300,
|
||||
Run Network "wlp0s20f3" ["-t","<fn=1>\xf1eb</fn> <fc=#fabd2f><rx>/<tx></fc>"] 10,
|
||||
Run Date "<fn=1>\xf073 </fn> %a - %b, %_d ║ %H:%M:%S " "date" 100,
|
||||
Run MPD ["-t", "<statei><title>", "--", "-P", ">> ", "-Z", "|| ", "-S", "Stopped", "-h", "127.0.0.1", "-p", "6600"] 10,
|
||||
-- Run Com "playerctl" ["--player", "playerctld", "metadata", "--format", "{{status}}: {{title}}"] "" 10,
|
||||
Run Com "pamixer" ["--get-volume"] "" 600,
|
||||
Run UnsafeStdinReader
|
||||
],
|
||||
sepChar = "*",
|
||||
alignSep = "--",
|
||||
template = "<action=`dmenu_run` button=1><icon=/home/natto/.xmonad/lib/nixos.xpm/></action> *UnsafeStdinReader* | <fn=1></fn> *mpd* -- *multicpu* | *memory* | *wlp0s20f3* | *battery* | <fn=1></fn> <fc=#83a598>*pamixer*%</fc> | <fc=#ebdbb2>*date*</fc>"
|
||||
}
|
||||
|
||||
122
home/default.nix
Normal file
122
home/default.nix
Normal file
@@ -0,0 +1,122 @@
|
||||
{
|
||||
self,
|
||||
inputs,
|
||||
globalArgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
common = [
|
||||
{ programs.home-manager.enable = true; }
|
||||
./common/zsh
|
||||
./common/direnv
|
||||
./common/laptop.nix
|
||||
inputs.agenix.homeManagerModules.default
|
||||
];
|
||||
|
||||
mkPkgs =
|
||||
system: overlays:
|
||||
import inputs.nixpkgs {
|
||||
inherit system;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
allowBroken = true;
|
||||
allowInsecure = true;
|
||||
};
|
||||
overlays = overlays ++ [ self.overlays.default ];
|
||||
};
|
||||
|
||||
extraSpecialArgs = globalArgs;
|
||||
in
|
||||
{
|
||||
flake.homeConfigurations = {
|
||||
natto-laptop = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit extraSpecialArgs;
|
||||
modules = [
|
||||
./natto
|
||||
./common/fonts
|
||||
{ isLaptop = true; }
|
||||
]
|
||||
++ common;
|
||||
pkgs = mkPkgs "x86_64-linux" [ ];
|
||||
};
|
||||
|
||||
natto = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit extraSpecialArgs;
|
||||
modules = [
|
||||
./natto
|
||||
./common/fonts
|
||||
]
|
||||
++ common;
|
||||
pkgs = mkPkgs "x86_64-linux" [ ];
|
||||
};
|
||||
|
||||
spark = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit extraSpecialArgs;
|
||||
modules = [
|
||||
{
|
||||
home = {
|
||||
homeDirectory = "/home/spark";
|
||||
username = "spark";
|
||||
stateVersion = "23.05";
|
||||
};
|
||||
}
|
||||
]
|
||||
++ common;
|
||||
pkgs = mkPkgs "aarch64-linux" [ ];
|
||||
};
|
||||
|
||||
bat = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit extraSpecialArgs;
|
||||
modules = [
|
||||
{
|
||||
home = {
|
||||
homeDirectory = "/home/bat";
|
||||
username = "bat";
|
||||
stateVersion = "23.05";
|
||||
};
|
||||
}
|
||||
]
|
||||
++ common;
|
||||
pkgs = mkPkgs "x86_64-linux" [ ];
|
||||
};
|
||||
|
||||
spin = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit extraSpecialArgs;
|
||||
modules = [
|
||||
{
|
||||
home = {
|
||||
homeDirectory = "/home/spin";
|
||||
username = "spin";
|
||||
stateVersion = "23.05";
|
||||
};
|
||||
}
|
||||
]
|
||||
++ common;
|
||||
pkgs = mkPkgs "x86_64-linux" [ ];
|
||||
};
|
||||
|
||||
kero = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit extraSpecialArgs;
|
||||
modules = [
|
||||
{
|
||||
home = {
|
||||
homeDirectory = "/home/kero";
|
||||
username = "kero";
|
||||
stateVersion = "24.05";
|
||||
};
|
||||
}
|
||||
]
|
||||
++ common;
|
||||
pkgs = mkPkgs "aarch64-linux" [ ];
|
||||
};
|
||||
|
||||
amneesh = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit extraSpecialArgs;
|
||||
modules = [
|
||||
./amneesh
|
||||
]
|
||||
++ common;
|
||||
pkgs = mkPkgs "x86_64-linux" [ (import ./overlays/standalone.nix) ];
|
||||
};
|
||||
};
|
||||
}
|
||||
125
home/natto.nix
125
home/natto.nix
@@ -1,125 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
home = config.home.homeDirectory;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./stuff/programs.nix ./stuff/xsession.nix
|
||||
./stuff/secret.nix
|
||||
./stuff/services.nix
|
||||
];
|
||||
nixpkgs = {
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
age = {
|
||||
sshKeyPaths = [ "${home}/.ssh/id_ed25519" ];
|
||||
secrets = {
|
||||
/* fish_variables = {
|
||||
file = ./secrets/fish_variables.age;
|
||||
path = "${home}/.config/fish/fish_variables";
|
||||
mode = "660";
|
||||
};
|
||||
*/
|
||||
mpdasrc = {
|
||||
file = ./secrets/mpdasrc.age;
|
||||
path = "${home}/.config/mpdasrc";
|
||||
};
|
||||
zshrc = {
|
||||
file = ./secrets/.zshrc.age;
|
||||
path = "${home}/.zshrc";
|
||||
mode = "660";
|
||||
};
|
||||
};
|
||||
};
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
ffmpeg-full
|
||||
sox
|
||||
rage
|
||||
curl
|
||||
pamixer
|
||||
mpdas
|
||||
pavucontrol
|
||||
unstable.anup
|
||||
xfce.thunar
|
||||
xfce.xfconf
|
||||
xfce.tumbler
|
||||
master.discord
|
||||
mpd_discord_richpresence
|
||||
sox
|
||||
qbittorrent
|
||||
#tor-browser-bundle-bin
|
||||
mpc_cli
|
||||
hexchat
|
||||
luajit
|
||||
mpv
|
||||
jmtpfs
|
||||
dunst
|
||||
flameshot
|
||||
youtube-dl
|
||||
xclip
|
||||
xorg.xkbcomp
|
||||
xorg.xmodmap
|
||||
p7zip
|
||||
unrar
|
||||
glxinfo
|
||||
sxiv
|
||||
vim
|
||||
feh
|
||||
dmenu
|
||||
st
|
||||
neofetch
|
||||
xmobar
|
||||
xdotool
|
||||
arc-theme
|
||||
arc-icon-theme
|
||||
tor-browser-bundle-bin
|
||||
wineWowPackages.stable
|
||||
master.winetricks
|
||||
games.winestreamproxy
|
||||
/* (games.osu-stable.overrideAttrs (_:{
|
||||
tricks = [ "gdiplus" "dotnet46" "meiryo" ];
|
||||
}))*/
|
||||
csvtool
|
||||
pmidi
|
||||
dosbox
|
||||
authy
|
||||
unstable.premid
|
||||
(master.tauon.override { withDiscordRPC = true; })
|
||||
nbfc-linux
|
||||
pulseaudio
|
||||
(texlive.combine { inherit (texlive) scheme-small babel lm graphics-def url; })
|
||||
(qjackctl.override { jackSession = true; })
|
||||
carla
|
||||
electrum
|
||||
anki-bin
|
||||
spotify
|
||||
deluge
|
||||
teams
|
||||
libreoffice
|
||||
google-drive-ocamlfuse
|
||||
customscripts
|
||||
stable.ardour
|
||||
stable.calf
|
||||
stable.blender
|
||||
];
|
||||
|
||||
file = {
|
||||
dwm-autostart = {
|
||||
source = ./config/dwm/autostart.sh;
|
||||
target = "${home}/.dwm/autostart.sh";
|
||||
};
|
||||
dwm-status = {
|
||||
source = ./config/dwm/bruhstatus.sh;
|
||||
target = "${home}/.dwm/bruhstatus.sh";
|
||||
};
|
||||
dunstrc = {
|
||||
source = ./config/dunst/dunstrc;
|
||||
target = "${home}/.config/dunst/dunstrc";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
11
home/natto/ags/README.md
Normal file
11
home/natto/ags/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# My AGS configuration
|
||||
Currently has a bar, a media box, an unstyled calendar and a settings(?) menu.
|
||||
|
||||
## Notes
|
||||
- Works only on 1.8.2 (current)
|
||||
- audio: requires pipewire-pulse
|
||||
- mpris: requires gvfs for art
|
||||
- hyprland: requires hyprland (🤯)
|
||||
- battery: requires upower
|
||||
- system-tray: requires libdbusmenu-gtk3
|
||||
- systemd: for power commands
|
||||
31
home/natto/ags/config.js
Normal file
31
home/natto/ags/config.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import Bar from "./windows/bar/index.js";
|
||||
import Settings from "./windows/settings/index.js";
|
||||
import MusicBox from "./windows/music-box/index.js";
|
||||
import Calendar from "./windows/calendar.js";
|
||||
|
||||
const configDir = App.configDir;
|
||||
|
||||
const scssStyle = `${configDir}/style.scss`;
|
||||
const cssStyle = `${configDir}/style.css`;
|
||||
|
||||
const compileSass = () => {
|
||||
Utils.exec(`scss ${scssStyle} ${cssStyle}`);
|
||||
console.log("sass compiled to css");
|
||||
};
|
||||
|
||||
compileSass();
|
||||
|
||||
Utils.monitorFile(`${configDir}/styles`, () => {
|
||||
console.log("change detected in style");
|
||||
compileSass();
|
||||
App.resetCss();
|
||||
App.applyCss(cssStyle);
|
||||
console.log("new style applied");
|
||||
});
|
||||
|
||||
App.config({
|
||||
style: "./style.css",
|
||||
windows: [Bar(), MusicBox(), Settings(), Calendar()],
|
||||
});
|
||||
|
||||
export {};
|
||||
6
home/natto/ags/constants.js
Normal file
6
home/natto/ags/constants.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export const WindowNames = {
|
||||
BAR: "bar",
|
||||
SETTINGS: "settings",
|
||||
MUSIC_BOX: "music-box",
|
||||
CALENDAR: "calendar",
|
||||
};
|
||||
66
home/natto/ags/default.nix
Normal file
66
home/natto/ags/default.nix
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.ags;
|
||||
|
||||
deps =
|
||||
with pkgs;
|
||||
[
|
||||
sass
|
||||
gawk
|
||||
bash
|
||||
procps
|
||||
coreutils
|
||||
imagemagick
|
||||
systemd
|
||||
config.wayland.windowManager.hyprland.package
|
||||
]
|
||||
++ lib.optional config.isLaptop brightnessctl;
|
||||
|
||||
configDir = lib.cleanSourceWith {
|
||||
src = ./.;
|
||||
filter =
|
||||
name: _:
|
||||
let
|
||||
baseName = baseNameOf (toString name);
|
||||
in
|
||||
!(lib.hasSuffix ".nix" baseName);
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.ags.homeManagerModules.default
|
||||
];
|
||||
|
||||
programs.ags = {
|
||||
enable = true;
|
||||
# package = pkgs.ags_1;
|
||||
};
|
||||
|
||||
xdg.configFile."ags" = {
|
||||
source = configDir;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
systemd.user.services.ags = {
|
||||
Unit = {
|
||||
Description = "Aylur's Gtk Shell";
|
||||
PartOf = [
|
||||
"tray.target"
|
||||
"graphical-session.target"
|
||||
];
|
||||
};
|
||||
Service = {
|
||||
Environment = "PATH=${lib.makeBinPath deps}";
|
||||
ExecStart = "${cfg.package}/bin/ags";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 10;
|
||||
};
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
}
|
||||
5
home/natto/ags/style.scss
Normal file
5
home/natto/ags/style.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
@import "styles/global.scss";
|
||||
@import "styles/bar.scss";
|
||||
@import "styles/music-box.scss";
|
||||
@import "styles/settings.scss";
|
||||
@import "styles/calendar.scss";
|
||||
40
home/natto/ags/styles/bar.scss
Normal file
40
home/natto/ags/styles/bar.scss
Normal file
@@ -0,0 +1,40 @@
|
||||
.bar {
|
||||
background: $background;
|
||||
|
||||
.hyprland {
|
||||
background: none;
|
||||
|
||||
button.focused {
|
||||
transition-duration: 0;
|
||||
color: $mauve;
|
||||
box-shadow: 0 0 0 9999px rgba($mauve, 0.08) inset;
|
||||
}
|
||||
|
||||
button.unfocused {
|
||||
background: none;
|
||||
color: $flamingo;
|
||||
}
|
||||
}
|
||||
|
||||
.music {
|
||||
.music-title {
|
||||
color: $sapphire;
|
||||
}
|
||||
|
||||
.music-controls button {
|
||||
color: $yellow;
|
||||
}
|
||||
}
|
||||
|
||||
.network .network-icon {
|
||||
color: $lavender;
|
||||
}
|
||||
|
||||
.date-wrapper {
|
||||
color: $text;
|
||||
}
|
||||
|
||||
.tray-button {
|
||||
color: $flamingo;
|
||||
}
|
||||
}
|
||||
8
home/natto/ags/styles/calendar.scss
Normal file
8
home/natto/ags/styles/calendar.scss
Normal file
@@ -0,0 +1,8 @@
|
||||
.calendar {
|
||||
.calendar-unwrapped {
|
||||
margin-top: 10px;
|
||||
border: 2px solid $mauve;
|
||||
border-radius: 4px;
|
||||
background: rgba($base, 0.9);
|
||||
}
|
||||
}
|
||||
57
home/natto/ags/styles/global.scss
Normal file
57
home/natto/ags/styles/global.scss
Normal file
@@ -0,0 +1,57 @@
|
||||
$rosewater: #f5e0dc;
|
||||
$flamingo: #f2cdcd;
|
||||
$pink: #f5c2e7;
|
||||
$mauve: #cba6f7;
|
||||
$red: #f38ba8;
|
||||
$maroon: #eba0ac;
|
||||
$peach: #fab387;
|
||||
$yellow: #f9e2af;
|
||||
$green: #a6e3a1;
|
||||
$teal: #94e2d5;
|
||||
$sky: #89dceb;
|
||||
$sapphire: #74c7ec;
|
||||
$blue: #89b4fa;
|
||||
$lavender: #b4befe;
|
||||
$text: #cdd6f4;
|
||||
$subtext1: #bac2de;
|
||||
$subtext0: #a6adc8;
|
||||
$overlay2: #9399b2;
|
||||
$overlay1: #7f849c;
|
||||
$overlay0: #6c7086;
|
||||
$surface2: #585b70;
|
||||
$surface1: #45475a;
|
||||
$surface0: #313244;
|
||||
$base: #1e1e2e;
|
||||
$mantle: #181825;
|
||||
$crust: #11111b;
|
||||
|
||||
$background: $base;
|
||||
$foreground: $text;
|
||||
|
||||
* {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
button {
|
||||
background: none;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.bar,
|
||||
.music-box,
|
||||
.calendar,
|
||||
.settings {
|
||||
font-size: 16px;
|
||||
font-family: "Fira Mono";
|
||||
}
|
||||
|
||||
.bar {
|
||||
.hyprland {
|
||||
font-size: 18px;
|
||||
font-family: "Lohit Gurmukhi";
|
||||
}
|
||||
}
|
||||
79
home/natto/ags/styles/music-box.scss
Normal file
79
home/natto/ags/styles/music-box.scss
Normal file
@@ -0,0 +1,79 @@
|
||||
.music-box {
|
||||
.music-box-unwrapped {
|
||||
margin-top: 15px;
|
||||
.music-player {
|
||||
background: $base;
|
||||
border: 2px solid $mauve;
|
||||
border-radius: 13px;
|
||||
.cover-art {
|
||||
margin: 2em;
|
||||
border-radius: 13px;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
}
|
||||
.music-details {
|
||||
$shadow: 0px 0px 10px rgba(black, 0.8);
|
||||
padding: 2em;
|
||||
.title {
|
||||
font-size: 30px;
|
||||
color: $pink;
|
||||
text-shadow: $shadow;
|
||||
}
|
||||
.icon-wrapper {
|
||||
.icon {
|
||||
font-size: 24px;
|
||||
color: $yellow;
|
||||
}
|
||||
.artist {
|
||||
color: $yellow;
|
||||
text-shadow: $shadow;
|
||||
}
|
||||
}
|
||||
|
||||
.length-label,
|
||||
.position-label {
|
||||
text-shadow: $shadow;
|
||||
}
|
||||
.music-controls {
|
||||
border-radius: 20px 8px 20px 8px;
|
||||
padding: 5px;
|
||||
margin: 0px 10px;
|
||||
background: rgba($base, 0.5);
|
||||
button {
|
||||
font-size: 30px;
|
||||
&:hover {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scale trough {
|
||||
min-height: 10px;
|
||||
margin: 0 15px;
|
||||
|
||||
highlight {
|
||||
background-image: linear-gradient(to right, $sapphire, $blue);
|
||||
}
|
||||
|
||||
slider {
|
||||
border-radius: 4px;
|
||||
background: $background;
|
||||
margin: -10px -10px;
|
||||
transition: 0.1s;
|
||||
|
||||
&:hover {
|
||||
border: 2px $mauve solid;
|
||||
box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
&:active {
|
||||
box-shadow:
|
||||
0 0 0 1px inset,
|
||||
0 0 0 8px rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
116
home/natto/ags/styles/settings.scss
Normal file
116
home/natto/ags/styles/settings.scss
Normal file
@@ -0,0 +1,116 @@
|
||||
.settings {
|
||||
.settings-unwrapped {
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
border: 2px solid $mauve;
|
||||
border-radius: 4px;
|
||||
background: $base;
|
||||
|
||||
.metrics {
|
||||
& > * {
|
||||
background-color: rgba(255, 255, 255, 0.03);
|
||||
border-radius: 4px;
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
.metric-progress {
|
||||
min-width: 40px;
|
||||
min-height: 40px;
|
||||
font-size: 4px;
|
||||
margin: 4px;
|
||||
.metric-icon {
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.cpu-metric {
|
||||
color: $mauve;
|
||||
}
|
||||
.memory-metric {
|
||||
color: $flamingo;
|
||||
}
|
||||
.disk-metric {
|
||||
color: $pink;
|
||||
}
|
||||
.battery-metric {
|
||||
color: $yellow;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-col {
|
||||
.sliders {
|
||||
$icon-size: 15px;
|
||||
$scale-height: 20px;
|
||||
|
||||
margin: 10px;
|
||||
scale trough {
|
||||
min-height: $scale-height;
|
||||
min-width: 160px;
|
||||
border-radius: 3px;
|
||||
|
||||
highlight {
|
||||
all: unset;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
slider {
|
||||
$slider-height: $scale-height + 5px;
|
||||
|
||||
min-width: $slider-height;
|
||||
min-height: $slider-height;
|
||||
border-radius: $slider-height;
|
||||
background: $text;
|
||||
box-shadow: 0 2px 0 0 rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.volume {
|
||||
.volume-icon {
|
||||
font-size: $icon-size;
|
||||
color: $green;
|
||||
}
|
||||
|
||||
scale trough highlight {
|
||||
background-color: $green;
|
||||
}
|
||||
}
|
||||
|
||||
.brightness {
|
||||
.brightness-icon {
|
||||
font-size: $icon-size;
|
||||
color: $yellow;
|
||||
}
|
||||
|
||||
scale trough highlight {
|
||||
background-color: $yellow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.settings-col-temps {
|
||||
.temperature {
|
||||
color: $blue;
|
||||
}
|
||||
.temperature-hot {
|
||||
color: $red;
|
||||
}
|
||||
.weather {
|
||||
color: $rosewater;
|
||||
}
|
||||
& > * {
|
||||
margin: 0px 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.power-menu {
|
||||
margin: 20px;
|
||||
button {
|
||||
&:hover {
|
||||
color: $red;
|
||||
box-shadow: none;
|
||||
}
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
home/natto/ags/tsconfig.json
Normal file
18
home/natto/ags/tsconfig.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"lib": [
|
||||
"ES2022"
|
||||
],
|
||||
"allowJs": true,
|
||||
"checkJs": false,
|
||||
"strict": true,
|
||||
"noImplicitAny": false,
|
||||
"baseUrl": ".",
|
||||
"typeRoots": [
|
||||
"./types"
|
||||
],
|
||||
"skipLibCheck": true
|
||||
}
|
||||
}
|
||||
42
home/natto/ags/utils/music.js
Normal file
42
home/natto/ags/utils/music.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import GLib from "gi://GLib";
|
||||
|
||||
export const lengthStr = (length) => {
|
||||
if (length < 0) return "0:00";
|
||||
|
||||
const min = Math.floor(length / 60);
|
||||
const sec = Math.floor(length % 60);
|
||||
const sec0 = sec < 10 ? "0" : "";
|
||||
return `${min}:${sec0}${sec}`;
|
||||
};
|
||||
|
||||
export const blurBg = (cover) => {
|
||||
if (!cover) return "";
|
||||
|
||||
const cachePath = Utils.CACHE_DIR + "/media";
|
||||
const blurPath = cachePath + "/blur";
|
||||
const bgPath = blurPath + cover.substring(cachePath.length);
|
||||
|
||||
if (!GLib.file_test(bgPath, GLib.FileTest.EXISTS)) {
|
||||
Utils.ensureDirectory(blurPath);
|
||||
Utils.exec(
|
||||
`convert ${cover} -scale 10% -blur 0x2 -resize 1000% ${bgPath}`,
|
||||
);
|
||||
}
|
||||
|
||||
return `
|
||||
background-image: url('${bgPath}');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
`;
|
||||
};
|
||||
|
||||
export const findPlayer = (players) => {
|
||||
const active = players.find((p) => p.playBackStatus === "Playing");
|
||||
|
||||
if (active) return active;
|
||||
|
||||
for (const p of players) if (p) return p;
|
||||
|
||||
return undefined;
|
||||
};
|
||||
41
home/natto/ags/utils/popup.js
Normal file
41
home/natto/ags/utils/popup.js
Normal file
@@ -0,0 +1,41 @@
|
||||
export const Padding = (name, { hexpand = true, vexpand = true } = {}) =>
|
||||
Widget.EventBox({
|
||||
hexpand,
|
||||
vexpand,
|
||||
can_focus: false,
|
||||
setup: (w) => w.on("button-press-event", () => App.closeWindow(name)),
|
||||
});
|
||||
|
||||
export const Revealer = ({
|
||||
name,
|
||||
child,
|
||||
transition = "slide_down",
|
||||
transitionDuration = 200,
|
||||
}) =>
|
||||
Widget.Box({
|
||||
css: "padding: 1px;",
|
||||
child: Widget.Revealer({
|
||||
transition,
|
||||
transitionDuration,
|
||||
child: Widget.Box({
|
||||
child,
|
||||
}),
|
||||
setup: (self) =>
|
||||
self.hook(App, (_, window, visible) => {
|
||||
if (window === name) self.reveal_child = visible;
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
export default ({ name, layout, ...props }) =>
|
||||
Widget.Window({
|
||||
name,
|
||||
setup: (w) => w.keybind("Escape", () => App.closeWindow(name)),
|
||||
visible: false,
|
||||
keymode: "on-demand",
|
||||
exclusivity: "normal",
|
||||
layer: "top",
|
||||
anchor: ["top", "bottom", "right", "left"],
|
||||
child: layout,
|
||||
...props,
|
||||
});
|
||||
5
home/natto/ags/utils/text.js
Normal file
5
home/natto/ags/utils/text.js
Normal file
@@ -0,0 +1,5 @@
|
||||
export const shrinkText = (str, n) => {
|
||||
let newStr = str.substring(0, n);
|
||||
if (str.length > n) newStr = newStr + "...";
|
||||
return newStr;
|
||||
};
|
||||
19
home/natto/ags/windows/bar/bluetooth.js
Normal file
19
home/natto/ags/windows/bar/bluetooth.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const bluetooth = await Service.import("bluetooth");
|
||||
|
||||
export default () =>
|
||||
Widget.Icon({
|
||||
setup: (self) =>
|
||||
self.hook(
|
||||
bluetooth,
|
||||
(self) => {
|
||||
self.tooltipText = bluetooth.connected_devices
|
||||
.map(({ name }) => name)
|
||||
.join("\n");
|
||||
self.visible = bluetooth.connected_devices.length > 0;
|
||||
},
|
||||
"notify::connected-devices",
|
||||
),
|
||||
icon: bluetooth
|
||||
.bind("enabled")
|
||||
.as((on) => `bluetooth-${on ? "active" : "disabled"}-symbolic`),
|
||||
});
|
||||
38
home/natto/ags/windows/bar/hyprland.js
Normal file
38
home/natto/ags/windows/bar/hyprland.js
Normal file
@@ -0,0 +1,38 @@
|
||||
const hyprland = await Service.import("hyprland");
|
||||
|
||||
const gurmukhiNums = {
|
||||
1: "੧",
|
||||
2: "੨",
|
||||
3: "੩",
|
||||
4: "੪",
|
||||
5: "੫",
|
||||
6: "੬",
|
||||
7: "੭",
|
||||
8: "੮",
|
||||
9: "੯",
|
||||
10: "੦",
|
||||
};
|
||||
|
||||
export default () => {
|
||||
const activeId = hyprland.active.workspace.bind("id");
|
||||
const workspaces = hyprland.bind("workspaces").as((ws) =>
|
||||
ws
|
||||
.sort((a, b) => a.id - b.id)
|
||||
.map(({ id }) =>
|
||||
Widget.Button({
|
||||
onClicked: () => hyprland.messageAsync(`dispatch workspace ${id}`),
|
||||
child: Widget.Label(gurmukhiNums[id]),
|
||||
className: activeId.as(
|
||||
(i) => `${i === id ? "focused" : "unfocused"}`,
|
||||
),
|
||||
cursor: "pointer",
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
return Widget.Box({
|
||||
css: "padding: 1px;",
|
||||
className: "hyprland",
|
||||
children: workspaces,
|
||||
});
|
||||
};
|
||||
56
home/natto/ags/windows/bar/index.js
Normal file
56
home/natto/ags/windows/bar/index.js
Normal file
@@ -0,0 +1,56 @@
|
||||
import Hyprland from "./hyprland.js";
|
||||
import Music from "./music.js";
|
||||
import Tray from "./tray.js";
|
||||
import Time from "./time.js";
|
||||
import Network from "./network.js";
|
||||
import Bluetooth from "./bluetooth.js";
|
||||
import Settings from "./settings.js";
|
||||
|
||||
import { WindowNames } from "../../constants.js";
|
||||
|
||||
const { BAR } = WindowNames;
|
||||
|
||||
const Left = () => {
|
||||
return Widget.Box({
|
||||
className: "bar-left",
|
||||
spacing: 8,
|
||||
children: [Hyprland()],
|
||||
});
|
||||
};
|
||||
|
||||
const Center = (monitor) => {
|
||||
return Widget.Box({
|
||||
className: "bar-center",
|
||||
spacing: 8,
|
||||
children: [Music(monitor)],
|
||||
});
|
||||
};
|
||||
|
||||
const Right = (monitor) => {
|
||||
return Widget.Box({
|
||||
className: "bar-right",
|
||||
hpack: "end",
|
||||
spacing: 10,
|
||||
children: [
|
||||
Tray(),
|
||||
Bluetooth(),
|
||||
Network(),
|
||||
Time(monitor),
|
||||
Settings(monitor),
|
||||
],
|
||||
});
|
||||
};
|
||||
|
||||
export default (monitor = 0) =>
|
||||
Widget.Window({
|
||||
name: `${BAR}-${monitor}`,
|
||||
className: BAR,
|
||||
monitor,
|
||||
anchor: ["top", "left", "right"],
|
||||
exclusivity: "exclusive",
|
||||
child: Widget.CenterBox({
|
||||
startWidget: Left(),
|
||||
centerWidget: Center(monitor),
|
||||
endWidget: Right(monitor),
|
||||
}),
|
||||
});
|
||||
65
home/natto/ags/windows/bar/music.js
Normal file
65
home/natto/ags/windows/bar/music.js
Normal file
@@ -0,0 +1,65 @@
|
||||
import Controls from "../music-box/music-controls.js";
|
||||
import { shrinkText } from "../../utils/text.js";
|
||||
import { findPlayer } from "../../utils/music.js";
|
||||
import { WindowNames } from "../../constants.js";
|
||||
|
||||
const mpris = await Service.import("mpris");
|
||||
const players = mpris.bind("players");
|
||||
|
||||
/** @param {import('types/service/mpris').MprisPlayer} player */
|
||||
const Player = (player, monitor) => {
|
||||
const revealer = Widget.Revealer({
|
||||
revealChild: false,
|
||||
transitionDuration: 300,
|
||||
transition: "slide_left",
|
||||
child: Controls(player),
|
||||
});
|
||||
|
||||
return Widget.EventBox({
|
||||
visible: player.bus_name === findPlayer(mpris.players).bus_name,
|
||||
cursor: "pointer",
|
||||
setup: (self) => {
|
||||
self.on("leave-notify-event", () => {
|
||||
revealer.reveal_child = false;
|
||||
});
|
||||
self.on("enter-notify-event", () => {
|
||||
revealer.reveal_child = true;
|
||||
});
|
||||
},
|
||||
child: Widget.Box({
|
||||
className: "music",
|
||||
children: [
|
||||
Widget.Button({
|
||||
onClicked: () =>
|
||||
App.toggleWindow(`${WindowNames.MUSIC_BOX}-${monitor}`),
|
||||
className: "music-title",
|
||||
child: Widget.Label().hook(player, (self) => {
|
||||
self.tooltip_text = player.track_title;
|
||||
self.label = shrinkText(self.tooltip_text, 50);
|
||||
}),
|
||||
}),
|
||||
revealer,
|
||||
],
|
||||
}),
|
||||
})
|
||||
.hook(
|
||||
mpris,
|
||||
(self, bus_name) => {
|
||||
self.visible = player.bus_name === bus_name;
|
||||
},
|
||||
"player-changed",
|
||||
)
|
||||
.hook(
|
||||
mpris,
|
||||
(self) => {
|
||||
self.visible = player === findPlayer(mpris.players);
|
||||
},
|
||||
"player-closed",
|
||||
);
|
||||
};
|
||||
|
||||
export default (monitor) =>
|
||||
Widget.Box({
|
||||
visible: players.as((p) => p.length > 0),
|
||||
children: players.as((ps) => ps.map((p) => Player(p, monitor))),
|
||||
});
|
||||
40
home/natto/ags/windows/bar/network.js
Normal file
40
home/natto/ags/windows/bar/network.js
Normal file
@@ -0,0 +1,40 @@
|
||||
const network = await Service.import("network");
|
||||
|
||||
const WifiIndicator = () =>
|
||||
Widget.Box({
|
||||
tooltipText: network.wifi.bind("state").as((s) => `State: ${s}`),
|
||||
children: [
|
||||
Widget.Icon({
|
||||
className: "network-icon",
|
||||
icon: network.wifi.bind("icon_name"),
|
||||
}),
|
||||
Widget.Label({
|
||||
visible: network.wifi.bind("ssid"),
|
||||
label: network.wifi.bind("ssid"),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
const WiredIndicator = () =>
|
||||
Widget.Icon({
|
||||
className: "network-icon",
|
||||
tooltipText: network.wired.bind("internet").as((a) => `Internet: ${a}`),
|
||||
icon: network.wired.bind("icon_name"),
|
||||
});
|
||||
|
||||
export default () =>
|
||||
Widget.Stack({
|
||||
className: "network",
|
||||
children: {
|
||||
wifi: WifiIndicator(),
|
||||
wired: WiredIndicator(),
|
||||
},
|
||||
shown: Utils.merge(
|
||||
[network.bind("primary"), network.wired.bind("state")],
|
||||
(primary, wired) => {
|
||||
if (primary) return primary;
|
||||
if (wired == "activated") return "wired";
|
||||
return "wifi";
|
||||
},
|
||||
),
|
||||
});
|
||||
8
home/natto/ags/windows/bar/settings.js
Normal file
8
home/natto/ags/windows/bar/settings.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import { WindowNames } from "../../constants.js";
|
||||
|
||||
export default (monitor) =>
|
||||
Widget.Button({
|
||||
child: Widget.Icon("open-menu-symbolic"),
|
||||
onPrimaryClick: () =>
|
||||
App.toggleWindow(`${WindowNames.SETTINGS}-${monitor}`),
|
||||
});
|
||||
42
home/natto/ags/windows/bar/time.js
Normal file
42
home/natto/ags/windows/bar/time.js
Normal file
@@ -0,0 +1,42 @@
|
||||
const time = Variable("", {
|
||||
poll: [1000, 'date "+%H:%M:%S"'],
|
||||
});
|
||||
|
||||
const getDate = () => " " + Utils.exec('date "+%a, %b %e"');
|
||||
const date = Variable(getDate());
|
||||
|
||||
export default () => {
|
||||
const revealer = Widget.Revealer({
|
||||
revealChild: false,
|
||||
transitionDuration: 300,
|
||||
transition: "slide_left",
|
||||
child: Widget.Label({
|
||||
label: date.bind(),
|
||||
}),
|
||||
});
|
||||
|
||||
return Widget.EventBox({
|
||||
cursor: "pointer",
|
||||
setup: (self) => {
|
||||
self.on("leave-notify-event", () => {
|
||||
revealer.reveal_child = false;
|
||||
});
|
||||
self.on("enter-notify-event", () => {
|
||||
date.value = getDate();
|
||||
revealer.reveal_child = true;
|
||||
});
|
||||
},
|
||||
child: Widget.Button({
|
||||
className: "date-wrapper",
|
||||
onPrimaryClick: () => App.toggleWindow("calendar-0"),
|
||||
child: Widget.Box({
|
||||
children: [
|
||||
Widget.Label({
|
||||
label: time.bind(),
|
||||
}),
|
||||
revealer,
|
||||
],
|
||||
}),
|
||||
}),
|
||||
});
|
||||
};
|
||||
17
home/natto/ags/windows/bar/tray.js
Normal file
17
home/natto/ags/windows/bar/tray.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const systemtray = await Service.import("systemtray");
|
||||
|
||||
const SysTrayItem = (item) =>
|
||||
Widget.Button({
|
||||
className: "system-tray-item",
|
||||
child: Widget.Icon().bind("icon", item, "icon"),
|
||||
tooltipMarkup: item.bind("tooltip_markup"),
|
||||
onPrimaryClick: (_, event) => item.activate(event),
|
||||
onSecondaryClick: (_, event) => item.openMenu(event),
|
||||
cursor: "pointer",
|
||||
});
|
||||
|
||||
export default () =>
|
||||
Widget.Box({
|
||||
className: "system-tray-unwrapped",
|
||||
children: systemtray.bind("items").as((i) => i.map(SysTrayItem)),
|
||||
});
|
||||
37
home/natto/ags/windows/calendar.js
Normal file
37
home/natto/ags/windows/calendar.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import Popup, { Padding, Revealer } from "../utils/popup.js";
|
||||
import { WindowNames } from "../constants.js";
|
||||
|
||||
const Tray = Widget.Calendar({
|
||||
className: "calendar-unwrapped",
|
||||
showDayNames: true,
|
||||
showHeading: true,
|
||||
});
|
||||
|
||||
export default (monitor = 0) => {
|
||||
const { CALENDAR } = WindowNames;
|
||||
const name = `${CALENDAR}-${monitor}`;
|
||||
|
||||
return Popup({
|
||||
name,
|
||||
className: CALENDAR,
|
||||
monitor,
|
||||
layout: Widget.Box({
|
||||
children: [
|
||||
Padding(name),
|
||||
Widget.Box({
|
||||
hexpand: false,
|
||||
vertical: true,
|
||||
children: [
|
||||
Revealer({
|
||||
name,
|
||||
child: Tray,
|
||||
transition: "slide_down",
|
||||
transitionDuration: 400,
|
||||
}),
|
||||
Padding(name),
|
||||
],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
});
|
||||
};
|
||||
183
home/natto/ags/windows/music-box/index.js
Normal file
183
home/natto/ags/windows/music-box/index.js
Normal file
@@ -0,0 +1,183 @@
|
||||
// Mostly taken from https://github.com/Aylur/ags/blob/11150225e62462bcd431d1e55185e810190a730a/example/media-widget/Media.js
|
||||
|
||||
import Popup, { Padding, Revealer } from "../../utils/popup.js";
|
||||
import { shrinkText } from "../../utils/text.js";
|
||||
import { lengthStr, blurBg } from "../../utils/music.js";
|
||||
import { findPlayer } from "../../utils/music.js";
|
||||
import { WindowNames } from "../../constants.js";
|
||||
import Controls from "./music-controls.js";
|
||||
|
||||
const FALLBACK_ICON = "audio-x-generic-symbolic";
|
||||
const { MUSIC_BOX } = WindowNames;
|
||||
|
||||
const mpris = await Service.import("mpris");
|
||||
|
||||
const Player = (player) => {
|
||||
const img = Widget.Box({
|
||||
visible: player.bind("cover_path"),
|
||||
className: "cover-art",
|
||||
vpack: "start",
|
||||
css: player
|
||||
.bind("cover_path")
|
||||
.as(
|
||||
(p) =>
|
||||
(p ? "min-width: 200px; min-height: 200px;" : "") +
|
||||
`background-image: url('${p}');`,
|
||||
),
|
||||
});
|
||||
|
||||
const title = Widget.Label({
|
||||
className: "title",
|
||||
wrap: true,
|
||||
hpack: "start",
|
||||
label: player.bind("track_title").as((t) => shrinkText(t, 40)),
|
||||
});
|
||||
|
||||
const artist = Widget.Label({
|
||||
className: "artist",
|
||||
wrap: true,
|
||||
hpack: "start",
|
||||
label: player.bind("track_artists").as((a) => shrinkText(a.join(", "), 80)),
|
||||
});
|
||||
|
||||
const positionSlider = Widget.Slider({
|
||||
className: "position",
|
||||
drawValue: false,
|
||||
onChange: ({ value }) => (player.position = value * player.length),
|
||||
visible: player.bind("length").as((l) => l > 0),
|
||||
setup: (self) => {
|
||||
const update = () => {
|
||||
if (self.dragging) return;
|
||||
|
||||
const value = player.position / player.length;
|
||||
self.value = value > 0 ? value : 0;
|
||||
};
|
||||
|
||||
self
|
||||
.hook(player, update)
|
||||
.hook(player, update, "position")
|
||||
.poll(1000, update);
|
||||
},
|
||||
});
|
||||
|
||||
const positionLabel = Widget.Label({
|
||||
ypad: 0,
|
||||
hpack: "start",
|
||||
className: "position-label",
|
||||
setup: (self) => {
|
||||
const update = (_, time) => {
|
||||
self.label = lengthStr(time || player.position);
|
||||
self.visible = player.length > 0;
|
||||
};
|
||||
|
||||
self.hook(player, update, "position");
|
||||
self.poll(1000, update);
|
||||
},
|
||||
});
|
||||
|
||||
const lengthLabel = Widget.Label({
|
||||
ypad: 0,
|
||||
hpack: "end",
|
||||
className: "length-label",
|
||||
visible: player.bind("length").as((l) => l > 0),
|
||||
label: player.bind("length").as(lengthStr),
|
||||
});
|
||||
|
||||
const icon = Widget.Icon({
|
||||
className: "icon",
|
||||
hexpand: true,
|
||||
hpack: "end",
|
||||
vpack: "start",
|
||||
tooltipText: player.identity || "",
|
||||
icon: player.bind("entry").as((entry) => {
|
||||
const name = `${entry}-symbolic`;
|
||||
return Utils.lookUpIcon(name) ? name : FALLBACK_ICON;
|
||||
}),
|
||||
});
|
||||
|
||||
return Widget.Box(
|
||||
{
|
||||
className: "music-player",
|
||||
visible: player.bus_name === findPlayer(mpris.players).bus_name,
|
||||
css: player.bind("cover_path").as(blurBg),
|
||||
},
|
||||
img,
|
||||
Widget.CenterBox({
|
||||
className: "music-details",
|
||||
vertical: true,
|
||||
hexpand: true,
|
||||
spacing: 25,
|
||||
startWidget: Widget.Box(
|
||||
{
|
||||
vertical: true,
|
||||
spacing: 6,
|
||||
},
|
||||
title,
|
||||
Widget.Box({
|
||||
className: "icon-wrapper",
|
||||
spacing: 10,
|
||||
children: [artist, icon],
|
||||
}),
|
||||
),
|
||||
centerWidget: positionSlider,
|
||||
endWidget: Widget.CenterBox({
|
||||
spacing: 6,
|
||||
startWidget: positionLabel,
|
||||
centerWidget: Controls(player),
|
||||
endWidget: lengthLabel,
|
||||
}),
|
||||
}),
|
||||
)
|
||||
.hook(
|
||||
mpris,
|
||||
(self, bus_name) => {
|
||||
self.visible = player.bus_name === bus_name;
|
||||
},
|
||||
"player-changed",
|
||||
)
|
||||
.hook(
|
||||
mpris,
|
||||
(self) => {
|
||||
self.visible = player.bus_name === findPlayer(mpris.players).bus_name;
|
||||
},
|
||||
"player-closed",
|
||||
);
|
||||
};
|
||||
|
||||
const PlayerBox = () =>
|
||||
Widget.Box({
|
||||
className: `${MUSIC_BOX}-unwrapped`,
|
||||
vertical: true,
|
||||
css: "padding: 1px;",
|
||||
children: mpris.bind("players").as((ps) => ps.map(Player)),
|
||||
});
|
||||
|
||||
export default (monitor = 0) => {
|
||||
const name = `${MUSIC_BOX}-${monitor}`;
|
||||
|
||||
return Popup({
|
||||
name,
|
||||
className: MUSIC_BOX,
|
||||
monitor,
|
||||
layout: Widget.Box({
|
||||
children: [
|
||||
Padding(name), // left
|
||||
Widget.Box({
|
||||
hexpand: false,
|
||||
vexpand: false,
|
||||
vertical: true,
|
||||
children: [
|
||||
Revealer({
|
||||
name,
|
||||
child: PlayerBox(),
|
||||
transition: "slide_down",
|
||||
transitionDuration: 400,
|
||||
}),
|
||||
Padding(name), // down
|
||||
],
|
||||
}),
|
||||
Padding(name), // right
|
||||
],
|
||||
}),
|
||||
});
|
||||
};
|
||||
47
home/natto/ags/windows/music-box/music-controls.js
Normal file
47
home/natto/ags/windows/music-box/music-controls.js
Normal file
@@ -0,0 +1,47 @@
|
||||
const PLAY_ICON = "media-playback-start-symbolic";
|
||||
const PAUSE_ICON = "media-playback-pause-symbolic";
|
||||
const PREV_ICON = "go-previous-symbolic";
|
||||
const NEXT_ICON = "go-next-symbolic";
|
||||
|
||||
export default (player) => {
|
||||
const playPause = Widget.Button({
|
||||
class_name: "play-pause",
|
||||
on_clicked: () => player.playPause(),
|
||||
visible: player.bind("can_play"),
|
||||
cursor: "pointer",
|
||||
child: Widget.Icon({
|
||||
icon: player.bind("play_back_status").transform((s) => {
|
||||
switch (s) {
|
||||
case "Playing":
|
||||
return PAUSE_ICON;
|
||||
case "Paused":
|
||||
case "Stopped":
|
||||
return PLAY_ICON;
|
||||
}
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
const prev = Widget.Button({
|
||||
yalign: 0.5,
|
||||
onClicked: () => player.previous(),
|
||||
visible: player.bind("can_go_prev"),
|
||||
child: Widget.Icon(PREV_ICON),
|
||||
cursor: "pointer",
|
||||
});
|
||||
|
||||
const next = Widget.Button({
|
||||
onClicked: () => player.next(),
|
||||
visible: player.bind("can_go_next"),
|
||||
child: Widget.Icon(NEXT_ICON),
|
||||
cursor: "pointer",
|
||||
});
|
||||
|
||||
return Widget.CenterBox({
|
||||
vertical: true,
|
||||
centerWidget: Widget.Box({
|
||||
className: "music-controls",
|
||||
children: [prev, playPause, next],
|
||||
}),
|
||||
});
|
||||
};
|
||||
69
home/natto/ags/windows/settings/audio.js
Normal file
69
home/natto/ags/windows/settings/audio.js
Normal file
@@ -0,0 +1,69 @@
|
||||
const audio = await Service.import("audio");
|
||||
|
||||
export default () => {
|
||||
const isSpeaker = Variable(true);
|
||||
|
||||
/** @param {'speaker' | 'microphone'} type */
|
||||
const VolumeSlider = (type = "speaker") =>
|
||||
Widget.Slider({
|
||||
hexpand: true,
|
||||
drawValue: false,
|
||||
onChange: ({ value }) => (audio[type].volume = value),
|
||||
value: audio[type].bind("volume"),
|
||||
});
|
||||
|
||||
const speakerSlider = VolumeSlider("speaker");
|
||||
const micSlider = VolumeSlider("microphone");
|
||||
|
||||
const speakerIndicator = Widget.Button({
|
||||
on_clicked: () => (audio.speaker.is_muted = !audio.speaker.is_muted),
|
||||
child: Widget.Icon().hook(audio.speaker, (self) => {
|
||||
self.className = "volume-icon";
|
||||
const vol = audio.speaker.volume * 100;
|
||||
let icon = [
|
||||
[101, "overamplified"],
|
||||
[67, "high"],
|
||||
[34, "medium"],
|
||||
[1, "low"],
|
||||
[0, "muted"],
|
||||
].find(([threshold]) => threshold <= vol)?.[1];
|
||||
|
||||
if (audio.speaker.is_muted) icon = "muted";
|
||||
|
||||
self.icon = `audio-volume-${icon}-symbolic`;
|
||||
self.tooltip_text = `Volume ${Math.floor(vol)}%`;
|
||||
}),
|
||||
});
|
||||
|
||||
const micIndicator = Widget.Button({
|
||||
on_clicked: () => (audio.microphone.is_muted = !audio.microphone.is_muted),
|
||||
child: Widget.Icon().hook(audio.microphone, (self) => {
|
||||
self.className = "volume-icon";
|
||||
const vol = audio.microphone.volume * 100;
|
||||
let icon = [
|
||||
[67, "high"],
|
||||
[34, "medium"],
|
||||
[1, "low"],
|
||||
[0, "muted"],
|
||||
].find(([threshold]) => threshold <= vol)?.[1];
|
||||
|
||||
if (audio.microphone.is_muted) icon = "muted";
|
||||
|
||||
self.icon = `microphone-sensitivity-${icon}-symbolic`;
|
||||
self.tooltip_text = `Volume ${Math.floor(vol)}%`;
|
||||
}),
|
||||
});
|
||||
|
||||
return Widget.EventBox({
|
||||
cursor: "pointer",
|
||||
className: "volume",
|
||||
onSecondaryClick: () => (isSpeaker.value = !isSpeaker.value),
|
||||
child: Widget.Stack({
|
||||
children: {
|
||||
speaker: Widget.Box({}, speakerSlider, speakerIndicator),
|
||||
microphone: Widget.Box({}, micSlider, micIndicator),
|
||||
},
|
||||
shown: isSpeaker.bind().as((s) => (s ? "speaker" : "microphone")),
|
||||
}),
|
||||
});
|
||||
};
|
||||
48
home/natto/ags/windows/settings/backlight.js
Normal file
48
home/natto/ags/windows/settings/backlight.js
Normal file
@@ -0,0 +1,48 @@
|
||||
const hasBacklight = Variable(Utils.exec("ls /sys/class/backlight"));
|
||||
|
||||
export default () => {
|
||||
const getBrightness = () => {
|
||||
try {
|
||||
return (
|
||||
Number(Utils.exec("brightnessctl get")) /
|
||||
Number(Utils.exec("brightnessctl max"))
|
||||
);
|
||||
} catch {
|
||||
console.log("settings/backlight: failed to get brightness");
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
const setBrightness = (b) => {
|
||||
if (b < 0.05) b = 0.05;
|
||||
else if (b > 1) b = 1;
|
||||
|
||||
Utils.exec(`brightnessctl set ${b * 100}%`);
|
||||
};
|
||||
const brightness = Variable(getBrightness());
|
||||
|
||||
const Slider = Widget.Slider({
|
||||
hexpand: true,
|
||||
drawValue: false,
|
||||
onChange: ({ value }) => setBrightness(value),
|
||||
value: brightness.bind(),
|
||||
});
|
||||
|
||||
const Indicator = Widget.Button({
|
||||
on_clicked: brightness.bind().as((b) => () => {
|
||||
if (b <= 0.5) brightness.value = 1;
|
||||
else brightness.value = 0.5;
|
||||
}),
|
||||
child: Widget.Icon().hook(brightness, (self) => {
|
||||
self.className = "brightness-icon";
|
||||
self.icon = `display-brightness-symbolic`;
|
||||
self.tooltip_text = `Brightness: ${Math.floor(brightness.value * 100)}%`;
|
||||
}),
|
||||
});
|
||||
|
||||
return Widget.Box({
|
||||
className: "brightness",
|
||||
visible: hasBacklight.bind().as((b) => !!b),
|
||||
children: [Slider, Indicator],
|
||||
});
|
||||
};
|
||||
72
home/natto/ags/windows/settings/index.js
Normal file
72
home/natto/ags/windows/settings/index.js
Normal file
@@ -0,0 +1,72 @@
|
||||
import Popup, { Padding, Revealer } from "../../utils/popup.js";
|
||||
import { WindowNames } from "../../constants.js";
|
||||
import Audio from "./audio.js";
|
||||
import Backlight from "./backlight.js";
|
||||
import {
|
||||
cpuMetric,
|
||||
memoryMetric,
|
||||
diskMetric,
|
||||
batteryMetric,
|
||||
} from "./metrics.js";
|
||||
import Temperature from "./temperature.js";
|
||||
import Weather from "./weather.js";
|
||||
import PowerMenu from "./power-menu.js";
|
||||
|
||||
const metrics = Widget.Box({
|
||||
className: "metrics",
|
||||
vertical: true,
|
||||
children: [cpuMetric, memoryMetric, diskMetric, batteryMetric],
|
||||
});
|
||||
|
||||
const sliders = Widget.Box({
|
||||
className: "sliders",
|
||||
vertical: true,
|
||||
children: [Audio(), Backlight()],
|
||||
});
|
||||
|
||||
const settingsCol = Widget.CenterBox({
|
||||
className: "settings-col",
|
||||
vertical: true,
|
||||
spacing: 8,
|
||||
startWidget: sliders,
|
||||
centerWidget: Widget.CenterBox({
|
||||
className: "settings-col-temps",
|
||||
startWidget: Temperature(),
|
||||
endWidget: Weather(),
|
||||
}),
|
||||
endWidget: PowerMenu(),
|
||||
});
|
||||
|
||||
const settings = Widget.Box({
|
||||
className: "settings-unwrapped",
|
||||
children: [metrics, settingsCol],
|
||||
});
|
||||
|
||||
export default (monitor = 0) => {
|
||||
const { SETTINGS } = WindowNames;
|
||||
const name = `${SETTINGS}-${monitor}`;
|
||||
|
||||
return Popup({
|
||||
name,
|
||||
className: SETTINGS,
|
||||
monitor,
|
||||
layout: Widget.Box({
|
||||
children: [
|
||||
Padding(name),
|
||||
Widget.Box({
|
||||
hexpand: false,
|
||||
vertical: true,
|
||||
children: [
|
||||
Revealer({
|
||||
name,
|
||||
child: settings,
|
||||
transition: "slide_down",
|
||||
transitionDuration: 400,
|
||||
}),
|
||||
Padding(name),
|
||||
],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
});
|
||||
};
|
||||
104
home/natto/ags/windows/settings/metrics.js
Normal file
104
home/natto/ags/windows/settings/metrics.js
Normal file
@@ -0,0 +1,104 @@
|
||||
const battery = await Service.import("battery");
|
||||
|
||||
const divide = ([total, free]) => free / total;
|
||||
|
||||
const cpuValue = Variable(0, {
|
||||
poll: [
|
||||
2000,
|
||||
"top -b -n 1",
|
||||
(out) =>
|
||||
divide([
|
||||
100,
|
||||
out
|
||||
.split("\n")
|
||||
.find((line) => line.includes("Cpu(s)"))
|
||||
.split(/\s+/)[1]
|
||||
.replace(",", "."),
|
||||
]),
|
||||
],
|
||||
});
|
||||
|
||||
const memoryValue = Variable([0, 0], {
|
||||
poll: [
|
||||
2000,
|
||||
"free",
|
||||
(out) => {
|
||||
const data = out
|
||||
.split("\n")
|
||||
.find((line) => line.includes("Mem:"))
|
||||
.split(/\s+/)
|
||||
.splice(1, 2);
|
||||
return [(data[1] / (1024 * 1024)).toFixed(2), divide(data)];
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const diskValue = Variable(["0G", "0%"], {
|
||||
poll: [
|
||||
120000,
|
||||
"df -kh /",
|
||||
(out) => out.split("\n")[1].split(/\s+/).splice(3, 2),
|
||||
],
|
||||
});
|
||||
|
||||
const mkMetric = ({
|
||||
className,
|
||||
tooltipText,
|
||||
value,
|
||||
label,
|
||||
icon,
|
||||
visible = true,
|
||||
}) =>
|
||||
Widget.Box(
|
||||
{
|
||||
spacing: 10,
|
||||
className,
|
||||
tooltipText,
|
||||
visible,
|
||||
},
|
||||
Widget.CircularProgress({
|
||||
className: "metric-progress",
|
||||
child: Widget.Icon({
|
||||
icon,
|
||||
className: "metric-icon",
|
||||
}),
|
||||
value,
|
||||
}),
|
||||
Widget.Label({
|
||||
wrap: true,
|
||||
label,
|
||||
}),
|
||||
);
|
||||
|
||||
export const cpuMetric = mkMetric({
|
||||
className: "cpu-metric",
|
||||
tooltipText: cpuValue.bind().as((c) => `CPU: ${(c * 100).toFixed(2)}%`),
|
||||
value: cpuValue.bind(),
|
||||
label: cpuValue.bind().as((c) => `${(c * 100).toFixed(2)}%`),
|
||||
icon: "cpu-symbolic",
|
||||
});
|
||||
|
||||
export const memoryMetric = mkMetric({
|
||||
className: "memory-metric",
|
||||
tooltipText: memoryValue.bind().as((m) => `RAM :${m[0]}G`),
|
||||
value: memoryValue.bind().as((m) => m[1]),
|
||||
label: memoryValue.bind().as((m) => `${m[0]}G`),
|
||||
icon: "memory-symbolic",
|
||||
});
|
||||
|
||||
export const diskMetric = mkMetric({
|
||||
className: "disk-metric",
|
||||
tooltipText: diskValue.bind().as((d) => `Free Space :${d[0]}`),
|
||||
value: diskValue.bind().as((d) => Number(d[1]) / 100),
|
||||
label: diskValue.bind().as((d) => d[1]),
|
||||
icon: "drive-harddisk-symbolic",
|
||||
});
|
||||
|
||||
export const batteryMetric = mkMetric({
|
||||
className: "battery-metric",
|
||||
tooltipText: battery.bind("percent").as((p) => `Battery: ${p}%`),
|
||||
value: battery.bind("percent").as((p) => (p > 0 ? p / 100 : 0)),
|
||||
label: battery.bind("percent").as((p) => `${p}%`),
|
||||
icon: battery.bind("icon_name"),
|
||||
visible: battery.bind("available"),
|
||||
});
|
||||
94
home/natto/ags/windows/settings/power-menu.js
Normal file
94
home/natto/ags/windows/settings/power-menu.js
Normal file
@@ -0,0 +1,94 @@
|
||||
export default () => {
|
||||
const isLocked = Variable(true);
|
||||
const power = Variable("poweroff");
|
||||
const suspend = Variable("sleep");
|
||||
|
||||
const cursor = "pointer";
|
||||
|
||||
const unlockButton = Widget.Button({
|
||||
onPrimaryClick: () => {
|
||||
isLocked.value = false;
|
||||
},
|
||||
tooltipText: "Unock power menu",
|
||||
child: Widget.Icon("system-lock-screen-symbolic"),
|
||||
cursor,
|
||||
});
|
||||
|
||||
const lockButton = Widget.Button({
|
||||
onPrimaryClick: () => {
|
||||
isLocked.value = true;
|
||||
},
|
||||
tooltipText: "Lock power menu",
|
||||
child: Widget.Icon("system-lock-screen-symbolic"),
|
||||
cursor,
|
||||
});
|
||||
|
||||
const poweroffButton = Widget.Button({
|
||||
onPrimaryClick: () => {
|
||||
Utils.exec("poweroff");
|
||||
},
|
||||
onSecondaryClick: () => (power.value = "reboot"),
|
||||
tooltipText: "Shutdown",
|
||||
child: Widget.Icon("system-shutdown-symbolic"),
|
||||
cursor,
|
||||
});
|
||||
|
||||
const rebootButton = Widget.Button({
|
||||
onPrimaryClick: () => {
|
||||
Utils.exec("reboot");
|
||||
},
|
||||
onSecondaryClick: () => (power.value = "poweroff"),
|
||||
tooltipText: "Reboot",
|
||||
child: Widget.Icon("system-reboot-symbolic"),
|
||||
cursor,
|
||||
});
|
||||
|
||||
const sleepButton = Widget.Button({
|
||||
onPrimaryClick: () => {
|
||||
Utils.exec("systemctl suspend");
|
||||
},
|
||||
onSecondaryClick: () => (suspend.value = "hibernate"),
|
||||
tooltipText: "Sleep",
|
||||
child: Widget.Icon("weather-clear-night-symbolic"),
|
||||
cursor,
|
||||
});
|
||||
|
||||
const hibernateButton = Widget.Button({
|
||||
onPrimaryClick: () => {
|
||||
Utils.exec("systemctl hibernate");
|
||||
},
|
||||
onSecondaryClick: () => (suspend.value = "sleep"),
|
||||
tooltipText: "Hibernate",
|
||||
child: Widget.Icon("computer-symbolic"),
|
||||
cursor,
|
||||
});
|
||||
|
||||
const powerStack = Widget.Stack({
|
||||
children: {
|
||||
poweroff: poweroffButton,
|
||||
reboot: rebootButton,
|
||||
},
|
||||
shown: power.bind(),
|
||||
});
|
||||
|
||||
const suspendStack = Widget.Stack({
|
||||
children: {
|
||||
sleep: sleepButton,
|
||||
hibernate: hibernateButton,
|
||||
},
|
||||
shown: suspend.bind(),
|
||||
});
|
||||
|
||||
return Widget.Stack({
|
||||
className: "power-menu",
|
||||
children: {
|
||||
locked: Widget.CenterBox({ centerWidget: unlockButton }),
|
||||
unlocked: Widget.CenterBox({
|
||||
startWidget: powerStack,
|
||||
centerWidget: lockButton,
|
||||
endWidget: suspendStack,
|
||||
}),
|
||||
},
|
||||
shown: isLocked.bind().as((l) => (l ? "locked" : "unlocked")),
|
||||
});
|
||||
};
|
||||
62
home/natto/ags/windows/settings/temperature.js
Normal file
62
home/natto/ags/windows/settings/temperature.js
Normal file
@@ -0,0 +1,62 @@
|
||||
export default () => {
|
||||
const getThermalZone = () => {
|
||||
try {
|
||||
return Utils.exec([
|
||||
"bash",
|
||||
"-c",
|
||||
`awk '{print FILENAME ":" $0}' /sys/class/thermal/thermal_zone*/type`,
|
||||
])
|
||||
.split("\n")
|
||||
.find((line) => line.includes("x86_pkg_temp"))
|
||||
.split(":")[0]
|
||||
.slice(0, -4);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
console.log("settings/temperature: cannot get thermal zone");
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const thermalZone = Variable(getThermalZone());
|
||||
|
||||
const tempValue = thermalZone.value
|
||||
? Variable(0, {
|
||||
poll: [
|
||||
5000,
|
||||
() => {
|
||||
try {
|
||||
return (
|
||||
Utils.readFile(`${thermalZone.value}/temp`) / 1000
|
||||
).toFixed(2);
|
||||
} catch {
|
||||
console.log(
|
||||
"settings/temperature: specified thermal zone does not exist",
|
||||
);
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
],
|
||||
})
|
||||
: Variable(undefined);
|
||||
|
||||
return Widget.CenterBox({
|
||||
vertical: true,
|
||||
visible: thermalZone.bind().as((t) => !!t),
|
||||
centerWidget: Widget.Box(
|
||||
{
|
||||
vertical: true,
|
||||
spacing: 8,
|
||||
tooltipText: tempValue.bind().as((t) => `CPU Temperature: ${t}°C`),
|
||||
className: tempValue
|
||||
.bind()
|
||||
.as((t) => `temperature${t > 65 ? "-hot" : ""}`),
|
||||
},
|
||||
Widget.Icon({
|
||||
icon: "sensors-temperature-symbolic",
|
||||
}),
|
||||
Widget.Label({
|
||||
label: tempValue.bind().as((t) => `${t}°C`),
|
||||
}),
|
||||
),
|
||||
});
|
||||
};
|
||||
78
home/natto/ags/windows/settings/weather.js
Normal file
78
home/natto/ags/windows/settings/weather.js
Normal file
@@ -0,0 +1,78 @@
|
||||
const conditionIcons = {
|
||||
Clear: "clear",
|
||||
Sunny: "clear",
|
||||
"Partly Cloudy": "few-clouds",
|
||||
Cloudy: "overcast",
|
||||
Overcast: "overcast",
|
||||
"Light Rain": "showers-scattered",
|
||||
Drizzle: "showers-scattered",
|
||||
Rain: "showers",
|
||||
"Heavy Rain": "showers",
|
||||
Showers: "showers",
|
||||
Thunderstorm: "storm",
|
||||
Snow: "snow",
|
||||
"Light Snow": "snow",
|
||||
"Heavy Snow": "snow",
|
||||
Mist: "fog",
|
||||
Fog: "fog",
|
||||
Haze: "fog",
|
||||
Dust: "fog",
|
||||
Smoke: "fog",
|
||||
Sand: "fog",
|
||||
Wind: "windy",
|
||||
Tornado: "tornado",
|
||||
undefined: "clear",
|
||||
};
|
||||
|
||||
const fetchWeather = async () => {
|
||||
return await Utils.fetch("http://wttr.in/?format=j1")
|
||||
.then((res) => res.json())
|
||||
.then((j) => j["current_condition"][0])
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
console.log("settings/weather: error fetching weather data");
|
||||
});
|
||||
};
|
||||
|
||||
export default () => {
|
||||
const data = Variable(undefined, {
|
||||
poll: [600000, async () => await fetchWeather()],
|
||||
});
|
||||
|
||||
return Widget.Box(
|
||||
{
|
||||
vertical: true,
|
||||
visible: data.bind().as((d) => !!d),
|
||||
className: "weather",
|
||||
},
|
||||
Widget.Icon({
|
||||
icon: data.bind().as((d) => {
|
||||
const condition = d?.["weatherDesc"]?.[0]?.["value"]?.split(/[\s,]+/)?.[0];
|
||||
return `weather-${conditionIcons[condition]}-symbolic`;
|
||||
}),
|
||||
}),
|
||||
Widget.Label({
|
||||
label: data.bind().as((d) => {
|
||||
const conditions = d?.["weatherDesc"]?.map((w) => w["value"]) || [];
|
||||
|
||||
return conditions.join(" ");
|
||||
}),
|
||||
}),
|
||||
Widget.Label({
|
||||
label: data.bind().as((d) => {
|
||||
const temperature = d?.["temp_C"];
|
||||
const feelsLike = d?.["FeelsLikeC"];
|
||||
|
||||
return `${temperature}°C (${feelsLike}°C)`;
|
||||
}),
|
||||
}),
|
||||
Widget.Label({
|
||||
label: data.bind().as((d) => {
|
||||
const humidity = d?.["humidity"];
|
||||
const precipitation = d?.["precipMM"];
|
||||
|
||||
return `${humidity}%, ${precipitation}mm`;
|
||||
}),
|
||||
}),
|
||||
);
|
||||
};
|
||||
18
home/natto/browser.nix
Normal file
18
home/natto/browser.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs = {
|
||||
firefox = {
|
||||
enable = true;
|
||||
profiles.natto = {
|
||||
name = "natto";
|
||||
};
|
||||
};
|
||||
chromium = {
|
||||
enable = true;
|
||||
package = pkgs.ungoogled-chromium;
|
||||
};
|
||||
};
|
||||
home.sessionVariables = {
|
||||
BROWSER = "firefox";
|
||||
};
|
||||
}
|
||||
1
home/natto/config/README
Normal file
1
home/natto/config/README
Normal file
@@ -0,0 +1 @@
|
||||
Some of these are copied as-it-is. The rest are managed via home-manager and are just here for legacy purposes.
|
||||
27
home/natto/config/dunst/dunstrc
Normal file
27
home/natto/config/dunst/dunstrc
Normal file
File diff suppressed because one or more lines are too long
0
home/config/dwm/autostart.sh → home/natto/config/dwm/autostart.sh
Executable file → Normal file
0
home/config/dwm/autostart.sh → home/natto/config/dwm/autostart.sh
Executable file → Normal file
0
home/config/dwm/bruhstatus.sh → home/natto/config/dwm/bruhstatus.sh
Executable file → Normal file
0
home/config/dwm/bruhstatus.sh → home/natto/config/dwm/bruhstatus.sh
Executable file → Normal file
1
home/natto/config/emacs/README.org
Symbolic link
1
home/natto/config/emacs/README.org
Symbolic link
@@ -0,0 +1 @@
|
||||
config.org
|
||||
622
home/natto/config/emacs/config.org
Normal file
622
home/natto/config/emacs/config.org
Normal file
@@ -0,0 +1,622 @@
|
||||
#+TITLE: My Emacs Configuration
|
||||
#+AUTHOR: natto1784
|
||||
#+PROPERTY: header-args :emacs-lisp :tangle yes
|
||||
|
||||
* Settings
|
||||
** Setting the default face
|
||||
#+begin_src emacs-lisp
|
||||
; -*- lexical-binding: t; -*-
|
||||
(set-frame-font "Fira Code 13" nil t)
|
||||
(add-to-list 'default-frame-alist '(font . "Fira Code-13"))
|
||||
#+end_src
|
||||
|
||||
** Some mode settings based on personal preferences
|
||||
#+begin_src emacs-lisp
|
||||
(add-hook 'prog-mode-hook #'hl-line-mode)
|
||||
(add-hook 'text-mode-hook #'hl-line-mode)
|
||||
(scroll-bar-mode 0)
|
||||
(tool-bar-mode 0)
|
||||
(menu-bar-mode 0)
|
||||
(fringe-mode 0)
|
||||
(global-display-line-numbers-mode 1)
|
||||
(xterm-mouse-mode 1)
|
||||
(electric-pair-mode)
|
||||
(setq ring-bell-function 'ignore
|
||||
gc-cons-threshold most-positive-fixnum
|
||||
initial-major-mode 'fundamental-mode)
|
||||
#+end_src
|
||||
|
||||
** Setting some variables
|
||||
#+begin_src emacs-lisp
|
||||
(setq initial-major-mode 'emacs-lisp-mode
|
||||
frame-resize-pixelwise t
|
||||
auto-window-vscroll nil
|
||||
scroll-step 1
|
||||
display-line-numbers-type 'relative
|
||||
confirm-kill-processes nil
|
||||
inhibit-startup-screen t
|
||||
isearch-lazy-count t
|
||||
lazy-count-prefix-format "[%s/%s] ")
|
||||
(setq-default tab-width 2
|
||||
indent-tabs-mode nil)
|
||||
#+end_src
|
||||
|
||||
** Emacs startup hook
|
||||
#+begin_src emacs-lisp
|
||||
(add-hook 'emacs-startup-hook
|
||||
(lambda () (delete-other-windows)) t)
|
||||
#+end_src
|
||||
|
||||
* Packages
|
||||
** Add Melpa to package archives
|
||||
#+begin_src emacs-lisp
|
||||
(require 'package)
|
||||
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
|
||||
(package-initialize)
|
||||
(require 'use-package)
|
||||
#+end_src
|
||||
|
||||
*** Profiling
|
||||
#+begin_src emacs-lisp
|
||||
(use-package benchmark-init
|
||||
:config
|
||||
(add-hook 'after-init-hook 'benchmark-init/deactivate) )
|
||||
#+end_src
|
||||
|
||||
** Visual packages
|
||||
*** Add solaire mode
|
||||
#+begin_src emacs-lisp
|
||||
(use-package solaire-mode
|
||||
:config
|
||||
(solaire-mode))
|
||||
#+end_src
|
||||
|
||||
*** Set theme
|
||||
#+begin_src emacs-lisp
|
||||
(use-package catppuccin-theme
|
||||
:config
|
||||
(load-theme 'catppuccin t)
|
||||
:custom
|
||||
(dark-theme t))
|
||||
#+end_src
|
||||
|
||||
*** Indent guides
|
||||
#+begin_src emacs-lisp
|
||||
(use-package highlight-indent-guides
|
||||
:config
|
||||
(setq highlight-indent-guides-method 'column)
|
||||
:hook
|
||||
(prog-mode . highlight-indent-guides-mode))
|
||||
#+end_src
|
||||
|
||||
** Minibuffer
|
||||
Enable vertico
|
||||
#+begin_src emacs-lisp
|
||||
(use-package vertico
|
||||
:init
|
||||
(vertico-mode)
|
||||
:bind (:map vertico-map
|
||||
("C-j" . vertico-next)
|
||||
("C-k" . vertico-previous)))
|
||||
#+end_src
|
||||
|
||||
Save history over restarts
|
||||
#+begin_src emacs-lisp
|
||||
(use-package savehist
|
||||
:init
|
||||
(savehist-mode))
|
||||
#+end_src
|
||||
|
||||
Marginalia for description
|
||||
#+begin_src emacs-lisp
|
||||
(use-package marginalia
|
||||
:after vertico
|
||||
:config
|
||||
(marginalia-mode 1))
|
||||
#+end_src
|
||||
|
||||
Orderless
|
||||
#+begin_src emacs-lisp
|
||||
(use-package orderless
|
||||
:after vertico
|
||||
:config
|
||||
(setq completion-styles '(orderless basic)))
|
||||
#+end_src
|
||||
|
||||
Consult
|
||||
#+begin_src emacs-lisp
|
||||
(use-package consult
|
||||
:bind (("M-s M-g" . consult-grep)
|
||||
("M-s M-f" . consult-find)
|
||||
("M-s M-b" . consult-buffer)))
|
||||
#+end_src
|
||||
|
||||
** Evil
|
||||
*** Configure evil mode
|
||||
#+begin_src emacs-lisp
|
||||
(defun my/evil-shift-right ()
|
||||
(interactive)
|
||||
(evil-shift-right evil-visual-beginning evil-visual-end)
|
||||
(evil-normal-state)
|
||||
(evil-visual-restore))
|
||||
|
||||
(defun my/evil-shift-left ()
|
||||
(interactive)
|
||||
(evil-shift-left evil-visual-beginning evil-visual-end)
|
||||
(evil-normal-state)
|
||||
(evil-visual-restore))
|
||||
|
||||
(use-package evil
|
||||
:init
|
||||
(setq-default evil-shift-width 2)
|
||||
(setq evil-want-keybinding nil)
|
||||
:config
|
||||
(evil-set-initial-state 'vterm-mode 'insert)
|
||||
(evil-set-undo-system 'undo-tree)
|
||||
(evil-define-key 'visual global-map (kbd ">") 'my/evil-shift-right)
|
||||
(evil-define-key 'visual global-map (kbd "<") 'my/evil-shift-left)
|
||||
(evil-mode 1))
|
||||
#+end_src
|
||||
|
||||
*** Evil related packages
|
||||
#+begin_src emacs-lisp
|
||||
(use-package evil-collection
|
||||
:after evil
|
||||
:ensure t
|
||||
:config
|
||||
(evil-collection-init))
|
||||
|
||||
(use-package evil-terminal-cursor-changer
|
||||
:after evil
|
||||
:if (not (display-graphic-p))
|
||||
:config
|
||||
(evil-terminal-cursor-changer-activate))
|
||||
(use-package evil-anzu :after evil)
|
||||
#+end_src
|
||||
|
||||
*** Configure undo tree
|
||||
To undo and redo easily like vi
|
||||
#+begin_src emacs-lisp
|
||||
(use-package undo-tree
|
||||
:init
|
||||
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))
|
||||
:config
|
||||
(global-undo-tree-mode 1))
|
||||
#+end_src
|
||||
|
||||
** Treemacs
|
||||
*** Configure treemacs
|
||||
#+begin_src emacs-lisp
|
||||
(use-package treemacs
|
||||
:defer t
|
||||
:config
|
||||
(treemacs-project-follow-mode))
|
||||
|
||||
(use-package treemacs-evil :after treemacs)
|
||||
(use-package treemacs-projectile :after treemacs)
|
||||
(use-package treemacs-all-the-icons :after treemacs)
|
||||
#+end_src
|
||||
|
||||
** LSP
|
||||
*** Configure lsp-mode
|
||||
#+begin_src emacs-lisp
|
||||
(use-package lsp-mode
|
||||
:defer t
|
||||
:commands lsp
|
||||
:init (setq lsp-enable-on-type-formatting nil)
|
||||
:hook (prog-mode . lsp-deferred))
|
||||
#+end_src
|
||||
|
||||
*** Configure lsp-ui
|
||||
#+begin_src emacs-lisp
|
||||
(use-package lsp-ui
|
||||
:defer t
|
||||
:init
|
||||
(setq lsp-ui-doc-delay 1.0
|
||||
lsp-ui-doc-show-with-mouse t
|
||||
pgtk-wait-for-event-timeout nil
|
||||
lsp-ui-doc-show-with-cursor t)
|
||||
:config
|
||||
(lsp-ui-peek-enable 1)
|
||||
(lsp-ui-doc-enable 1)
|
||||
:hook (lsp-mode . lsp-ui-mode))
|
||||
#+end_src
|
||||
|
||||
*** Configure flycheck
|
||||
#+begin_src emacs-lisp
|
||||
(use-package flycheck
|
||||
:defer t)
|
||||
#+end_src
|
||||
|
||||
*** Configure dap-mode
|
||||
#+begin_src emacs-lisp
|
||||
(use-package dap-mode
|
||||
:defer t
|
||||
:hook ((lsp-mode . dap-mode)
|
||||
(lsp-mode . dap-ui-mode)))
|
||||
#+end_src
|
||||
|
||||
** Company
|
||||
*** Configure company
|
||||
For autocomplete
|
||||
#+begin_src emacs-lisp
|
||||
(use-package company
|
||||
:after lsp-mode
|
||||
:config
|
||||
(add-to-list 'company-backends 'company-dabbrev)
|
||||
(setq company-backends (append '(company-files) (remove 'company-files company-backends)))
|
||||
:hook (after-init . global-company-mode))
|
||||
#+end_src
|
||||
|
||||
*** Configure company-quickhelp
|
||||
#+begin_src emacs-lisp
|
||||
(use-package company-quickhelp
|
||||
:hook (company-mode . company-quickhelp-mode))
|
||||
#+end_src
|
||||
|
||||
** Treesitter
|
||||
#+begin_src emacs-lisp
|
||||
(use-package tree-sitter-langs :defer t)
|
||||
(use-package tree-sitter
|
||||
:after tree-sitter-langs
|
||||
:defer t
|
||||
:config
|
||||
(global-tree-sitter-mode)
|
||||
:init
|
||||
(add-to-list 'tree-sitter-major-mode-language-alist '(fundamental-mode . bash))
|
||||
(add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode))
|
||||
#+end_src
|
||||
|
||||
** Direnv
|
||||
#+begin_src emacs-lisp
|
||||
(use-package direnv
|
||||
:config
|
||||
(direnv-mode))
|
||||
#+end_src
|
||||
|
||||
** Languages
|
||||
#+begin_src emacs-lisp
|
||||
(use-package dts-mode
|
||||
:mode ("\\.dts\\'" "\\.dtsi\\'" "\\.overlay\\'"))
|
||||
(use-package lsp-haskell
|
||||
:mode "\\.hs\\'")
|
||||
(use-package lsp-latex
|
||||
:mode "\\.tex\\'")
|
||||
(use-package rustic
|
||||
:mode "\\.rs\\'")
|
||||
(use-package typescript-mode
|
||||
:mode ("\\.ts\\'" "\\.tsx\\'"))
|
||||
(use-package wgsl-mode
|
||||
:mode "\\.wgsl\\'")
|
||||
(use-package nix-mode
|
||||
:mode "\\.nix\\'")
|
||||
(use-package hcl-mode
|
||||
:mode
|
||||
"\\.hcl\\'"
|
||||
"\\.nomad\\'")
|
||||
(use-package go-mode
|
||||
:mode "\\.go\\'")
|
||||
#+end_src
|
||||
|
||||
** Git
|
||||
magit for git operations
|
||||
#+begin_src emacs-lisp
|
||||
(use-package magit :defer t)
|
||||
#+end_src
|
||||
|
||||
blamer for git blame
|
||||
#+begin_src emacs-lisp
|
||||
(use-package blamer
|
||||
:defer 20
|
||||
:custom
|
||||
(blamer-idle-time 0.3)
|
||||
(blamer-min-offset 70)
|
||||
:config
|
||||
(global-blamer-mode 1)
|
||||
:init
|
||||
(setq blamer-show-avatar-p nil
|
||||
blamer-max-commit-message-length 72))
|
||||
#+end_src
|
||||
|
||||
** VTerm
|
||||
*** Configure vterm
|
||||
#+begin_src emacs-lisp
|
||||
(use-package vterm
|
||||
:config
|
||||
(evil-define-key 'normal vterm-mode-map (kbd "p") 'vterm-yank)
|
||||
(evil-define-key 'insert vterm-mode-map (kbd "C-y") 'vterm-yank)
|
||||
(setq vterm-timer-delay 0.005))
|
||||
|
||||
(use-package vterm-toggle
|
||||
:after vterm
|
||||
:config
|
||||
(setq vterm-toggle-fullscreen-p nil)
|
||||
(add-to-list 'display-buffer-alist
|
||||
'((lambda (buffer-or-name _)
|
||||
(let ((buffer (get-buffer buffer-or-name)))
|
||||
(with-current-buffer buffer
|
||||
(or (equal major-mode 'vterm-mode)
|
||||
(string-prefix-p vterm-buffer-name (buffer-name buffer))))))
|
||||
(display-buffer-reuse-window display-buffer-in-side-window)
|
||||
(side . bottom)
|
||||
(reusable-frames . visible)
|
||||
(window-height . 0.4))))
|
||||
#+end_src
|
||||
|
||||
** Centaur Tabs
|
||||
Do not use centaur tabs for now
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(use-package centaur-tabs
|
||||
:defer t
|
||||
:custom
|
||||
(centaur-tabs-style "rounded")
|
||||
(centaur-tabs-height 18)
|
||||
(centaur-tabs-set-modified-marker t)
|
||||
(centaur-tabs-set-icons t)
|
||||
:config
|
||||
(centaur-tabs-mode t)
|
||||
(centaur-tabs-group-by-projectile-project)
|
||||
(set-face-attribute 'tab-line nil :inherit 'centaur-tabs-unselected)
|
||||
(centaur-tabs-headline-match)
|
||||
:bind
|
||||
(:map evil-normal-state-map
|
||||
("M-," . centaur-tabs-forward)
|
||||
("M-." . centaur-tabs-backward))
|
||||
(:map evil-motion-state-map
|
||||
("M-," . centaur-tabs-forward)
|
||||
("M-." . centaur-tabs-backward)))
|
||||
#+end_src
|
||||
|
||||
** Misc packages
|
||||
*** Icons
|
||||
For installing icons
|
||||
#+begin_src emacs-lisp
|
||||
(use-package all-the-icons
|
||||
:defer t
|
||||
:if (display-graphic-p))
|
||||
#+end_src
|
||||
|
||||
*** Projectile
|
||||
For tracking project root
|
||||
#+begin_src emacs-lisp
|
||||
(use-package projectile
|
||||
:defer t
|
||||
:config
|
||||
(define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map)
|
||||
(projectile-mode +1))
|
||||
#+end_src
|
||||
|
||||
*** Rainbow
|
||||
For highlighting colors
|
||||
#+begin_src emacs-lisp
|
||||
(use-package rainbow-mode :defer t)
|
||||
#+end_src
|
||||
|
||||
*** Rainbow delimiters
|
||||
To make distinguishing parens easier
|
||||
#+begin_src emacs-lisp
|
||||
(use-package rainbow-delimiters
|
||||
:hook (prog-mode . rainbow-delimiters-mode))
|
||||
#+end_src
|
||||
|
||||
*** Olivetti
|
||||
When you want write prose or something similar
|
||||
#+begin_src emacs-lisp
|
||||
(use-package olivetti
|
||||
:defer t
|
||||
:diminish olivetti-mode
|
||||
:custom
|
||||
(olivetti-body-width 100)
|
||||
(olivetti-minimum-body-width 50)
|
||||
(olivetti-style 'fancy)
|
||||
(olivetti-recall-visual-line-mode-entry-state t)
|
||||
:config
|
||||
(defvar-local my/olivetti--saved-line-numbers nil
|
||||
"Stores the previous value of `display-line-numbers` before enabling Olivetti.")
|
||||
|
||||
(defun my/olivetti-toggle-line-numbers ()
|
||||
"Hide line numbers when entering Olivetti, restore when exiting."
|
||||
(if olivetti-mode
|
||||
(progn
|
||||
(setq my/olivetti--saved-line-numbers display-line-numbers)
|
||||
(setq display-line-numbers nil))
|
||||
(setq display-line-numbers my/olivetti--saved-line-numbers)))
|
||||
|
||||
(add-hook 'olivetti-mode-hook #'my/olivetti-toggle-line-numbers))
|
||||
#+end_src
|
||||
|
||||
|
||||
** Org
|
||||
** Add org-mode
|
||||
#+begin_src emacs-lisp
|
||||
(use-package org
|
||||
:defer t
|
||||
:after evil
|
||||
:config
|
||||
(define-key org-mode-map (kbd "RET") 'org-return-and-maybe-indent)
|
||||
(evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle)
|
||||
:custom
|
||||
(evil-want-C-i-jump nil)
|
||||
(org-adapt-indentation t)
|
||||
(org-src-fontify-natively t)
|
||||
(org-src-strip-leading-and-trailing-blank-lines t)
|
||||
(org-src-preserve-indentation t)
|
||||
(org-src-tab-acts-natively t))
|
||||
#+end_src
|
||||
|
||||
** Add org-bullets
|
||||
#+begin_src emacs-lisp
|
||||
(use-package org-bullets
|
||||
:defer t
|
||||
:hook ((org-mode . org-bullets-mode)))
|
||||
#+end_src
|
||||
|
||||
** Babel and exports
|
||||
#+begin_src emacs-lisp
|
||||
(use-package htmlize :defer t)
|
||||
|
||||
(setq org-latex-listings 'minted
|
||||
org-latex-packages-alist '(("" "minted"))
|
||||
org-latex-pdf-process
|
||||
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
|
||||
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
|
||||
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
|
||||
|
||||
(setq org-src-fontify-natively t)
|
||||
(setq org-confirm-babel-evaluate nil)
|
||||
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((python . t)
|
||||
(C . t)
|
||||
(sql . t)
|
||||
(latex . t)))
|
||||
#+end_src
|
||||
|
||||
* Random eye candy stuff
|
||||
* Mode line
|
||||
** Doom modeline
|
||||
Switched to doom modeline after using my own modeline for a while
|
||||
#+begin_src emacs-lisp
|
||||
(use-package doom-modeline
|
||||
:init (doom-modeline-mode 1))
|
||||
#+end_src
|
||||
Also show columns
|
||||
#+begin_src emacs-lisp
|
||||
(column-number-mode 1)
|
||||
#+end_src
|
||||
|
||||
** Nyan Mode
|
||||
#+begin_src emacs-lisp
|
||||
(use-package nyan-mode
|
||||
:ensure t
|
||||
:init
|
||||
(when (display-graphic-p)
|
||||
(nyan-mode 1))
|
||||
:custom
|
||||
(nyan-animate-nyancat t)
|
||||
:config
|
||||
(nyan-start-animation))
|
||||
#+end_src
|
||||
|
||||
* Pop-up terminal
|
||||
Stolen from [[https://www.reddit.com/r/emacs/comments/ft84xy/run_shell_command_in_new_vterm/][this]] reddit post
|
||||
#+begin_src emacs-lisp
|
||||
(defun run-in-vterm-kill (process event)
|
||||
"A process sentinel. Kills PROCESS's buffer if it is live."
|
||||
(let ((b (process-buffer process)))
|
||||
(and (buffer-live-p b)
|
||||
(kill-buffer b))))
|
||||
|
||||
(defun run-in-vterm (command)
|
||||
(interactive
|
||||
(list
|
||||
(let* ((f (cond (buffer-file-name)
|
||||
((eq major-mode 'dired-mode)
|
||||
(dired-get-filename nil t))))
|
||||
(filename (concat " " (shell-quote-argument (and f (file-relative-name f))))))
|
||||
(read-shell-command "Terminal command: "
|
||||
(cons filename 0)
|
||||
(cons 'shell-command-history 1)
|
||||
(list filename)))))
|
||||
(with-current-buffer (vterm-toggle)
|
||||
(set-process-sentinel vterm--process #'run-in-vterm-kill)
|
||||
(vterm-send-string (concat command))
|
||||
(vterm-send-return)))
|
||||
#+end_src
|
||||
|
||||
* LLMs
|
||||
** gptel
|
||||
#+begin_src emacs-lisp
|
||||
(use-package gptel
|
||||
:defer t
|
||||
:config
|
||||
(setq gptel-model 'claude-sonnet-4-20250514
|
||||
gptel-backend (gptel-make-anthropic "Claude"
|
||||
:stream t
|
||||
:protocol "https"
|
||||
:key (getenv "ANTHROPIC_API_KEY")
|
||||
:host (getenv "ANTHROPIC_API_BASE_DOMAIN")))
|
||||
(setq gptel-default-mode 'org-mode)
|
||||
:bind (("C-c g" . gptel)))
|
||||
|
||||
#+end_src
|
||||
|
||||
** Aidermacs
|
||||
#+begin_src emacs-lisp
|
||||
(use-package aidermacs
|
||||
:defer t
|
||||
:bind (("C-c a" . aidermacs-transient-menu))
|
||||
:custom
|
||||
; See the Configuration section below
|
||||
(aidermacs-default-chat-mode 'architect)
|
||||
(aidermacs-default-model "sonnet"))
|
||||
#+end_src
|
||||
|
||||
|
||||
* Keybinds
|
||||
** General
|
||||
*** Colemak translations
|
||||
not using this anymore
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(use-package evil-colemak-basics
|
||||
:init
|
||||
(setq evil-colemak-basics-layout-mod 'mod-dh)
|
||||
:config
|
||||
(global-evil-colemak-basics-mode))
|
||||
#+end_src
|
||||
|
||||
*** Misc binds
|
||||
#+begin_src emacs-lisp
|
||||
(use-package general
|
||||
:ensure t)
|
||||
|
||||
(setq evil-states
|
||||
'(visual normal motion))
|
||||
|
||||
(with-eval-after-load 'general
|
||||
(general-define-key
|
||||
:states evil-states
|
||||
"M-c" 'comment-line
|
||||
"C-c M-c" 'comment-box)
|
||||
|
||||
(general-define-key
|
||||
:states '(normal insert)
|
||||
"M-C-f" 'lsp-format-buffer
|
||||
"C-S-v" 'yank)
|
||||
|
||||
(general-define-key
|
||||
:keymaps '(global override vterm-mode-map)
|
||||
:states evil-states
|
||||
"M-o" 'treemacs
|
||||
"M-s-v" 'split-window-vertically
|
||||
"M-s-h" 'split-window-horizontally
|
||||
"M-h" 'windmove-left
|
||||
"M-j" 'windmove-down
|
||||
"M-k" 'windmove-up
|
||||
"M-l" 'windmove-right
|
||||
"M-C-h" 'shrink-window-horizontally
|
||||
"M-C-l" 'enlarge-window-horizontally
|
||||
"M-C-j" 'shrink-window
|
||||
"M-C-k" 'enlarge-window
|
||||
"C-q" 'delete-window
|
||||
"M-C-S-q" 'kill-buffer-and-window
|
||||
"M-w" (lambda () (interactive) (kill-buffer (current-buffer)))
|
||||
"M-S-w" 'kill-window)
|
||||
#+end_src
|
||||
|
||||
*** Pop-up terminal specific keybinds
|
||||
#+begin_src emacs-lisp
|
||||
(with-eval-after-load 'vterm-toggle
|
||||
(general-define-key
|
||||
:keymaps '(global override vterm-mode-map)
|
||||
:states evil-states
|
||||
"<f4>" (lambda () (interactive) (vterm t))
|
||||
"C-S-t" 'vterm-toggle-cd
|
||||
"C-t" 'vterm-toggle
|
||||
"<f1>" 'vterm-toggle)
|
||||
(general-define-key
|
||||
:keymaps 'vterm-mode-map
|
||||
"<f3>" 'vterm-toggle-forward
|
||||
"<f2>" 'vterm-toggle-backward)))
|
||||
#+end_src
|
||||
8
home/natto/config/emacs/init.el
Normal file
8
home/natto/config/emacs/init.el
Normal file
@@ -0,0 +1,8 @@
|
||||
(defconst config-org (expand-file-name "config.org" user-emacs-directory))
|
||||
(defconst config-el (expand-file-name "config.el" user-emacs-directory))
|
||||
|
||||
(unless (file-exists-p config-el)
|
||||
(require 'org)
|
||||
(org-babel-tangle-file config-org config-el))
|
||||
|
||||
(load-file config-el)
|
||||
26
home/natto/config/foot/foot.ini
Normal file
26
home/natto/config/foot/foot.ini
Normal file
@@ -0,0 +1,26 @@
|
||||
[colors]
|
||||
background=11111B
|
||||
bright0=585B70
|
||||
bright1=F38BA8
|
||||
bright2=A6E3A1
|
||||
bright3=F9E2AF
|
||||
bright4=89B4FA
|
||||
bright5=F5C2E7
|
||||
bright6=94E2D5
|
||||
bright7=A6ADC8
|
||||
foreground=CDD6F4
|
||||
regular0=45475A
|
||||
regular1=F38BA8
|
||||
regular2=A6E3A1
|
||||
regular3=F9E2AF
|
||||
regular4=89B4FA
|
||||
regular5=F5C2E7
|
||||
regular6=94E2D5
|
||||
regular7=BAC2DE
|
||||
|
||||
[main]
|
||||
font=Fira Mono:style=Regular:pixelsize=12
|
||||
font-bold=Fira Mono:style=Bold:pixelsize=12
|
||||
|
||||
[scrollback]
|
||||
lines=4000
|
||||
10
home/natto/config/mailcap
Normal file
10
home/natto/config/mailcap
Normal file
@@ -0,0 +1,10 @@
|
||||
text/plain; $EDITOR %s ;
|
||||
text/html; $BROWSER %s; test=test -n "$DISPLAY"
|
||||
text/html; w3m %s; nametemplate=%s.html; needsterminal
|
||||
text/html; w3m -v -F -T text/html -dump %s; copiousoutput
|
||||
image/*; sxiv %s ;
|
||||
video/*; setsid mpv --quiet %s &; copiousoutput
|
||||
audio/*; mpv %s ;
|
||||
application/pdf; zathura %s ;
|
||||
application/pgp-encrypted; gpg -d '%s'; copiousoutput;
|
||||
application/pgp-keys; gpg --import '%s'; copiousoutput;
|
||||
36
home/natto/config/mpd/mpd.conf
Normal file
36
home/natto/config/mpd/mpd.conf
Normal file
@@ -0,0 +1,36 @@
|
||||
music_directory "~/Music"
|
||||
playlist_directory "~/.config/mpd/playlists"
|
||||
db_file "~/.config/mpd/database"
|
||||
|
||||
state_file "~/.config/mpd/state"
|
||||
sticker_file "~/.config/mpd/sticker.sql"
|
||||
log_file "~/.config/mpd/log"
|
||||
pid_file "~/.config/mpd/pid"
|
||||
bind_to_address "0.0.0.0"
|
||||
bind_to_address "~/.config/mpd/socket"
|
||||
restore_paused "yes"
|
||||
|
||||
input {
|
||||
plugin "curl"
|
||||
}
|
||||
audio_output {
|
||||
type "pulse"
|
||||
name "pulse audio"
|
||||
}
|
||||
audio_output {
|
||||
type "fifo"
|
||||
name "Visualizer feed"
|
||||
path "/tmp/mpd.fifo"
|
||||
format "44100:16:2"
|
||||
}
|
||||
audio_output {
|
||||
encoder "vorbis"
|
||||
type "httpd"
|
||||
quality "9"
|
||||
name "Vorbis Stream"
|
||||
port "8001"
|
||||
max_clients "0"
|
||||
always_on "yes"
|
||||
}
|
||||
filesystem_charset "UTF-8"
|
||||
|
||||
3
home/natto/config/mpv/mpv.conf
Normal file
3
home/natto/config/mpv/mpv.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
force-window=yes
|
||||
keep-open=yes
|
||||
save-position-on-quit=yes
|
||||
39
home/natto/config/ncmpcpp/config
Normal file
39
home/natto/config/ncmpcpp/config
Normal file
@@ -0,0 +1,39 @@
|
||||
active_window_border=blue
|
||||
autocenter_mode=yes
|
||||
browser_sort_mode=mtime
|
||||
centered_cursor=yes
|
||||
colors_enabled=yes
|
||||
cyclic_scrolling=yes
|
||||
display_bitrate=yes
|
||||
empty_tag_marker=
|
||||
enable_window_title=yes
|
||||
fetch_lyrics_for_current_song_in_background=yes
|
||||
follow_now_playing_lyrics=yes
|
||||
header_visibility=yes
|
||||
header_window_color=green
|
||||
lines_scrolled=2
|
||||
locked_screen_width_part=25
|
||||
lyrics_directory=~/.lyrics
|
||||
main_window_color=white
|
||||
mpd_music_dir=/home/natto/Music
|
||||
now_playing_prefix=>
|
||||
playlist_display_mode=columns
|
||||
playlist_editor_display_mode=classic
|
||||
progressbar_elapsed_color=magenta
|
||||
progressbar_color=green
|
||||
progressbar_look=▃▃▃
|
||||
regular_expressions=extended
|
||||
song_columns_list_format=(4)[red]{l} (40)[cyan]{t} (15)[green]{a} (25)[magenta]{b}
|
||||
song_list_format=$(yellow){%a} - $(blue){%t}
|
||||
song_status_format= $6%a $7⟫⟫ $3%t $7⟫⟫ $4%b
|
||||
statusbar_visibility=yes
|
||||
system_encoding=utf-8
|
||||
titles_visibility=yes
|
||||
user_interface=alternative
|
||||
visualizer_data_source=/tmp/mpd.fifo
|
||||
visualizer_fps=144
|
||||
visualizer_in_stereo=yes
|
||||
visualizer_look=◆▋
|
||||
visualizer_spectrum_smooth_look=yes
|
||||
visualizer_type=spectrum
|
||||
volume_color=yellow
|
||||
37
home/natto/config/neomutt/neomuttrc
Normal file
37
home/natto/config/neomutt/neomuttrc
Normal file
@@ -0,0 +1,37 @@
|
||||
set editor="nvim"
|
||||
#set index_format="%4C %Z %{%b %d %R} %-15.15L (%?l?%4l&%4c?) %s"
|
||||
set sidebar_visible
|
||||
#set sidebar_format="%B%?F? [%F]?%* %?N?%N/?%S"
|
||||
set mail_check_stats
|
||||
bind attach,index,pager \CU next-page
|
||||
bind attach,index,pager \CD previous-page
|
||||
bind attach,index,pager 9 group-reply
|
||||
bind pager g top
|
||||
bind pager G bottom
|
||||
bind pager j next-line
|
||||
bind pager k previous-line
|
||||
bind pager l view-attachments
|
||||
bind attach,index g first-entry
|
||||
bind attach,index G last-entry
|
||||
bind index,pager \CK sidebar-prev
|
||||
bind index,pager \CJ sidebar-next
|
||||
bind index,pager \CI sidebar-open
|
||||
bind index,pager \CB sidebar-toggle-visible
|
||||
set sleep_time = 0
|
||||
set markers = no
|
||||
set mark_old = no
|
||||
set mime_forward = yes
|
||||
set wait_key = no
|
||||
set fast_reply
|
||||
set fcc_attach
|
||||
set forward_format = "Fwd: %s"
|
||||
set forward_quote
|
||||
set reverse_name
|
||||
set include
|
||||
set mail_check=60
|
||||
auto_view text/html
|
||||
alternative_order text/enriched text/plain text/html text
|
||||
macro index,pager U "<shell-escape>mbsync -a<enter>" "run mbsync to sync all emails"
|
||||
macro index A \
|
||||
"<tag-pattern>~N<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" \
|
||||
"mark all new as read"
|
||||
73
home/natto/config/neomutt/theme
Normal file
73
home/natto/config/neomutt/theme
Normal file
@@ -0,0 +1,73 @@
|
||||
|
||||
# A convenient colorscheme(r) I got from somewhere but forgot from where
|
||||
|
||||
color index yellow default '.*'
|
||||
color index_author red default '.*'
|
||||
color index_number blue default
|
||||
color index_subject cyan default '.*'
|
||||
|
||||
# New mail is boldened:
|
||||
color index brightyellow black "~N"
|
||||
color index_author brightred black "~N"
|
||||
color index_subject brightcyan black "~N"
|
||||
|
||||
# Tagged mail is highlighted:
|
||||
color index brightyellow blue "~T"
|
||||
color index_author brightred blue "~T"
|
||||
color index_subject brightcyan blue "~T"
|
||||
|
||||
# Other colors and aesthetic settings:
|
||||
mono bold bold
|
||||
mono underline underline
|
||||
mono indicator reverse
|
||||
mono error bold
|
||||
color normal default default
|
||||
color indicator brightblack white
|
||||
color sidebar_highlight red default
|
||||
color sidebar_divider brightblack black
|
||||
color sidebar_flagged red black
|
||||
color sidebar_new green black
|
||||
color normal brightyellow default
|
||||
color error red default
|
||||
color tilde black default
|
||||
color message cyan default
|
||||
color markers red white
|
||||
color attachment white default
|
||||
color search brightmagenta default
|
||||
color status brightyellow black
|
||||
color hdrdefault brightgreen default
|
||||
color quoted green default
|
||||
color quoted1 blue default
|
||||
color quoted2 cyan default
|
||||
color quoted3 yellow default
|
||||
color quoted4 red default
|
||||
color quoted5 brightred default
|
||||
color signature brightgreen default
|
||||
color bold black default
|
||||
color underline black default
|
||||
color normal default default
|
||||
|
||||
# Regex highlighting:
|
||||
color header blue default ".*"
|
||||
color header brightmagenta default "^(From)"
|
||||
color header brightcyan default "^(Subject)"
|
||||
color header brightwhite default "^(CC|BCC)"
|
||||
color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses
|
||||
color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL
|
||||
color body green default "\`[^\`]*\`" # Green text between ` and `
|
||||
color body brightblue default "^# \.*" # Headings as bold blue
|
||||
color body brightcyan default "^## \.*" # Subheadings as bold cyan
|
||||
color body brightgreen default "^### \.*" # Subsubheadings as bold green
|
||||
color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow
|
||||
color body brightcyan default "[;:][-o][)/(|]" # emoticons
|
||||
color body brightcyan default "[;:][)(|]" # emoticons
|
||||
color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon?
|
||||
color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon?
|
||||
color body red default "(BAD signature)"
|
||||
color body cyan default "(Good signature)"
|
||||
color body brightblack default "^gpg: Good signature .*"
|
||||
color body brightyellow default "^gpg: "
|
||||
color body brightyellow red "^gpg: BAD signature from.*"
|
||||
mono body bold "^gpg: Good signature"
|
||||
mono body bold "^gpg: BAD signature from.*"
|
||||
color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
|
||||
10
home/natto/config/stalonetrayrc
Normal file
10
home/natto/config/stalonetrayrc
Normal file
@@ -0,0 +1,10 @@
|
||||
background "#002b36"
|
||||
geometry "1x1-0"
|
||||
grow_gravity "E"
|
||||
icon_gravity "E"
|
||||
icon_size "23"
|
||||
kludges "force_icons_size"
|
||||
max_geometry "10x0"
|
||||
sticky true
|
||||
window_layer "top"
|
||||
window_type "dock"
|
||||
58
home/natto/config/xmonad/padding-icon.sh
Executable file
58
home/natto/config/xmonad/padding-icon.sh
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Taken from https://github.com/jaor/xmobar/blob/master/examples/padding-icon.sh
|
||||
|
||||
# Detects the width of running window with name given as first
|
||||
# argument (xprop name '$1') and creates an XPM icon of that width,
|
||||
# 1px height, and transparent. Outputs an <icon>-tag for use in
|
||||
# xmobar to display the generated XPM icon.
|
||||
#
|
||||
# Run script from xmobar and trayer:
|
||||
# `Run Com "/where/ever/padding-icon.sh" ["panel"] "trayerpad" 10`
|
||||
# and use `%trayerpad%` in your template.
|
||||
# or, if you're using for instance stalonetray:
|
||||
# `Run Com "/where/ever/padding-icon.sh" ["stalonetray"] "tray" 10`
|
||||
|
||||
# Very heavily based on Jonas Camillus Jeppensen code
|
||||
# https://github.com/jaor/xmobar/issues/239#issuecomment-233206552
|
||||
|
||||
# Function to create a transparent Wx1 px XPM icon
|
||||
create_xpm_icon () {
|
||||
timestamp=$(date)
|
||||
pixels=$(for i in `seq $1`; do echo -n "."; done)
|
||||
|
||||
cat << EOF > "$2"
|
||||
/* XPM *
|
||||
static char * trayer_pad_xpm[] = {
|
||||
/* This XPM icon is used for padding in xmobar to */
|
||||
/* leave room for trayer-srg. It is dynamically */
|
||||
/* updated by by trayer-pad-icon.sh which is run */
|
||||
/* by xmobar. */
|
||||
/* Created: ${timestamp} */
|
||||
/* <w/cols> <h/rows> <colors> <chars per pixel> */
|
||||
"$1 1 1 1",
|
||||
/* Colors (none: transparent) */
|
||||
". c none",
|
||||
/* Pixels */
|
||||
"$pixels"
|
||||
};
|
||||
EOF
|
||||
}
|
||||
|
||||
# panel window name
|
||||
pname=${1:-panel}
|
||||
|
||||
# Width of the trayer window
|
||||
width=$(xprop -name $pname | grep 'program specified minimum size' | cut -d ' ' -f 5)
|
||||
|
||||
# Icon file name
|
||||
iconfile="/tmp/$pname-padding-${width:-0}px.xpm"
|
||||
|
||||
# If the desired icon does not exist create it
|
||||
if [ ! -f $iconfile ]
|
||||
then
|
||||
create_xpm_icon $width $iconfile
|
||||
fi
|
||||
|
||||
# Output the icon tag for xmobar
|
||||
echo "<icon=${iconfile}/>"
|
||||
50
home/natto/config/xmonad/xmobar.hs
Normal file
50
home/natto/config/xmonad/xmobar.hs
Normal file
@@ -0,0 +1,50 @@
|
||||
import Xmobar
|
||||
|
||||
bg, fg, grey, red, green, yellow, blue, magenta, cyan, white, sep :: String
|
||||
sep = "<fc=" ++ cyan ++ ">║</fc>"
|
||||
bg = "#002b36"
|
||||
fg = "#839496"
|
||||
grey = "#073642"
|
||||
red = "#dc322f"
|
||||
green = "#859900"
|
||||
yellow = "#b58900"
|
||||
blue = "#268bd2"
|
||||
magenta = "#d33682"
|
||||
cyan = "#2aa198"
|
||||
white = "#eee8d5"
|
||||
|
||||
config :: Config
|
||||
config =
|
||||
defaultConfig
|
||||
{
|
||||
font = "xft:Fira Mono:style=Regular:antialias=true:pixelsize,Font Awesome 6 Brands:pixelsize=16,Font Awesome 6 Free:pixelsize=16:style=Solid,Lohit Devanagari:style=Regular:pixelsize=16,Lohit Gurmukhi:style=Regular:pixelsize=16,Noto Sans CJK JP:style=Regular:pixelsize=16,Noto Sans CJK KR:style=Regular:pixelsize=16,Noto Sans CJK SC:style=Regular:pixelsize=16",
|
||||
additionalFonts =
|
||||
[ "xft:Font Awesome 6 Free:pixelsize=15:style=Solid",
|
||||
"xft:Font Awesome 6 Brands:pixelsize=15"
|
||||
],
|
||||
position = Static { xpos = 0, ypos = 0, height = 23, width = 1920 },
|
||||
bgColor = bg,
|
||||
fgColor = fg,
|
||||
lowerOnStart = False,
|
||||
overrideRedirect = False,
|
||||
allDesktops = True,
|
||||
persistent = True,
|
||||
commands =
|
||||
[ Run $ MultiCpu ["-t", "<fn=1>\xf2db</fn> <total>%", "-L", "20", "-H", "80", "-h", magenta, "-l", green, "-n", yellow] 10,
|
||||
Run $ Memory ["-t", "<fn=1>\xf538</fn> <usedratio>%", "-H", "10240", "-L", "6144", "-h", magenta, "-l", green, "-n", yellow] 20,
|
||||
Run $ BatteryP ["BAT1", "BAT0", "BAT2"] ["-t", "<acstatus>", "-L", "10", "-H", "80", "-l", magenta, "-h", green, "-n", yellow, "--", "-O", "Charging", "-o", "<left>%", "-a", "notify-send -u critical 'Battery running out!'", "-A", "5", "--lows", "<fn=1>\xf243</fn> ", "--mediums", "<fn=1>\xf242</fn> ", "--highs", "<fn=1>\xf240</fn> "] 300,
|
||||
Run $ DynNetwork ["-t", "<fn=1>\xf1eb</fn> <fc=" ++ magenta ++ "><rx>/<tx></fc>"] 10,
|
||||
Run $ Date "<fn=1>\xf073</fn> %-d/%-m/%-y/%w" "date" 10000,
|
||||
Run $ Date "%H:%M:%S" "time" 10,
|
||||
Run $ MPD ["-t", "<statei><title><fn=" ++ magenta ++ "> \xf001</fn>", "--", "-P", ">> ", "-Z", "|| ", "-S", "Stopped", "-h", "127.0.0.1", "-p", "6600"] 10,
|
||||
Run $ Com "~/.xmonad/lib/padding-icon.sh" ["stalonetray"] "tray" 10,
|
||||
Run $ Com "pamixer" ["--get-volume"] "" 100,
|
||||
Run UnsafeStdinReader
|
||||
],
|
||||
sepChar = "*",
|
||||
alignSep = "--",
|
||||
template = "<action=`dmenu_run` button=1><icon=~/.xmonad/lib/nixos.xpm/></action> *UnsafeStdinReader* " ++ sep ++ " <fn=1></fn>*mpd* -- *multicpu* " ++ sep ++ " *memory* " ++ sep ++ " *dynnetwork* " ++ sep ++ " *battery* " ++ sep ++ " <fn=1>\xf028</fn> <fc=" ++ green ++ ">*pamixer*%</fc> " ++ sep ++ " *date* - *time* " ++ sep ++ "*tray*"
|
||||
}
|
||||
|
||||
main :: IO ()
|
||||
main = xmobar config
|
||||
@@ -19,20 +19,30 @@ import XMonad.Actions.CycleWindows
|
||||
import qualified XMonad.StackSet as W
|
||||
import qualified Data.Map as M
|
||||
|
||||
myBorderWidth = 2
|
||||
myTerminal = "/usr/bin/env st"
|
||||
myFocusFollowsMouse = True
|
||||
myNormalBorderColor = "#1d2021"
|
||||
myModMask = mod4Mask
|
||||
myFocusedBorderColor = "#d5c4a1"
|
||||
myManageHook = composeAll
|
||||
[ className =? "Discord" --> doFloat ]
|
||||
--colors
|
||||
bgColor = "#002b36"
|
||||
fgColor = "#eee8d5"
|
||||
inactiveWinColor = "#2aa198"
|
||||
activeWinColor = "#d33682"
|
||||
urgentWinColor = "#dc322f"
|
||||
miscColor = inactiveWinColor
|
||||
|
||||
tabConfig = defaultTheme {
|
||||
activeTextColor = "#1d2021",
|
||||
activeColor = "#d5c4a1",
|
||||
inactiveTextColor = "#d5c4a1",
|
||||
inactiveColor = "#1d2021"
|
||||
myBorderWidth = 2
|
||||
myTerminal = "st"
|
||||
myFocusFollowsMouse = True
|
||||
myNormalBorderColor = bgColor
|
||||
myModMask = mod4Mask
|
||||
myFocusedBorderColor = fgColor
|
||||
myManageHook = composeAll
|
||||
[ className =? "Discord" --> doFloat
|
||||
, className =? "Anki" --> doFloat
|
||||
]
|
||||
|
||||
tabConfig = def {
|
||||
activeTextColor = bgColor,
|
||||
activeColor = fgColor,
|
||||
inactiveTextColor = fgColor,
|
||||
inactiveColor = bgColor
|
||||
}
|
||||
|
||||
myXmobarrc = "~/.xmonad/lib/xmobar.hs"
|
||||
@@ -40,54 +50,67 @@ myXmobarrc = "~/.xmonad/lib/xmobar.hs"
|
||||
myWorkspaces = clickable $ ["\xf269", "\xf120", "\xf121", "\xf392", "\xf008", "\xf07b", "\xf11b", "\xf086", "\xf074" ]
|
||||
where clickable l = ["<action=`xdotool key super+" ++ show (n) ++ "`>" ++ ws ++ "</action>" | (i,ws) <- zip [1..9] l, let n = i ]
|
||||
|
||||
playerctl = "playerctl -p 'playerctld,%any'"
|
||||
|
||||
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
|
||||
[ ((modMask, xK_Return),
|
||||
spawn $ XMonad.terminal conf)
|
||||
|
||||
, ((modMask, xK_d),
|
||||
spawn "/usr/bin/env dmenu_run -l 20")
|
||||
spawn "dmenu_run -l 20")
|
||||
|
||||
, ((modMask, xK_s),
|
||||
spawn "dmenu_websearch")
|
||||
|
||||
, ((shiftMask, xK_Print),
|
||||
spawn "flameshot gui -p /home/natto/Pictures")
|
||||
spawn "flameshot gui")
|
||||
|
||||
, ((0, xK_Print),
|
||||
spawn "flameshot full -p /home/natto/Pictures")
|
||||
|
||||
, ((mod1Mask, xK_Print),
|
||||
spawn "flameshot full -p /home/natto/Pictures -d 10000")
|
||||
spawn "flameshot gui -d 10000")
|
||||
|
||||
, ((modMask, xK_p),
|
||||
spawn "mpc toggle")
|
||||
spawn (playerctl ++ " play-pause"))
|
||||
|
||||
, ((modMask, xK_h),
|
||||
spawn "mpc next")
|
||||
, ((0, xF86XK_AudioPlay),
|
||||
spawn (playerctl ++ " play-pause"))
|
||||
|
||||
, ((modMask, xK_k),
|
||||
spawn "mpc prev")
|
||||
, ((modMask, xF86XK_AudioNext),
|
||||
spawn (playerctl ++ " next"))
|
||||
|
||||
, ((modMask .|. shiftMask, xK_a),
|
||||
spawn "mpc seek -00:00:05")
|
||||
, ((modMask, xF86XK_AudioPrev),
|
||||
spawn (playerctl ++ " previous"))
|
||||
|
||||
, ((modMask .|. shiftMask, xK_s),
|
||||
spawn "mpc seek +00:00:05")
|
||||
, ((0, xF86XK_AudioPrev),
|
||||
spawn (playerctl ++ " position 5-"))
|
||||
|
||||
, ((modMask .|. shiftMask, xK_period),
|
||||
spawn "pamixer --allow-boost -i 5")
|
||||
, ((0, xF86XK_AudioNext),
|
||||
spawn (playerctl ++ " position 5+"))
|
||||
|
||||
, ((modMask .|. shiftMask, xK_comma),
|
||||
spawn "pamixer --allow-boost -d 5")
|
||||
, ((0, xF86XK_AudioRaiseVolume),
|
||||
spawn "pamixer --allow-boost -ui 5")
|
||||
|
||||
, ((0, xF86XK_AudioLowerVolume),
|
||||
spawn "pamixer --allow-boost -ud 5")
|
||||
|
||||
, ((0, xF86XK_AudioMute),
|
||||
spawn "pamixer -t")
|
||||
|
||||
, ((modMask .|. shiftMask, xK_q), kill)
|
||||
|
||||
, ((mod1Mask, xK_Tab),
|
||||
cycleRecentWindows [xK_Alt_L] xK_Tab xK_q)
|
||||
|
||||
, ((modMask .|. mod1Mask, xK_0), spawn "light -A 5")
|
||||
, ((0, xF86XK_MonBrightnessUp),
|
||||
spawn "light -A 5")
|
||||
|
||||
, ((modMask .|. mod1Mask, xK_9), spawn "light -U 5")
|
||||
, ((0, xF86XK_MonBrightnessDown),
|
||||
spawn "light -U 5")
|
||||
|
||||
, ((modMask .|. shiftMask, xK_F1),
|
||||
spawn "setxkbmap us-colemak")
|
||||
spawn "setxkbmap us colemak_dh")
|
||||
|
||||
, ((modMask .|. shiftMask, xK_F2),
|
||||
spawn "setxkbmap us basic")
|
||||
@@ -98,6 +121,9 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
|
||||
, ((modMask .|. shiftMask, xK_F4),
|
||||
spawn "setxkbmap in guru")
|
||||
|
||||
, ((modMask .|. shiftMask, xK_F5),
|
||||
spawn "setxkbmap colemak dhz")
|
||||
|
||||
, ((modMask, xK_space),
|
||||
sendMessage NextLayout)
|
||||
|
||||
@@ -190,39 +216,8 @@ toggleFullscreen =
|
||||
windows $ if isFullFloat then W.sink w else W.float w fullRect
|
||||
--}}}
|
||||
|
||||
--{{{
|
||||
--couldnt get fullScreenEventHook to work normally so using this for now
|
||||
--source code: https://github.com/xmonad/xmonad-contrib/blob/v0.16/XMonad/Hooks/EwmhDesktops.hs
|
||||
|
||||
fullscreenFix :: XConfig a -> XConfig a
|
||||
fullscreenFix c = c {
|
||||
startupHook = startupHook c +++ setSupportedWithFullscreen
|
||||
}
|
||||
where x +++ y = mappend x y
|
||||
|
||||
setSupportedWithFullscreen :: X ()
|
||||
setSupportedWithFullscreen = withDisplay $ \dpy -> do
|
||||
r <- asks theRoot
|
||||
a <- getAtom "_NET_SUPPORTED"
|
||||
c <- getAtom "ATOM"
|
||||
supp <- mapM getAtom ["_NET_WM_STATE_HIDDEN"
|
||||
,"_NET_WM_STATE_FULLSCREEN"
|
||||
,"_NET_NUMBER_OF_DESKTOPS"
|
||||
,"_NET_CLIENT_LIST"
|
||||
,"_NET_CLIENT_LIST_STACKING"
|
||||
,"_NET_CURRENT_DESKTOP"
|
||||
,"_NET_DESKTOP_NAMES"
|
||||
,"_NET_ACTIVE_WINDOW"
|
||||
,"_NET_WM_DESKTOP"
|
||||
,"_NET_WM_STRUT"
|
||||
]
|
||||
io $ changeProperty32 dpy r a c propModeReplace (fmap fromIntegral supp)
|
||||
|
||||
setWMName "xmonad"
|
||||
--}}}
|
||||
|
||||
main = do xmproc <- spawnPipe ("xmobar " ++ myXmobarrc)
|
||||
xmonad $ docks $ fullscreenFix $ ewmh def
|
||||
xmonad $ docks $ ewmh def
|
||||
{ borderWidth = myBorderWidth
|
||||
, manageHook = manageDocks <+> myManageHook
|
||||
, handleEventHook = handleEventHook def <+> fullscreenEventHook
|
||||
@@ -236,12 +231,12 @@ main = do xmproc <- spawnPipe ("xmobar " ++ myXmobarrc)
|
||||
, workspaces = myWorkspaces
|
||||
, logHook = dynamicLogWithPP xmobarPP
|
||||
{ ppOutput = hPutStrLn xmproc
|
||||
, ppCurrent = xmobarColor "#b8bb26" "" . wrap "+" ""
|
||||
, ppVisible = xmobarColor "#b8bb26" ""
|
||||
, ppHidden = xmobarColor "#d3869b" ""
|
||||
, ppTitle = xmobarColor "#ebdbb2" "" . shorten 60
|
||||
, ppCurrent = xmobarColor activeWinColor "" . wrap "(" ")"
|
||||
, ppVisible = xmobarColor activeWinColor ""
|
||||
, ppHidden = xmobarColor inactiveWinColor ""
|
||||
, ppTitle = xmobarColor fgColor "" . shorten 40
|
||||
, ppLayout = const ""
|
||||
, ppUrgent = xmobarColor "#fabd2f" "" . wrap "!" ""
|
||||
, ppSep = "<fc=#83a598> ║ </fc>"
|
||||
, ppUrgent = xmobarColor urgentWinColor "" . wrap "!" ""
|
||||
, ppSep = "<fc=" ++ miscColor ++ "> ║ </fc>"
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,4 @@ map S rotate
|
||||
map f zoom in
|
||||
map q zoom out
|
||||
map p follow link
|
||||
#map m scroll left
|
||||
#map i scroll right
|
||||
#map n scroll down
|
||||
#map e scroll up
|
||||
set selection-clipboard clipboard
|
||||
13
home/natto/cursor.nix
Normal file
13
home/natto/cursor.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.pointerCursor = {
|
||||
package = pkgs.catppuccin-cursors.mochaFlamingo;
|
||||
name = "catppuccin-mocha-flamingo-cursors";
|
||||
size = 32;
|
||||
x11 = {
|
||||
enable = true;
|
||||
defaultCursor = "crosshair";
|
||||
};
|
||||
gtk.enable = true;
|
||||
};
|
||||
}
|
||||
39
home/natto/default.nix
Normal file
39
home/natto/default.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{ ... }:
|
||||
{
|
||||
home = {
|
||||
homeDirectory = "/home/natto";
|
||||
username = "natto";
|
||||
stateVersion = "22.11";
|
||||
};
|
||||
|
||||
imports = [
|
||||
./email.nix
|
||||
./pass.nix
|
||||
./browser.nix
|
||||
./pdf.nix
|
||||
./mpv.nix
|
||||
./pkgs.nix
|
||||
./stuff.nix
|
||||
./gtk.nix
|
||||
./dunst.nix
|
||||
./git.nix
|
||||
./music.nix
|
||||
./zsh.nix
|
||||
./games.nix
|
||||
./cursor.nix
|
||||
./emacs.nix
|
||||
|
||||
# when xserver
|
||||
# ./xsession.nix
|
||||
|
||||
# when wayland
|
||||
./wayland.nix
|
||||
./hyprpaper.nix
|
||||
./hyprlock.nix
|
||||
./hypridle.nix
|
||||
./hyprland.nix
|
||||
./foot.nix
|
||||
./tofi.nix
|
||||
./ags
|
||||
];
|
||||
}
|
||||
40
home/natto/dunst.nix
Normal file
40
home/natto/dunst.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{ config, conf, ... }:
|
||||
{
|
||||
services = {
|
||||
dunst = {
|
||||
enable = true;
|
||||
iconTheme = with config.gtk.iconTheme; {
|
||||
inherit name package;
|
||||
};
|
||||
settings = with conf.colors.hex; {
|
||||
global = {
|
||||
mouse_left_click = "close_current";
|
||||
mouse_right_click = "do_action";
|
||||
mouse_middle_click = "close_all";
|
||||
font = "Monospace 10";
|
||||
separator_color = "auto";
|
||||
shrink = true;
|
||||
word_wrap = "yes";
|
||||
};
|
||||
|
||||
urgency_low = {
|
||||
inherit background foreground;
|
||||
frame_color = sky;
|
||||
timeout = 5;
|
||||
};
|
||||
|
||||
urgency_normal = {
|
||||
inherit background foreground;
|
||||
frame_color = mauve;
|
||||
timeout = 5;
|
||||
};
|
||||
|
||||
urgency_critical = {
|
||||
inherit background foreground;
|
||||
frame_color = red;
|
||||
timeout = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
49
home/natto/emacs.nix
Normal file
49
home/natto/emacs.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
let
|
||||
emacs = pkgs.emacs-git-pgtk;
|
||||
configFile = ./config/emacs/config.org;
|
||||
enable = true;
|
||||
in
|
||||
{
|
||||
nixpkgs.overlays = [ inputs.emacs-overlay.overlays.default ];
|
||||
|
||||
home = {
|
||||
shellAliases = rec {
|
||||
e = "emacs";
|
||||
enw = e + " -nw";
|
||||
ec = "emacsclient";
|
||||
ecc = ec + " -c";
|
||||
ecnw = ec + " -nw";
|
||||
};
|
||||
};
|
||||
programs.emacs = {
|
||||
inherit enable;
|
||||
package = pkgs.emacsWithPackagesFromUsePackage {
|
||||
config = configFile;
|
||||
package = emacs;
|
||||
alwaysEnsure = true;
|
||||
alwaysTangle = true;
|
||||
defaultInitFile = true;
|
||||
extraEmacsPackages = epkgs: with epkgs; [
|
||||
use-package
|
||||
(tree-sitter-langs.withPlugins (_: tree-sitter-langs.plugins))
|
||||
];
|
||||
|
||||
override = final: prev: {
|
||||
evil = prev.melpaPackages.evil.overrideAttrs(_: {
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "natto1784";
|
||||
repo = "evil";
|
||||
rev = "isearch-lazy-count";
|
||||
sha256 = "sha256-YqXoqPqOWRvszzktb0MYHMe590mzTQxCMgBloy3MHkQ=";
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
services.emacs = {
|
||||
inherit enable;
|
||||
defaultEditor = true;
|
||||
};
|
||||
systemd.user.services.emacs.Service.Environment = "COLORTERM=truecolor";
|
||||
}
|
||||
121
home/natto/email.nix
Normal file
121
home/natto/email.nix
Normal file
@@ -0,0 +1,121 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
conf,
|
||||
...
|
||||
}:
|
||||
let
|
||||
realName = "Amneesh Singh";
|
||||
in
|
||||
{
|
||||
accounts.email = {
|
||||
accounts = {
|
||||
natto =
|
||||
let
|
||||
domain = conf.network.addresses.domain.natto;
|
||||
address = "natto@${domain}";
|
||||
host = "mail.${domain}";
|
||||
in
|
||||
{
|
||||
inherit realName address;
|
||||
primary = true;
|
||||
userName = address;
|
||||
gpg = {
|
||||
key = "3C4BDBE7BBF45B52C14EA193007257B05FCC86A8";
|
||||
signByDefault = true;
|
||||
};
|
||||
imap = {
|
||||
inherit host;
|
||||
tls.enable = true;
|
||||
};
|
||||
imapnotify.enable = true;
|
||||
smtp = {
|
||||
inherit host;
|
||||
tls.enable = true;
|
||||
};
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "both";
|
||||
};
|
||||
passwordCommand = "pass show email/${address}";
|
||||
neomutt = {
|
||||
enable = true;
|
||||
extraMailboxes = [
|
||||
"Sent"
|
||||
"Drafts"
|
||||
"Trash"
|
||||
"Junk"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
amneesh =
|
||||
let
|
||||
domain = conf.network.addresses.domain.amneesh;
|
||||
address = "me@${domain}";
|
||||
host = "mail.${domain}";
|
||||
in
|
||||
{
|
||||
inherit address realName;
|
||||
userName = address;
|
||||
|
||||
gpg = {
|
||||
key = "0C2FDA374F2D48D9F9F0F7788EAAB36980C424C2";
|
||||
signByDefault = true;
|
||||
};
|
||||
|
||||
imap = {
|
||||
inherit host;
|
||||
tls.enable = true;
|
||||
};
|
||||
imapnotify.enable = true;
|
||||
smtp = {
|
||||
inherit host;
|
||||
tls.enable = true;
|
||||
};
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "both";
|
||||
};
|
||||
passwordCommand = "pass show email/${address}";
|
||||
neomutt = {
|
||||
enable = true;
|
||||
extraMailboxes = [
|
||||
"Sent"
|
||||
"Drafts"
|
||||
"Junk"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
services = {
|
||||
imapnotify.enable = true;
|
||||
};
|
||||
programs = {
|
||||
mbsync.enable = true;
|
||||
neomutt = rec {
|
||||
enable = true;
|
||||
package = pkgs.neomutt;
|
||||
sort = "reverse-date";
|
||||
extraConfig = lib.concatMapStringsSep "\n" builtins.readFile [
|
||||
./config/neomutt/neomuttrc
|
||||
./config/neomutt/theme
|
||||
];
|
||||
};
|
||||
};
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
mailcap
|
||||
w3m
|
||||
];
|
||||
file = {
|
||||
mailcap = {
|
||||
source = ./config/mailcap;
|
||||
target = "${config.home.homeDirectory}/.mailcap";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
4
home/natto/eww/README.org
Normal file
4
home/natto/eww/README.org
Normal file
@@ -0,0 +1,4 @@
|
||||
#+OPTIONS: toc:nil
|
||||
Inspired by
|
||||
+ [[https://github.com/saimoomedits/eww-widgets/tree/cfb2523a4e37ed2979e964998d9a4c37232b2975][saimoomedits]]
|
||||
+ [[https://github.com/fufexan/dotfiles/tree/db777ae5a76db34608dd486ed9238e9129252bbc/home/programs/eww][fufexan]]
|
||||
242
home/natto/eww/bar/bar.scss
Normal file
242
home/natto/eww/bar/bar.scss
Normal file
@@ -0,0 +1,242 @@
|
||||
* {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: $background;
|
||||
border: 1px solid $pink;
|
||||
border-radius: 2px;
|
||||
|
||||
label {
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin color-shadow($color, $opacity: 0.08, $on-hover: 1) {
|
||||
color: $color;
|
||||
|
||||
@if $on-hover == 0 {
|
||||
box-shadow: 0 0 0 9999px rgba($color, $opacity) inset;
|
||||
} @else {
|
||||
&:hover {
|
||||
box-shadow: 0 0 0 9999px rgba($color, $opacity) inset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bar, .music-large {
|
||||
font-family: "Fira Mono";
|
||||
background: $background;
|
||||
|
||||
button:hover {
|
||||
transition: 0.15s;
|
||||
}
|
||||
|
||||
scale trough, circular-progress {
|
||||
background: $surface1;
|
||||
}
|
||||
}
|
||||
|
||||
.workspaces {
|
||||
font-size: 16px;
|
||||
font-family: "Lohit Devanagari";
|
||||
|
||||
button {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.workspace-active {
|
||||
@include color-shadow($mauve, $on-hover: 0);
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.workspace-inactive {
|
||||
@include color-shadow($flamingo);
|
||||
}
|
||||
}
|
||||
|
||||
.music {
|
||||
button {
|
||||
background: none;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.music-control {
|
||||
@include color-shadow($mauve);
|
||||
font-family: "Font Awesome 6 Free";
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.music-title {
|
||||
@include color-shadow($sapphire);
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.music-large {
|
||||
border: solid 3px $sapphire;
|
||||
color: $mauve;
|
||||
border-radius: 8px;
|
||||
|
||||
.music-large-cover {
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
border-radius: 5px;
|
||||
margin: 15px 0 15px 15px;
|
||||
min-height: 200px;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.music-large-controls {
|
||||
margin: 15px;
|
||||
|
||||
scale trough {
|
||||
min-height: 5px;
|
||||
margin: 0 15px;
|
||||
|
||||
highlight {
|
||||
background-image: linear-gradient(to right, $sapphire, $teal);
|
||||
}
|
||||
|
||||
slider {
|
||||
border-radius: 4px;
|
||||
background: $background;
|
||||
border: 2px $mauve solid;
|
||||
margin: -10px -10px;
|
||||
transition: 0.2s;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
&:active {
|
||||
box-shadow: 0 0 0 1px inset, 0 0 0 8px rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.music-large-artist {
|
||||
font-size: 18px;
|
||||
color: $mauve;
|
||||
}
|
||||
|
||||
.music-large-album {
|
||||
font-size: 16px;
|
||||
color: $sapphire;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.system {
|
||||
button {
|
||||
background: none;
|
||||
font-size: 20px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.system-scale {
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
scale trough {
|
||||
min-height: 20px;
|
||||
min-width: 120px;
|
||||
border-radius: 3px;
|
||||
|
||||
highlight {
|
||||
all: unset;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
slider {
|
||||
all:unset;
|
||||
border: none;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.system-sound {
|
||||
button {
|
||||
@include color-shadow($green);
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
scale trough highlight {
|
||||
background-color: $green;
|
||||
}
|
||||
}
|
||||
|
||||
.system-bright {
|
||||
button {
|
||||
@include color-shadow($yellow);
|
||||
}
|
||||
|
||||
scale trough highlight {
|
||||
background-color: $yellow;
|
||||
}
|
||||
}
|
||||
|
||||
.system-temp {
|
||||
button {
|
||||
@include color-shadow($red);
|
||||
}
|
||||
}
|
||||
|
||||
.system-net {
|
||||
button {
|
||||
@include color-shadow($mauve);
|
||||
}
|
||||
}
|
||||
|
||||
.system-separator {
|
||||
min-width: 5px;
|
||||
background-color: $sapphire;
|
||||
}
|
||||
|
||||
.system-metrics {
|
||||
transition: 0.2s;
|
||||
|
||||
label {
|
||||
padding: 0 5px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
circular-progress {
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.system-metric-cpu {
|
||||
color: $teal;
|
||||
}
|
||||
|
||||
.system-metric-battery {
|
||||
color: $yellow;
|
||||
}
|
||||
|
||||
.system-metric-memory {
|
||||
color: $pink;
|
||||
}
|
||||
|
||||
.system-metric-disk {
|
||||
color: $blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.system-time {
|
||||
label {
|
||||
color: $foreground;
|
||||
padding: 0 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.system-time-time {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.system-time-date {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
20
home/natto/eww/bar/bar.yuck
Normal file
20
home/natto/eww/bar/bar.yuck
Normal file
@@ -0,0 +1,20 @@
|
||||
(include "bar/music.yuck")
|
||||
(include "bar/hyprworkspaces.yuck")
|
||||
(include "bar/system.yuck")
|
||||
|
||||
(defwidget bar []
|
||||
(box :class "bar" :orientation "h" :spacing 40
|
||||
(workspaces)
|
||||
(music_compact)
|
||||
(system)))
|
||||
|
||||
(defwindow bar
|
||||
:monitor 0
|
||||
:geometry (geometry :x "0%"
|
||||
:y "0%"
|
||||
:width "100%"
|
||||
:height "40px"
|
||||
:anchor "top center")
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
(bar))
|
||||
13
home/natto/eww/bar/default.nix
Normal file
13
home/natto/eww/bar/default.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
pkgs: with pkgs; [
|
||||
coreutils
|
||||
bash
|
||||
jq
|
||||
less
|
||||
gawk
|
||||
socat
|
||||
playerctl
|
||||
networkmanager
|
||||
light
|
||||
iwgtk
|
||||
wireplumber
|
||||
]
|
||||
34
home/natto/eww/bar/hyprworkspaces
Executable file
34
home/natto/eww/bar/hyprworkspaces
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##########################################
|
||||
# workspace script to work with hyprland #
|
||||
##########################################
|
||||
|
||||
# i dont really have multiple monitors rn
|
||||
|
||||
# active workspace
|
||||
current=1
|
||||
list_workspaces() {
|
||||
workspace_list=$(hyprctl -j workspaces | jq -rc '[.[]|.id]|sort' || "[]")
|
||||
}
|
||||
|
||||
workspaces() {
|
||||
echo '{"current": '"${current}"',"list": '"${workspace_list}"'}'
|
||||
}
|
||||
|
||||
list_workspaces
|
||||
workspaces
|
||||
hyprctl dispatch workspace $current &>/dev/null || true
|
||||
|
||||
socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r event; do
|
||||
case ${event%>>*} in
|
||||
"workspace")
|
||||
current=${event##*>>}
|
||||
workspaces
|
||||
;;
|
||||
"createworkspace"|"destroyworkspace")
|
||||
list_workspaces
|
||||
workspaces
|
||||
;;
|
||||
esac
|
||||
done
|
||||
13
home/natto/eww/bar/hyprworkspaces.yuck
Normal file
13
home/natto/eww/bar/hyprworkspaces.yuck
Normal file
@@ -0,0 +1,13 @@
|
||||
(deflisten workspace :initial "{}" "bar/hyprworkspaces")
|
||||
(defvar numerals "[\"१\", \"२\", \"३\", \"४\", \"५\", \"६\", \"७\", \"८\", \"९\", \"०\"]")
|
||||
|
||||
(defwidget workspaces []
|
||||
(eventbox
|
||||
:cursor "pointer"
|
||||
(box
|
||||
:class "workspaces"
|
||||
(for ws in {workspace.list}
|
||||
(button
|
||||
:class "${ws == workspace.current ? 'workspace-active' : 'workspace-inactive'}"
|
||||
:onclick "hyprctl dispatch workspace ${ws}"
|
||||
{ws <= 10 ? numerals[ws - 1] : ws })))))
|
||||
92
home/natto/eww/bar/music.yuck
Normal file
92
home/natto/eww/bar/music.yuck
Normal file
@@ -0,0 +1,92 @@
|
||||
(defvar playerctl "playerctl -p 'playerctld,%any'")
|
||||
|
||||
; https://github.com/elkowar/eww/issues/518
|
||||
(deflisten music :initial ""
|
||||
"playerctl -p 'playerctld,%any' --follow metadata --format '{\"artist\":\"{{artist}}\",\"album\":\"{{album}}\",\"title\":\"{{trunc(title,40)}}\",\"full_title\":\"{{title}}\",\"cover\":\"{{mpris:artUrl}}\", \"status\":\"{{lc(status)}}\",\"duration\":\"{{duration(mpris:length)}}\",\"raw_duration\":\"{{mpris:length}}\",\"position\":\"{{duration(position)}}\",\"raw_position\":\"{{position}}\"}'")
|
||||
|
||||
(defwidget music_controls[]
|
||||
(box
|
||||
(button :class "music-control" :onclick "${playerctl} previous" "")
|
||||
(button :class "music-control" :onclick "${playerctl} play-pause" {music.status == "playing" ? "" : "" })
|
||||
(button :class "music-control" :onclick "${playerctl} next" "")))
|
||||
|
||||
(defwidget music_large []
|
||||
(box
|
||||
:halign "center"
|
||||
:class "music-large"
|
||||
:orientation "h"
|
||||
(box
|
||||
:class "music-large-cover"
|
||||
:visible {music.cover != ""}
|
||||
:style "background-image: url(\"${music.cover}\");")
|
||||
(box
|
||||
:orientation "v"
|
||||
:class "music-large-controls"
|
||||
:spacing {music.cover == "" ? 10 : 0}
|
||||
(label
|
||||
:visible {music.artist != ""}
|
||||
:class "music-large-artist"
|
||||
:text {music.artist})
|
||||
(label
|
||||
:visible {music.album != ""}
|
||||
:class "music-large-album"
|
||||
:text {music.album})
|
||||
(eventbox
|
||||
:cursor "pointer"
|
||||
(music_controls))
|
||||
(box
|
||||
(label
|
||||
:visible {music.position != ""}
|
||||
:xalign {music.duration == "" ? 0.5 : 0}
|
||||
:style {music.duration == "" ? "font-size: 18px;": ""}
|
||||
:text {music.position})
|
||||
(label
|
||||
:visible {music.duration != ""}
|
||||
:xalign {music.position == "" ? 0.5 : 1}
|
||||
:style {music.position == "" ? "font-size: 18px;": ""}
|
||||
:text {music.duration}))
|
||||
(eventbox
|
||||
:class "music-large-scale"
|
||||
:cursor "pointer"
|
||||
:visible {music.raw_duration != "" && music.raw_position != "" }
|
||||
(scale
|
||||
:min 0
|
||||
:max {music.raw_duration / 1000000}
|
||||
:onchange "${playerctl} position {}"
|
||||
:value {music.raw_position / 1000000})))))
|
||||
|
||||
(defvar music_control false)
|
||||
|
||||
(defwidget music_compact []
|
||||
(eventbox
|
||||
:cursor "pointer"
|
||||
:onhover "${EWW_CMD} update music_control=true"
|
||||
:onhoverlost "${EWW_CMD} update music_control=false"
|
||||
:visible {music.title != "" && music.status != "stopped" && music != ""}
|
||||
:halign "center"
|
||||
(box
|
||||
:class "music"
|
||||
:space-evenly "false"
|
||||
(button
|
||||
:class "music-title"
|
||||
:onclick "${EWW_CMD} open --toggle music"
|
||||
:tooltip "${music.title} by ${music.artist}"
|
||||
:onrightclick "wl-copy \"${music.artist} - ${music.full_title}\""
|
||||
{music.title})
|
||||
(revealer
|
||||
:transition "slideright"
|
||||
:reveal music_control
|
||||
:duration "200ms"
|
||||
(music_controls)
|
||||
))))
|
||||
|
||||
(defwindow music
|
||||
:stacking "overlay"
|
||||
:monitor 0
|
||||
:geometry (geometry
|
||||
:x "0%"
|
||||
:y "10px"
|
||||
:width "0%"
|
||||
:height "0%"
|
||||
:anchor "top center")
|
||||
(music_large))
|
||||
183
home/natto/eww/bar/system.yuck
Normal file
183
home/natto/eww/bar/system.yuck
Normal file
@@ -0,0 +1,183 @@
|
||||
(defvar system_sound_control false)
|
||||
(defvar system_sound_mute false)
|
||||
|
||||
(defpoll volume :interval "3s"
|
||||
"wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2 * 100}'")
|
||||
|
||||
(defwidget system_sound []
|
||||
(eventbox
|
||||
:cursor "pointer"
|
||||
:onhover "${EWW_CMD} update system_sound_control=true"
|
||||
:onhoverlost "${EWW_CMD} update system_sound_control=false"
|
||||
:tooltip "${ system_sound_mute ? 'Muted' : 'Volume: ${volume}%'}"
|
||||
(box
|
||||
:space-evenly false
|
||||
:orientation "h"
|
||||
:class "system-sound"
|
||||
(revealer
|
||||
:transition "slideleft"
|
||||
:reveal system_sound_control
|
||||
:duration "250ms"
|
||||
(scale
|
||||
:class "system-scale"
|
||||
:min 0
|
||||
:max 151
|
||||
:onchange "wpctl set-volume @DEFAULT_AUDIO_SINK@ {}%"
|
||||
:value {volume}
|
||||
))
|
||||
(button
|
||||
; since we do not know the initial state, we will just update the variable
|
||||
:onclick "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && ${EWW_CMD} update system_sound_mute=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $3 ~ /MUTED/ ? \"true\" : \"false\"}')"
|
||||
{system_sound_mute ? "" : volume > 75 ? "" : "" })
|
||||
)))
|
||||
|
||||
(defvar system_bright_control false)
|
||||
|
||||
(defpoll bright :interval "3s" "light")
|
||||
|
||||
(defwidget system_bright []
|
||||
(eventbox
|
||||
:cursor "pointer"
|
||||
:onhover "${EWW_CMD} update system_bright_control=true"
|
||||
:onhoverlost "${EWW_CMD} update system_bright_control=false"
|
||||
:tooltip "Brightness: ${round(bright,0)}%"
|
||||
(box
|
||||
:space-evenly false
|
||||
:orientation "h"
|
||||
:class "system-bright"
|
||||
(revealer
|
||||
:transition "slideleft"
|
||||
:reveal system_bright_control
|
||||
:duration "250ms"
|
||||
(scale
|
||||
:class "system-scale"
|
||||
:min 5
|
||||
:max 101
|
||||
:onchange "light -S {}"
|
||||
:value {bright}
|
||||
))
|
||||
(button
|
||||
:onclick "light -S ${bright < 51 ? 100 : 50}"
|
||||
""))))
|
||||
|
||||
(defwidget system_temp []
|
||||
(eventbox
|
||||
:cursor "pointer"
|
||||
:tooltip {EWW_TEMPS["CORETEMP_PACKAGE_ID_0"] != "" ? "CPU: ${EWW_TEMPS['CORETEMP_PACKAGE_ID_0']} C" : EWW_TEMPS}
|
||||
:class "system-temp"
|
||||
(button
|
||||
"")))
|
||||
|
||||
(defpoll system_net_ethernet :interval "4s" :initial ""
|
||||
"nmcli -f NAME,TYPE con show --active | awk '$NF == \"ethernet\" {NF--; print}'")
|
||||
|
||||
(defpoll system_net_wifi :interval "4s" :initial ""
|
||||
"nmcli -f NAME,TYPE con show --active | awk '$NF == \"wifi\" { NF--; print}'")
|
||||
|
||||
(defwidget system_net []
|
||||
(eventbox
|
||||
:cursor "pointer"
|
||||
:class "system-net"
|
||||
:visible {system_net_ethernet != "" || system_net_wifi != ""}
|
||||
:tooltip {EWW_NET}
|
||||
(box
|
||||
:orientation "h"
|
||||
(button
|
||||
:visible {system_net_ethernet != ""}
|
||||
:tooltip {system_net_ethernet}
|
||||
"")
|
||||
(button
|
||||
:visible {system_net_wifi != ""}
|
||||
:tooltip {system_net_wifi}
|
||||
""))))
|
||||
|
||||
(defwidget system_info []
|
||||
(box
|
||||
:orientation "h"
|
||||
:space-evenly false
|
||||
:spacing 5
|
||||
(system_sound)
|
||||
(system_bright)
|
||||
(system_temp)))
|
||||
|
||||
(defwidget system_metric [value class tooltip]
|
||||
(box
|
||||
:orientation "h"
|
||||
:space-evenly false
|
||||
:class "system-metric-${class}"
|
||||
:tooltip "${tooltip}"
|
||||
(circular-progress
|
||||
:value value
|
||||
:start-at 0
|
||||
:thickness 4
|
||||
(label :text ""))))
|
||||
|
||||
(defwidget system_metrics []
|
||||
(eventbox
|
||||
:cursor "pointer"
|
||||
:class "system-metrics"
|
||||
:tooltip "test"
|
||||
:onclick "${EWW_CMD} open --toggle system"
|
||||
(box
|
||||
:space-evenly false
|
||||
(system_metric
|
||||
:value {EWW_CPU.avg}
|
||||
:tooltip "CPU Usage: ${round(EWW_CPU.avg, 2)}%
|
||||
CPU Freq: ${EWW_CPU.cores[0].freq} MHz}"
|
||||
:class "cpu")
|
||||
(system_metric
|
||||
:value {EWW_RAM.used_mem_perc}
|
||||
:tooltip "Free Memory: ${round(EWW_RAM.free_mem / 1024 / 1024, 2)} MB
|
||||
Available Memory: ${round(EWW_RAM.available_mem / 1024 / 1024, 2)} MB
|
||||
Free %: ${round(100 - EWW_RAM.used_mem_perc, 2)}%"
|
||||
:class "memory")
|
||||
(system_metric
|
||||
:value {EWW_BATTERY.total_avg}
|
||||
:tooltip "Battery ${round(EWW_BATTERY.total_avg, 0)}%"
|
||||
:class "battery")
|
||||
(system_metric
|
||||
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
|
||||
:tooltip "Free Disk: ${round(EWW_DISK['/'].free / 1024 / 1024 / 1024, 2)} GB
|
||||
Free Disk %: ${round(EWW_DISK['/'].free / EWW_DISK['/'].total * 100, 2)}%"
|
||||
:class "disk"))))
|
||||
|
||||
(defvar system_date_reveal false)
|
||||
|
||||
(defpoll time :interval "1s"
|
||||
"date '+%H:%M:%S'")
|
||||
|
||||
(defpoll date :interval "10m"
|
||||
"date '+%b %d'")
|
||||
|
||||
(defwidget system_time []
|
||||
(eventbox
|
||||
:onhover "${EWW_CMD} update system_date_reveal=true"
|
||||
:onhoverlost "${EWW_CMD} update system_date_reveal=false"
|
||||
(box
|
||||
:space-evenly false
|
||||
:orientation "h"
|
||||
:class "system-time"
|
||||
(label :class "system-time-time" :text {time})
|
||||
(revealer
|
||||
:transition "slideright"
|
||||
:reveal system_date_reveal
|
||||
:duration "250ms"
|
||||
(label :class "system-time-date" :text {date})))))
|
||||
|
||||
(defwidget system_separator [?visible] (box :class "system-separator" :visible {visible == "false" ? false : true}))
|
||||
|
||||
(defwidget system []
|
||||
(box
|
||||
:halign "end"
|
||||
:class "system"
|
||||
:space-evenly false
|
||||
:spacing 5
|
||||
(system_separator)
|
||||
(system_info)
|
||||
(system_separator
|
||||
:visible "${system_net_ethernet != "" || system_net_wifi != ""}")
|
||||
(system_net)
|
||||
(system_separator)
|
||||
(system_metrics)
|
||||
(system_separator)
|
||||
(system_time)))
|
||||
55
home/natto/eww/default.nix
Normal file
55
home/natto/eww/default.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.eww = {
|
||||
enable = true;
|
||||
package = pkgs.eww;
|
||||
configDir = lib.cleanSourceWith {
|
||||
src = ./.;
|
||||
filter =
|
||||
name: _:
|
||||
let
|
||||
baseName = baseNameOf (toString name);
|
||||
in
|
||||
!(lib.hasSuffix ".nix" baseName);
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.eww = {
|
||||
Unit = {
|
||||
Description = "EWW Daemon";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
Service =
|
||||
let
|
||||
deps = [
|
||||
config.programs.eww.package
|
||||
]
|
||||
++ lib.optional config.wayland.windowManager.hyprland.enable config.wayland.windowManager.hyprland.package
|
||||
++ (with pkgs; [
|
||||
coreutils
|
||||
bash
|
||||
jq
|
||||
less
|
||||
gawk
|
||||
socat
|
||||
playerctl
|
||||
networkmanager
|
||||
iwgtk
|
||||
wireplumber
|
||||
])
|
||||
++ lib.optional config.laptop pkgs.light;
|
||||
in
|
||||
{
|
||||
Type = "simple";
|
||||
Environment = "PATH=${lib.makeBinPath deps}";
|
||||
Restart = "on-failure";
|
||||
ExecStart = "${config.programs.eww.package}/bin/eww daemon --no-daemonize";
|
||||
};
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user