diff --git a/flake.lock b/flake.lock index d743512..326a6aa 100644 --- a/flake.lock +++ b/flake.lock @@ -90,11 +90,11 @@ "crane_2": { "flake": false, "locked": { - "lastModified": 1654444508, - "narHash": "sha256-4OBvQ4V7jyt7afs6iKUvRzJ1u/9eYnKzVQbeQdiamuY=", + "lastModified": 1661875961, + "narHash": "sha256-f1h/2c6Teeu1ofAHWzrS8TwBPcnN+EEu+z1sRVmMQTk=", "owner": "ipetkov", "repo": "crane", - "rev": "db5482bf225acc3160899124a1df5a617cfa27b5", + "rev": "d9f394e4e20e97c2a60c3ad82c2b6ef99be19e24", "type": "github" }, "original": { @@ -138,11 +138,11 @@ "devshell_2": { "flake": false, "locked": { - "lastModified": 1655976588, - "narHash": "sha256-VreHyH6ITkf/1EX/8h15UqhddJnUleb0HgbC3gMkAEQ=", + "lastModified": 1660811669, + "narHash": "sha256-V6lmsaLNFz41myppL0yxglta92ijkSvpZ+XVygAh+bU=", "owner": "numtide", "repo": "devshell", - "rev": "899ca4629020592a13a46783587f6e674179d1db", + "rev": "c2feacb46ee69949124c835419861143c4016fb5", "type": "github" }, "original": { @@ -234,57 +234,52 @@ "inputs": { "alejandra": [ "helix", - "nixCargoIntegration", + "nci", "nixpkgs" ], "crane": "crane_2", "devshell": [ "helix", - "nixCargoIntegration", + "nci", "devshell" ], "flake-utils-pre-commit": [ "helix", - "nixCargoIntegration", + "nci", "nixpkgs" ], "gomod2nix": [ "helix", - "nixCargoIntegration", + "nci", "nixpkgs" ], "mach-nix": [ "helix", - "nixCargoIntegration", + "nci", "nixpkgs" ], "nixpkgs": [ "helix", - "nixCargoIntegration", - "nixpkgs" - ], - "node2nix": [ - "helix", - "nixCargoIntegration", + "nci", "nixpkgs" ], "poetry2nix": [ "helix", - "nixCargoIntegration", + "nci", "nixpkgs" ], "pre-commit-hooks": [ "helix", - "nixCargoIntegration", + "nci", "nixpkgs" ] }, "locked": { - "lastModified": 1655975833, - "narHash": "sha256-g8sdfuglIZ24oWVbntVzniNTJW+Z3n9DNL9w9Tt+UCE=", + "lastModified": 1662176993, + "narHash": "sha256-Sy7DsGAveDUFBb6YDsUSYZd/AcXfP/MOMIwMt/NgY84=", "owner": "nix-community", "repo": "dream2nix", - "rev": "4e75e665ec3a1cddae5266bed0dd72fce0b74a23", + "rev": "809bc5940214744eb29778a9a0b03f161979c1b2", "type": "github" }, "original": { @@ -309,11 +304,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1662507674, - "narHash": "sha256-vnXfje4pfTqDEqI837GCT+hNKqzfVwPen++gnLVO9F0=", + "lastModified": 1661948914, + "narHash": "sha256-596RJgybMFUOWKkoMehqT5a7XuR6JkJg5zyqX/t1LuY=", "owner": "nix-community", "repo": "dream2nix", - "rev": "5ba9061857e3e265538c9785bb56bda2bb8f9bca", + "rev": "dc3530785e7388398c40c2b4f5893a674b8bd557", "type": "github" }, "original": { @@ -370,11 +365,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1662315613, - "narHash": "sha256-wzgWx3QxZvCAzRKLFmo/ru8hsIQsEDNeb4cPdlEyLxE=", + "lastModified": 1663061357, + "narHash": "sha256-zMJslerxTcSQ+A8fI4gFcJioRGs+T55343zOtsnEJ3k=", "owner": "elkowar", "repo": "eww", - "rev": "d58d91de78d2b9984a1bbb8314be197bc0e283dc", + "rev": "52e9603dd8c79cbc267a4733389c1f7e7625b352", "type": "github" }, "original": { @@ -493,11 +488,11 @@ }, "flake-utils_3": { "locked": { - "lastModified": 1637014545, - "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", "owner": "numtide", "repo": "flake-utils", - "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", "type": "github" }, "original": { @@ -508,11 +503,11 @@ }, "flake-utils_4": { "locked": { - "lastModified": 1656928814, - "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "owner": "numtide", "repo": "flake-utils", - "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "type": "github" }, "original": { @@ -537,22 +532,6 @@ "type": "github" } }, - "fufexan": { - "flake": false, - "locked": { - "lastModified": 1662936736, - "narHash": "sha256-zgZcmuVI+3PhViEAeuIkOTre2rmYajKW9LI5oG6XivI=", - "owner": "fufexan", - "repo": "dotfiles", - "rev": "ec0e88f5047b70f0573939369c6916ec9ce4549a", - "type": "github" - }, - "original": { - "owner": "fufexan", - "repo": "dotfiles", - "type": "github" - } - }, "gomod2nix": { "flake": false, "locked": { @@ -586,16 +565,16 @@ }, "helix": { "inputs": { - "nixCargoIntegration": "nixCargoIntegration", + "nci": "nci_2", "nixpkgs": "nixpkgs_2", "rust-overlay": "rust-overlay_3" }, "locked": { - "lastModified": 1661734840, - "narHash": "sha256-gbxNWrPz/SeYcOdDcLYD/v4yPSbdR21iVyv6Djicmq8=", + "lastModified": 1663105802, + "narHash": "sha256-u+944HxAnqNElRPRMPCCb12f35hXpQsmXsrdBp+De6s=", "owner": "helix-editor", "repo": "helix", - "rev": "411c5e48713d055be9e2031e66bf954c819bea43", + "rev": "b5be72bff79075ef4b5b51922da15e003c274b9b", "type": "github" }, "original": { @@ -612,11 +591,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1661573386, - "narHash": "sha256-pBEg8iY00Af/SAtU2dlmOAv+2x7kScaGlFRDjNoVJO8=", + "lastModified": 1663099612, + "narHash": "sha256-ucokjFDRwCFWbcGiqxz0mfHv82UqwyW7RXY6ZgKSl80=", "owner": "nix-community", "repo": "home-manager", - "rev": "d89bdff445eadff03fe414e9c30486bc8166b72b", + "rev": "60c6bfe322944d04bb38e76b64effcbd01258824", "type": "github" }, "original": { @@ -634,11 +613,11 @@ "wlroots": "wlroots" }, "locked": { - "lastModified": 1662665116, - "narHash": "sha256-AexWK3ALyvvxcqEa8qcfOp9yhwaKd13bG/WSQhwgac0=", + "lastModified": 1663104400, + "narHash": "sha256-tWz8UAPrxxR5fiRWIU8vHPHAGpY13dRiD2UgNWrFK1I=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "bacfae3084cc66b2b0574d21c43ed5811e34ef86", + "rev": "ae2173f703e8d61de953d48cc40565ba0bc9d5f7", "type": "github" }, "original": { @@ -706,29 +685,7 @@ "type": "github" } }, - "nil": { - "inputs": { - "flake-utils": "flake-utils_4", - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": "rust-overlay_4" - }, - "locked": { - "lastModified": 1660934895, - "narHash": "sha256-BeI/nM6zXKK6YJF36E4OjaBZQ+NFIbEZ+p7WcX21hLA=", - "owner": "oxalica", - "repo": "nil", - "rev": "92c5603498e82bcd61ad5adbacb53d6ae40c3a27", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "nil", - "type": "github" - } - }, - "nixCargoIntegration": { + "nci_2": { "inputs": { "devshell": "devshell_2", "dream2nix": "dream2nix_2", @@ -742,11 +699,11 @@ ] }, "locked": { - "lastModified": 1656453541, - "narHash": "sha256-ZCPVnS6zJOZJvIlwU3rKR8MBVm6A3F4/0mA7G1lQ3D0=", + "lastModified": 1662177071, + "narHash": "sha256-x6XF//RdZlw81tFAYM1TkjY+iQIpyMCWZ46r9o4wVQY=", "owner": "yusdacra", "repo": "nix-cargo-integration", - "rev": "9eb74345b30cd2e536d9dac9d4435d3c475605c7", + "rev": "65270dea87bb82fc02102a15221677eea237680e", "type": "github" }, "original": { @@ -755,6 +712,28 @@ "type": "github" } }, + "nil": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay_4" + }, + "locked": { + "lastModified": 1662951397, + "narHash": "sha256-MFnhsQRba9RK81pFH/9Bg+7DhK5G4QreFPDeIeIL0Rk=", + "owner": "oxalica", + "repo": "nil", + "rev": "bb186c9d14f3a82376b6717b9bc8da9fb775fcb7", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "nil", + "type": "github" + } + }, "nixinate": { "inputs": { "nixpkgs": [ @@ -762,11 +741,11 @@ ] }, "locked": { - "lastModified": 1661180311, - "narHash": "sha256-eNxtJdSKvGuorxEBidSuv5sAOIy7yl4+fEAOs+cmTRQ=", + "lastModified": 1663005519, + "narHash": "sha256-n7TPePh357rq1Ur6d5jROf9qt37b673VZzqSiFKxX/s=", "owner": "matthewcroughan", "repo": "nixinate", - "rev": "65584f4d1c8dfa47e86cae773b4a6ffa16ab132c", + "rev": "24c3869eedf6d07735a833cbf941d5113c5f1d7b", "type": "github" }, "original": { @@ -777,11 +756,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1660407119, - "narHash": "sha256-04lWO0pDbhAXFdL4v2VzzwgxrZ5IefKn+TmZPiPeKxg=", + "lastModified": 1663133271, + "narHash": "sha256-juBxlETvfMetD/pUFLtdDLQ8BOayxROra8d5Hg6Zg1M=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "12620020f76b1b5d2b0e6fbbda831ed4f5fe56e1", + "rev": "93580fca1000c37e382d7e2c19c78c1c3852482d", "type": "github" }, "original": { @@ -792,11 +771,11 @@ }, "nixos-persistence": { "locked": { - "lastModified": 1661590580, - "narHash": "sha256-XoPSucNvccnT50LWme/7BiENZDwr8tArEg36OGQFFnA=", + "lastModified": 1661933071, + "narHash": "sha256-RFgfzldpbCvS+H2qwH+EvNejvqs+NhPVD5j1I7HQQPY=", "owner": "nix-community", "repo": "impermanence", - "rev": "2237ad28093cb53ad2eb0fd1a9f870997287e0fa", + "rev": "def994adbdfc28974e87b0e4c949e776207d5557", "type": "github" }, "original": { @@ -821,11 +800,11 @@ "nixpkgs-wayland": { "flake": false, "locked": { - "lastModified": 1662934717, - "narHash": "sha256-rFBRzYt+XxItjqxFtXHG4PzQAG0GGGyq+y8w3Dzn9lk=", + "lastModified": 1663143742, + "narHash": "sha256-jDwtbz+eFVnsveW6V2xshajwD5w5ZDV0jWJcMCYoMuE=", "owner": "nix-community", "repo": "nixpkgs-wayland", - "rev": "9c4eb0b4babfda07d151782fcdc23b6626b376b7", + "rev": "e03f1cb970b6eb180e72dc7982f702b5af404e4b", "type": "github" }, "original": { @@ -836,11 +815,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1655624069, - "narHash": "sha256-7g1zwTdp35GMTERnSzZMWJ7PG3QdDE8VOX3WsnOkAtM=", + "lastModified": 1662019588, + "narHash": "sha256-oPEjHKGGVbBXqwwL+UjsveJzghWiWV0n9ogo1X6l4cw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0d68d7c857fe301d49cdcd56130e0beea4ecd5aa", + "rev": "2da64a81275b68fdad38af669afeda43d401e94b", "type": "github" }, "original": { @@ -852,11 +831,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1661628722, - "narHash": "sha256-oR/7NhG7pPkACToUtaaT6hH+rONE2z5/4NzjoUwEZt8=", + "lastModified": 1662996720, + "narHash": "sha256-XvLQ3SuXnDMJMpM1sv1ifPjBuRytiDYhB12H/BNTjgY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "324c8aaf25b2f2027af7798e5582ce3040a793b6", + "rev": "5f326e2a403e1cebaec378e72ceaf5725983376d", "type": "github" }, "original": { @@ -868,11 +847,11 @@ }, "nur": { "locked": { - "lastModified": 1661763713, - "narHash": "sha256-2be2ghRozr5eOba9It6bG8I3vnVNIZ69BYF6xw/UR8I=", + "lastModified": 1663140352, + "narHash": "sha256-l6zXiLm/nYezRORU3QEfgTg/cXs67UhEW83r64XPckU=", "owner": "nix-community", "repo": "NUR", - "rev": "f8ea1799c6e931a3fc71b20a7aebecdc591879bd", + "rev": "930c526eccdc1b32ada04b9014724e15247cacf6", "type": "github" }, "original": { @@ -930,7 +909,6 @@ "bernbot": "bernbot", "blog": "blog", "eww": "eww", - "fufexan": "fufexan", "helix": "helix", "home": "home", "hyprland": "hyprland", @@ -1009,11 +987,11 @@ ] }, "locked": { - "lastModified": 1655779671, - "narHash": "sha256-6feeiGa6fb7ZPVHR71uswkmN1701TAJpwYQA8QffmRk=", + "lastModified": 1662087605, + "narHash": "sha256-Gpf2gp2JenKGf+TylX/YJpttY2bzsnvAMLdLaxoZRyU=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "8159585609a772b041cce6019d5c21d240709244", + "rev": "60c2cfaa8b90ed8cebd18b214fac8682dcf222dd", "type": "github" }, "original": { @@ -1034,11 +1012,11 @@ ] }, "locked": { - "lastModified": 1659599305, - "narHash": "sha256-htzFq5RffyoKSZxiLfpUq5CyhkQwycsXB5ptale5e78=", + "lastModified": 1662173844, + "narHash": "sha256-+ZgW98Y8fZkgFSylE+Mzalumw+kw3SVivZznbJqQaj8=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "28cedcb8dfea9f1b96b0635cf99fe6bdca163f4e", + "rev": "8ac6d40380dc4ec86f1ff591d5c14c8ae1d77a18", "type": "github" }, "original": { @@ -1095,11 +1073,11 @@ "webcord": "webcord_2" }, "locked": { - "lastModified": 1662387088, - "narHash": "sha256-eB9O9UIkeKHKyCF5oNw3a+wukeaLQMNl4OvJIeR5hRo=", + "lastModified": 1662959566, + "narHash": "sha256-rajDG3utME/F6TdwIUPs44soARIx59+NOZPNCJzeUqA=", "owner": "fufexan", "repo": "webcord-flake", - "rev": "6a2a625df8a607c4a42aa921877ad65be73a2eb0", + "rev": "f1f6a0a7278459bcbfe792ad8caf7e029eeb1c32", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 309c702..d092671 100644 --- a/flake.nix +++ b/flake.nix @@ -38,9 +38,6 @@ eww.url = "github:elkowar/eww"; eww.inputs.nixpkgs.follows = "nixpkgs"; - - fufexan.url = "github:fufexan/dotfiles"; - fufexan.flake = false; }; outputs = inputs: let diff --git a/users/modules/eww/css/_calendar.scss b/users/modules/eww/css/_calendar.scss new file mode 100644 index 0000000..98280f1 --- /dev/null +++ b/users/modules/eww/css/_calendar.scss @@ -0,0 +1,26 @@ +.calendar-window { + @include wshadow; + background-color: $bg; + border: 1px solid $border; + border-radius: 16px; + color: $fg; + padding: .2em; +} + +calendar { + padding: 5px; + + :selected { + color: $mauve; + font-weight: bold; + } + + .header { + color: $subtext1; + } + + .highlight { + color: $maroon; + font-weight: bold; + } +} diff --git a/users/modules/eww/css/_colors.scss b/users/modules/eww/css/_colors.scss new file mode 100644 index 0000000..2fec382 --- /dev/null +++ b/users/modules/eww/css/_colors.scss @@ -0,0 +1,35 @@ +$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; + +$fg: $text; +$bg: $base; +$bg1: $surface0; +$border: #28283d; +$shadow: $surface1; diff --git a/users/modules/eww/css/_music.scss b/users/modules/eww/css/_music.scss new file mode 100644 index 0000000..38b528f --- /dev/null +++ b/users/modules/eww/css/_music.scss @@ -0,0 +1,64 @@ +.song-cover-art { + background-position: center; + background-size: cover; + border-radius: 16px; + margin: 4px 5px 4px 0; + min-height: 24px; + min-width: 24px; +} + +.music-window { + @include wshadow; + background-color: $bg; + border: 1px solid $border; + border-radius: 16px; + color: $fg; +} + +.music-cover-art { + background-position: center; + background-size: cover; + border-radius: 8px; + margin: 1em; + min-height: 170px; + min-width: 170px; +} + +.music-box { + margin: 1rem 1rem 1rem 0; +} + +.music-title { + font-weight: bold; +} + +.music-artist { + color: $subtext1; + font-size: 1.2rem; +} + +.music-button label { + color: $subtext1; + font-size: 2rem; +} + +.music-time { + color: $subtext1; + font-size: 1rem; + margin: 0 1rem; +} + +.music-bar scale { + highlight { + background-image: linear-gradient(to right, $teal 30%, $sky 100%); + border-radius: 24px; + } + + trough { + background-color: $bg1; + border-radius: 24px; + margin-top: 0; + min-height: 10px; + min-width: 170px; + } +} diff --git a/users/modules/eww/css/_system.scss b/users/modules/eww/css/_system.scss new file mode 100644 index 0000000..65d5047 --- /dev/null +++ b/users/modules/eww/css/_system.scss @@ -0,0 +1,91 @@ +.membar { + color: $peach; +} + +.cpubar { + color: $blue; +} + +.batbar { + color: $green; +} + +.membar, +.cpubar, +.batbar { + background-color: $bg1; +} + +.iconmem { + color: $peach; +} + +.iconbat { + color: $green; +} + +.iconcpu { + color: $blue; +} + +.icon-text { + font-size: 3rem; + padding: .7rem; +} + +.sys-text-sub { + color: $text; + font-size: 1.2rem; + margin-left: 2rem; +} + +.sys-text-mem, +.sys-text-cpu, +.sys-text-bat { + font-weight: bold; + margin-left: 2rem; +} + +.sys-icon-mem, +.sys-icon-cpu, +.sys-icon-bat { + font-size: 30px; + margin: 25px; +} + +.sys-win { + @include wshadow; + background-color: $bg; + border: 1px solid $border; + border-radius: 16px; +} + +.sys-mem, +.sys-cpu, +.sys-bat { + background-color: $bg1; +} + +.sys-icon-mem, +.sys-text-mem, +.sys-mem { + color: $peach; +} + +.sys-icon-cpu, +.sys-text-cpu, +.sys-cpu { + color: $blue; +} + +.sys-icon-bat, +.sys-text-bat, +.sys-bat { + color: $green; +} + +.sys-box { + margin: 1em; +} + + diff --git a/users/modules/eww/css/_volume.scss b/users/modules/eww/css/_volume.scss new file mode 100644 index 0000000..8d583b6 --- /dev/null +++ b/users/modules/eww/css/_volume.scss @@ -0,0 +1,39 @@ +.vol-icon { color: $teal; } +.volbar highlight { + background-image: linear-gradient(to right, $teal 30%, $sky 100%); + border-radius: 10px; +} + +.volume-window { + @include wshadow; + background-color: $bg; + border-radius: 16px; + padding-right: 1rem; +} + +.volume-text { + color: $teal; + font-size: 1.5rem; + font-weight: bold; +} + +.volume-icon { + color: $teal; + font-size: 5rem; + margin: 1rem; +} + +.volume-info { + margin: 1rem 0; +} + +.volume-bar { + trough { + min-width: 120px; + } + + highlight { + background-image: linear-gradient(to right, $teal 30%, $sky 100%); + border-radius: 16px; + } +} diff --git a/users/modules/eww/default.nix b/users/modules/eww/default.nix new file mode 100644 index 0000000..21835bf --- /dev/null +++ b/users/modules/eww/default.nix @@ -0,0 +1,35 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: { + home.packages = with pkgs; [ + config.wayland.windowManager.hyprland.package + config.programs.eww.package + bc + bluez + coreutils + findutils + gawk + gnused + jq + light + networkmanager + playerctl + procps + pulseaudio + ripgrep + socat + upower + wget + wireplumber + ]; + + programs.eww = { + enable = true; + package = inputs.eww.packages.${pkgs.system}.eww-wayland; + configDir = ./.; + }; +} diff --git a/users/modules/eww/eww.scss b/users/modules/eww/eww.scss new file mode 100644 index 0000000..c04cbce --- /dev/null +++ b/users/modules/eww/eww.scss @@ -0,0 +1,85 @@ +@import 'css/colors'; + +@mixin wshadow { + box-shadow: 0 5px 10px $shadow; + margin: 15px 20px 25px; +} + +@import 'css/calendar'; +@import 'css/music'; +@import 'css/system'; +@import 'css/volume'; + +* { + all: unset; + font-family: Roboto; + font-size: 1.3rem; +} + +.bar { + background-color: $bg; + border-radius: 8px; + color: $fg; +} + +.module { margin: 0 5px; } +tooltip { + background-color: $bg; + border: 1px solid $border; + border-radius: 10px; + color: $fg; + + label { margin: 5px; } +} + +.clock-time-sep { + color: $fg; + font-weight: bold; +} + +.clock-date-class { + color: $flamingo; + margin-right: 10px; +} + +.clock-minute-class { + color: $text; + margin-right: 5px; +} + +.clock-time-class { + color: $text; + font-weight: bold; +} + +.bright-icon { color: $yellow; } +.brightbar trough highlight { + background-image: linear-gradient(to right, $yellow 30%, $peach 100%); + border-radius: 10px; +} + +.module-ssid, +.module-net { + color: $lavender; + font-size: 1.2rem; +} + +.module-bt { font-size: 1.2rem; } +.separ { color: $surface0; } + +scale trough { + background-color: $bg1; + border-radius: 24px; + margin: 0 1rem; + min-height: 10px; + min-width: 70px; +} + +.ws { + margin-left: 4px; + + label { + font-size: 16px; + margin-top: 5px; + } +} diff --git a/users/modules/eww/eww.yuck b/users/modules/eww/eww.yuck new file mode 100644 index 0000000..6dbb3d3 --- /dev/null +++ b/users/modules/eww/eww.yuck @@ -0,0 +1,68 @@ +(include "./modules/bat.yuck") +(include "./modules/bluetooth.yuck") +(include "./modules/bright.yuck") +(include "./modules/clock.yuck") +(include "./modules/cpu.yuck") +(include "./modules/mem.yuck") +(include "./modules/music.yuck") +(include "./modules/net.yuck") +(include "./modules/variables.yuck") +(include "./modules/volume.yuck") + +(include "./windows/calendar.yuck") +(include "./windows/music_win.yuck") +(include "./windows/system.yuck") +(include "./windows/volume_win.yuck") + +(defwidget sep [] + (label :class "separ module" :text "|")) + +(defwidget workspaces [] + (literal :content workspace)) + +(defwidget left [] + (box + :space-evenly false + :halign "start" + (workspaces))) + +(defwidget right [] + (box + :space-evenly false + :halign "end" + (bright) + (volume) + (net) + (bluetooth) + (sep) + (cpu) + (mem) + (bat) + (sep) + (clock_module))) + +(defwidget center [] + (box + :space-evenly false + :halign "center" + (music))) + +(defwidget bar [] + (centerbox + :class "bar" + (left) + (center) + (right))) + +(defwindow bar + :monitor 0 + :geometry (geometry :x "0%" + :y "5px" + :width "1584px" + :height "32px" + :anchor "top center") + :stacking "fg" + :windowtype "dock" + :exclusive true + :wm-ignore false + (bar)) diff --git a/users/modules/eww/images/mic.png b/users/modules/eww/images/mic.png new file mode 100644 index 0000000..d77f315 Binary files /dev/null and b/users/modules/eww/images/mic.png differ diff --git a/users/modules/eww/images/music.png b/users/modules/eww/images/music.png new file mode 100644 index 0000000..11804f5 Binary files /dev/null and b/users/modules/eww/images/music.png differ diff --git a/users/modules/eww/images/profile.png b/users/modules/eww/images/profile.png new file mode 100644 index 0000000..0190a36 Binary files /dev/null and b/users/modules/eww/images/profile.png differ diff --git a/users/modules/eww/images/speaker.png b/users/modules/eww/images/speaker.png new file mode 100644 index 0000000..79e005b Binary files /dev/null and b/users/modules/eww/images/speaker.png differ diff --git a/users/modules/eww/modules/bat.yuck b/users/modules/eww/modules/bat.yuck new file mode 100644 index 0000000..5ffde46 --- /dev/null +++ b/users/modules/eww/modules/bat.yuck @@ -0,0 +1,10 @@ +(defwidget bat [] + (circular-progress + :value "${EWW_BATTERY["BAT0"].capacity}" + :class "batbar module" + :style "color: ${battery.color};" + :thickness 3 + (button + :tooltip "battery on ${EWW_BATTERY["BAT0"].capacity}%" + :onclick "./scripts/pop system" + (label :class "icon-text" :text "")))) diff --git a/users/modules/eww/modules/bluetooth.yuck b/users/modules/eww/modules/bluetooth.yuck new file mode 100644 index 0000000..2f15c2c --- /dev/null +++ b/users/modules/eww/modules/bluetooth.yuck @@ -0,0 +1,19 @@ +(defwidget bluetooth [] + (eventbox + :onhover "${EWW_CMD} update bt_rev=true" + :onhoverlost "${EWW_CMD} update bt_rev=false" + (box + :space-evenly "false" + (revealer + :transition "slideright" + :reveal bt_rev + :duration "350ms" + (label + :class "module-bt module" + :style "color: ${bluetooth.color};" + :text {bluetooth.text})) + (button + :class "module-bt module" + :onclick "blueman" + :style "color: ${bluetooth.color};" + {bluetooth.icon})))) diff --git a/users/modules/eww/modules/bright.yuck b/users/modules/eww/modules/bright.yuck new file mode 100644 index 0000000..9527e12 --- /dev/null +++ b/users/modules/eww/modules/bright.yuck @@ -0,0 +1,21 @@ +(defwidget bright [] + (eventbox + :onhover "${EWW_CMD} update bright_reveal=true" + :onhoverlost "${EWW_CMD} update bright_reveal=false" + (box + :class "module" + :space-evenly "false" + :spacing "3" + (revealer + :transition "slideleft" + :reveal bright_reveal + :duration "350ms" + (scale + :class "brightbar" + :value {brightness.level} + :tooltip "${brightness.level}%" + :onchange "light -S {}")) + (label + :text {brightness.icon} + :class "bright-icon" + :tooltip "brightness ${brightness.level}%")))) diff --git a/users/modules/eww/modules/clock.yuck b/users/modules/eww/modules/clock.yuck new file mode 100644 index 0000000..51eb290 --- /dev/null +++ b/users/modules/eww/modules/clock.yuck @@ -0,0 +1,25 @@ +(defwidget clock_module [] + (eventbox + :onhover "${EWW_CMD} update time_rev=true" + :onhoverlost "${EWW_CMD} update time_rev=false" + (box + :space-evenly "false" + :spacing "3" + :class "module" + (label + :text {time.hour} + :class "clock-time-class") + (label + :text ":" + :class "clock-time-sep") + (label + :text {time.minute} + :class "clock-minute-class") + (revealer + :transition "slideleft" + :reveal time_rev + :duration "350ms" + (button + :class "clock-date-class module" + :onclick "./scripts/pop calendar" + {time.date}))))) diff --git a/users/modules/eww/modules/cpu.yuck b/users/modules/eww/modules/cpu.yuck new file mode 100644 index 0000000..600d9eb --- /dev/null +++ b/users/modules/eww/modules/cpu.yuck @@ -0,0 +1,9 @@ +(defwidget cpu [] + (circular-progress + :value "${EWW_CPU.avg}" + :class "cpubar module" + :thickness 3 + (button + :tooltip "using ${round(EWW_CPU.avg,0)}% cpu" + :onclick "./scripts/pop system" + (label :class "icon-text" :text "")))) diff --git a/users/modules/eww/modules/mem.yuck b/users/modules/eww/modules/mem.yuck new file mode 100644 index 0000000..0640fa9 --- /dev/null +++ b/users/modules/eww/modules/mem.yuck @@ -0,0 +1,9 @@ +(defwidget mem [] + (circular-progress + :value {memory.percentage} + :class "membar module" + :thickness 3 + (button + :tooltip "using ${round(memory.percentage,0)}% ram" + :onclick "./scripts/pop system" + (label :class "icon-text" :text "")))) diff --git a/users/modules/eww/modules/music.yuck b/users/modules/eww/modules/music.yuck new file mode 100644 index 0000000..9086d1e --- /dev/null +++ b/users/modules/eww/modules/music.yuck @@ -0,0 +1,22 @@ +(defwidget music [] + (eventbox + :onhover "${EWW_CMD} update music_reveal=true" + :onhoverlost "${EWW_CMD} update music_reveal=false" + (box + :class "module" + :space-evenly "false" + (box + :class "song-cover-art" + :style "background-image: url(\"${cover_art}\");") + (button + :class "module" + :onclick "./scripts/pop music" + song_title) + (revealer + :transition "slideright" + :reveal music_reveal + :duration "350ms" + (box + (button :class "song-button" :onclick "playerctl previous" "") + (button :class "song-button" :onclick "playerctl play-pause" song_status) + (button :class "song-button" :onclick "playerctl next" "")))))) diff --git a/users/modules/eww/modules/net.yuck b/users/modules/eww/modules/net.yuck new file mode 100644 index 0000000..f100ca8 --- /dev/null +++ b/users/modules/eww/modules/net.yuck @@ -0,0 +1,19 @@ +(defwidget net [] + (eventbox + :onhover "${EWW_CMD} update net_rev=true" + :onhoverlost "${EWW_CMD} update net_rev=false" + (box + :space-evenly "false" + (revealer + :transition "slideright" + :reveal net_rev + :duration "350ms" + (label + :class "module-ssid module" + :style "color: ${net.color};" + :text {net.essid})) + (button + :class "module-net module" + :onclick "networkmanager_dmenu" + :style "color: ${net.color};" + {net.icon})))) diff --git a/users/modules/eww/modules/variables.yuck b/users/modules/eww/modules/variables.yuck new file mode 100644 index 0000000..ac200f0 --- /dev/null +++ b/users/modules/eww/modules/variables.yuck @@ -0,0 +1,26 @@ +(defvar bright_reveal false) +(defvar bt_rev false) +(defvar music_reveal false) +(defvar net_rev false) +(defvar time_rev false) +(defvar vol_reveal false) + +(defpoll time :interval "5s" `date +'{"date": "%d/%m", "hour": "%H", "minute": "%M"}'`) + +(deflisten battery "scripts/battery") +(deflisten bluetooth "scripts/bluetooth") +(deflisten brightness "scripts/brightness") +(deflisten memory "scripts/memory") +(deflisten net "scripts/net") +(deflisten volume "scripts/volume") + +(deflisten song_artist "playerctl -F metadata artist || true") +(deflisten song_title "playerctl -F metadata title || true") +(deflisten cover_art :initial "images/music.png" "scripts/music cover") +(deflisten song_status :initial "" "scripts/music status") + +(deflisten song_length "scripts/music length_time") +(deflisten song_pos :initial "0" "scripts/music position_time") +(deflisten song_pos_perc :initial "0" "scripts/music position") + +(deflisten workspace "scripts/workspaces") diff --git a/users/modules/eww/modules/volume.yuck b/users/modules/eww/modules/volume.yuck new file mode 100644 index 0000000..5cd77ec --- /dev/null +++ b/users/modules/eww/modules/volume.yuck @@ -0,0 +1,23 @@ +(defwidget volume [] + (eventbox + :onhover "${EWW_CMD} update vol_reveal=true" + :onhoverlost "${EWW_CMD} update vol_reveal=false" + (box + :class "module" + :space-evenly "false" + :spacing "3" + (revealer + :transition "slideright" + :reveal vol_reveal + :duration "350ms" + (scale + :class "volbar" + :value {volume.percent} + :tooltip "${volume.percent}%" + :max 100 + :min 0 + :onchange "./scripts/volume setvol SINK {}")) + (button + :onclick "./scripts/pop volume" + :class "vol-icon" + {volume.icon})))) diff --git a/users/modules/eww/scripts/battery b/users/modules/eww/scripts/battery new file mode 100755 index 0000000..7783377 --- /dev/null +++ b/users/modules/eww/scripts/battery @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +status() { + if [ "$STATE" = "Charging" ]; then + echo -n "charging" + + if [ "$RATE" -gt 0 ]; then + echo ", $(gettime) left" + else + echo "" + fi + elif [ "$STATE" = "Discharging" ]; then + echo "$(gettime)h left" + else + echo "fully charged" + fi +} + +color() { + if [ "$CAPACITY" -le 20 ]; then + echo '#f38ba8' + else + echo '#a6e3a1' + fi +} + +wattage() { + echo "$(bc -l <<< "scale=1; $RATE / 1000000") W" +} + +gettime() { + FULL=$(cat /sys/class/power_supply/BAT0/energy_full) + NOW=$(cat /sys/class/power_supply/BAT0/energy_now) + + if [ "$RATE" -gt 0 ]; then + if [ "$STATE" = "Discharging" ]; then + EX="$NOW / $RATE" + else + EX="($FULL - $NOW) / $RATE" + fi + date -u -d@$(bc -l <<< "$EX * 3600") +%H:%M + fi +} + +while true; do + RATE=$(cat /sys/class/power_supply/BAT0/power_now) + CAPACITY=$(cat /sys/class/power_supply/BAT0/capacity) + STATE=$(cat /sys/class/power_supply/BAT0/status) + + echo '{ "percentage": '"$CAPACITY"', "wattage": "'"$(wattage)"'", "status": "'"$(status)"'", "color": "'"$(color)"'" }' + sleep 3 +done \ No newline at end of file diff --git a/users/modules/eww/scripts/bluetooth b/users/modules/eww/scripts/bluetooth new file mode 100755 index 0000000..3f6e0c0 --- /dev/null +++ b/users/modules/eww/scripts/bluetooth @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +declare -A baticon=([10]="󰁺" [20]="󰁻" [30]="󰁼" [40]="󰁽" [50]="󰁾" [60]="󰁿" [70]="󰂀" [80]="󰂁" [90]="󰂂" [100]="󰁹") + +while true; do + powered=$(bluetoothctl show | rg Powered | cut -f 2- -d ' ') + status=$(bluetoothctl info) + battery=$(echo "$status" | tail -1 | awk '{print $4 }' | tr -d '()') + name=$(echo "$status" | rg Name | cut -f 2- -d ' ') + + if [ "$powered" = "yes" ]; then + if [ "$status" != "Missing device address argument" ]; then + if [ "$battery" -le 100 ] && [ "$battery" -ge 0 ]; then + text="$name ${baticon[$battery]}" + else + text="$name" + fi + + icon="" + color="#b4befe" + else + icon="" + text="Disconnected" + color="#45475a" + fi + else + icon="" + text="Bluetooth off" + color="#45475a" + fi + + echo '{ "icon": "'"$icon"'", "text": "'"$text"'", "color": "'"$color"'" }' + + sleep 3 +done diff --git a/users/modules/eww/scripts/brightness b/users/modules/eww/scripts/brightness new file mode 100755 index 0000000..93002dd --- /dev/null +++ b/users/modules/eww/scripts/brightness @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +icons=("" "" "") + +# initial +icon=${icons[$(awk -v n="$(light)" 'BEGIN{print int(n/34)}')]} +echo '{ "level": '"$(light)"', "icon": "'"$icon"'" }' + +udevadm monitor | rg --line-buffered "backlight" | while read -r _; do + icon="${icons[$(awk -v n="$(light)" 'BEGIN{print int(n/34)}')]}" + + echo '{ "level": '"$(light)"', "icon": "'"$icon"'" }' +done diff --git a/users/modules/eww/scripts/memory b/users/modules/eww/scripts/memory new file mode 100755 index 0000000..749fc4a --- /dev/null +++ b/users/modules/eww/scripts/memory @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +while true; do + # human-readable + freeH=$(free -h --si | rg "Mem:") + # non-human-readable + freeN=$(free --mega | rg "Mem:") + + total="$(echo $freeH | awk '{ print $2 }')" + used="$(echo $freeH | awk '{ print $3 }')" + t="$(echo $freeN | awk '{ print $2 }')" + u="$(echo $freeN | awk '{ print $3 }')" + + free=$(printf '%.1fG' "$(bc -l <<< "($t - $u) / 1000")") + perc=$(printf '%.1f' "$(free -m | rg Mem | awk '{print ($3/$2)*100}')") + + echo '{ "total": "'"$total"'", "used": "'"$used"'", "free": "'"$free"'", "percentage": '"$perc"' }' + + sleep 3 +done diff --git a/users/modules/eww/scripts/music b/users/modules/eww/scripts/music new file mode 100755 index 0000000..970dc28 --- /dev/null +++ b/users/modules/eww/scripts/music @@ -0,0 +1,89 @@ +#!/usr/bin/env bash + +get_status() { + playerctl -F status | while read -r s; do + if [ "$s" = "Playing" ]; then + echo "" + else + echo "" + fi + done +} + +get_length_sec() { + playerctl -F metadata mpris:length | while read -r len; do + if [ -z "$len" ]; then + echo 0 + else + bc <<< "$len / 1000000" + fi + done +} + +get_length_time() { + playerctl -F metadata mpris:length | while read -r len; do + if [ -n "$len" ]; then + len=$(bc <<< "$len / 1000000") + date -d@"$len" +%M:%S + else + echo "" + fi + done +} + +get_position() { + playerctl -F metadata -f '{{position}} {{mpris:length}}' 2>/dev/null | while read -r pos len; do + if [ -n "$pos" ]; then + bc -l <<< "$pos / $len * 100" + else + echo 0 + fi + done +} + +get_position_time() { + playerctl -F metadata -f '{{position}} {{mpris:length}}' 2>/dev/null | while read -r pos len; do + if [ -n "$pos" ]; then + date -d@"$(bc -l <<< "$pos / 1000000")" +%M:%S + else + echo 0 + fi + done +} + +get_cover() { + mkdir -p "$XDG_CACHE_HOME/eww_covers" + cd "$XDG_CACHE_HOME/eww_covers" || exit + + IMGPATH="$XDG_CACHE_HOME/eww_covers/cover_art.png" + + playerctl -F metadata mpris:artUrl | while read -r COVER_URL; do + if [[ "$COVER_URL" = https* ]]; then + wget -N "$COVER_URL" -o /dev/null + + rm "$IMGPATH" + ln -s "$(basename "$COVER_URL")" "$IMGPATH" + + echo "$IMGPATH" + elif [ "$COVER_URL" = "" ]; then + echo "images/music.png" + else + echo "$COVER_URL" + fi + done +} + +## Execute accordingly +if [ "$1" = "status" ]; then + get_status +elif [ "$1" = "length" ]; then + get_length_sec +elif [ "$1" = "length_time" ]; then + get_length_time +elif [ "$1" = "position" ]; then + get_position +elif [ "$1" = "position_time" ]; then + get_position_time +elif [ "$1" = "cover" ]; then + get_cover +fi diff --git a/users/modules/eww/scripts/net b/users/modules/eww/scripts/net new file mode 100755 index 0000000..530c0b4 --- /dev/null +++ b/users/modules/eww/scripts/net @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +while true; do + status=$(nmcli g | tail -n 1 | awk '{print $1}') + signal=$(nmcli dev wifi | rg "\*" | awk '{ print $8 }') + essid=$(nmcli -t -f NAME connection show --active | head -n1) + + icons=("󰤯" "󰤟" "󰤢" "󰤥" "󰤨") + + if [ "$status" = "disconnected" ] ; then + icon="" + text="" + color="#988ba2" + else + level=$(awk -v n="$signal" 'BEGIN{print int(n/20)}') + if [ "$level" -gt 4 ]; then + level=4 + fi + + icon=${icons[$level]} + color="#cba6f7" + fi + + echo '{ "essid": "'"$essid"'", "icon": "'"$icon"'", "color": "'"$color"'" }' + + sleep 3 +done \ No newline at end of file diff --git a/users/modules/eww/scripts/pop b/users/modules/eww/scripts/pop new file mode 100755 index 0000000..32ae3e0 --- /dev/null +++ b/users/modules/eww/scripts/pop @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +window() { +NAME=$1 +LOCK_FILE="$XDG_CACHE_HOME/eww_${NAME}.lock" + +if [ ! -f "$LOCK_FILE" ]; then + eww open "${NAME}_win" + touch "$LOCK_FILE" + echo "opened $NAME" +else + eww close "${NAME}_win" + rm "$LOCK_FILE" + echo "closed $NAME" +fi +} + +window "$1" diff --git a/users/modules/eww/scripts/volume b/users/modules/eww/scripts/volume new file mode 100755 index 0000000..7e739a4 --- /dev/null +++ b/users/modules/eww/scripts/volume @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +volicons=("󰕿" "󰖀" "󰕾") + +vol() { + wpctl get-volume @DEFAULT_AUDIO_"$1"@ | awk '{print int($2*100)}' +} +ismuted() { + wpctl get-volume @DEFAULT_AUDIO_"$1"@ | rg -i muted + echo $? +} +setvol() { + wpctl set-volume @DEFAULT_AUDIO_"$1"@ "$(awk -v n="$2" 'BEGIN{print (n / 100)}')" +} +setmute() { + wpctl set-mute @DEFAULT_AUDIO_"$1"@ toggle +} + +if [ "$1" = "mute" ]; then + if [ "$2" != "SOURCE" ] && [ "$2" != "SINK" ]; then + echo "Can only mute SINK or SOURCE"; exit 1 + fi + setmute "$2" +elif [ "$1" = "setvol" ]; then + if [ "$2" != "SOURCE" ] && [ "$2" != "SINK" ]; then + echo "Can only set volume for SINK or SOURCE"; exit 1 + elif [ "$3" -lt 1 ] || [ "$3" -gt 100 ]; then + echo "Volume must be between 1 and 100"; exit 1 + fi + setvol "$2" "$3" +else + # initial values + lvl=$(awk -v n="$(vol "SINK")" 'BEGIN{print int(n/34)}') + ismuted=$(ismuted "SINK") + + if [ "$ismuted" = 1 ]; then + icon="${volicons[$lvl]}" + else + icon="" + fi + echo '{ "icon": "'"$icon"'", "percent": "'"$(vol "SINK")"'", "microphone": "'"$(vol "SOURCE")"'" }' + + # event loop + pactl subscribe | rg --line-buffered "change" | while read -r _; do + lvl=$(awk -v n="$(vol "SINK")" 'BEGIN{print int(n/34)}') + ismuted=$(ismuted "SINK") + + if [ "$ismuted" = 1 ]; then + icon="${volicons[$lvl]}" + else + icon="" + fi + echo '{ "icon": "'"$icon"'", "percent": "'"$(vol "SINK")"'", "microphone": "'"$(vol "SOURCE")"'" }' + done +fi diff --git a/users/modules/eww/scripts/workspaces b/users/modules/eww/scripts/workspaces new file mode 100755 index 0000000..0269489 --- /dev/null +++ b/users/modules/eww/scripts/workspaces @@ -0,0 +1,79 @@ +#!/usr/bin/env bash + +colors=("#f38ba8" "#a6e3a1" "#89b4fa" "#fab387") +dimmed=("#794554" "#537150" "#445a7d" "#7d5943") +empty="#302d41" + +focusedws=1 + +declare -A o=([1]=0 [2]=0 [3]=0 [4]=0 [5]=0 [6]=0 [7]=0 [8]=0 [9]=0 [10]=0) +declare -A monitormap +declare -A workspaces + +# sets color +status() { + if [ "${o[$1]}" -eq 1 ]; then + mon=${monitormap[${workspaces[$1]}]} + + if [ $focusedws -eq "$1" ]; then + echo -n "color: ${colors[$mon]};" + else + echo -n "color: ${dimmed[$mon]};" + fi + else + echo -n "color: $empty;" + fi +} + +# handles workspace create/destroy +workspace_event() { + o[$1]=$2 + while read -r k v; do workspaces[$k]="$v"; done < <(hyprctl -j workspaces | jq -r '.[]|"\(.id) \(.monitor)"') +} +# handles monitor (dis)connects +monitor_event() { + while read -r k v; do monitormap["$k"]=$v; done < <(hyprctl -j monitors | jq -r '.[]|"\(.name) \(.id) "') +} + +# generates the eww widget +generate() { + echo -n '(eventbox :onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace" (box :orientation "h" :class "module" :spacing 5 :space-evenly "true" ' + for i in {1..10}; do + echo -n "(button :onclick \"hyprctl dispatch workspace $i\" :class \"ws\" :style \"$(status "$i")\" \"●\") " + done + echo '))' +} + +# setup +# add monitors +monitor_event +# add workspaces +workspace_event 1 1 +# check occupied workspaces +for num in "${!workspaces[@]}"; do + o[$num]=1 +done +# generate initial widget +generate + +# main loop +socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r line; do + case ${line%>>*} in + "workspace") + focusedws=${line#*>>} + ;; + "focusedmon") + focusedws=${line#*,} + ;; + "createworkspace") + workspace_event "${line#*>>}" 1 + ;; + "destroyworkspace") + workspace_event "${line#*>>}" 0 + ;; + "monitor"*) + monitor_event + ;; + esac + generate +done diff --git a/users/modules/eww/windows/calendar.yuck b/users/modules/eww/windows/calendar.yuck new file mode 100644 index 0000000..3a41210 --- /dev/null +++ b/users/modules/eww/windows/calendar.yuck @@ -0,0 +1,13 @@ +(defwidget calendar-win [] + (box + :class "calendar-window" + (calendar))) +(defwindow calendar_win + :monitor 0 + :geometry (geometry + :x "0%" + :y "0%" + :anchor "top right" + :width "0px" + :height "0px") + (calendar-win)) diff --git a/users/modules/eww/windows/music_win.yuck b/users/modules/eww/windows/music_win.yuck new file mode 100644 index 0000000..634c528 --- /dev/null +++ b/users/modules/eww/windows/music_win.yuck @@ -0,0 +1,53 @@ +(defwidget music_window [] + (box + :class "music-window" + (box + :class "music-cover-art" + :style "background-image: url(\"${cover_art}\");") + (box + :orientation "v" + :class "music-box" + (label + :class "music-title" + :limit-width 18 + :text song_title) + (label + :class "music-artist" + :wrap "true" + :limit-width 30 + :text song_artist) + (centerbox + :halign "center" + :class "music-button-box" + (button :class "music-button" :onclick "playerctl previous" "") + (button :class "music-button" :onclick "playerctl play-pause" song_status) + (button :class "music-button" :onclick "playerctl next" "")) + (box + :orientation "v" + (centerbox + (label + :xalign 0 + :class "music-time" + :text song_pos) + (label) + (label + :xalign 1 + :class "music-time" + :text song_length)) + (box + :class "music-bar" + (scale + :onchange "playerctl position `bc <<< \"{} * $(playerctl metadata mpris:length) / 1000000 / 100\"`" + :value song_pos_perc)))))) + +(defwindow music_win + :stacking "fg" + :focusable "false" + :monitor 0 + :geometry (geometry + :x "0%" + :y "0%" + :width "0%" + :height "0%" + :anchor "top center") + (music_window)) diff --git a/users/modules/eww/windows/system.yuck b/users/modules/eww/windows/system.yuck new file mode 100644 index 0000000..7e34619 --- /dev/null +++ b/users/modules/eww/windows/system.yuck @@ -0,0 +1,93 @@ +(defwidget system [] + (box + :class "sys-win" + :orientation "v" + + ; cpu + (box + :class "sys-box" + :space-evenly "false" + :halign "start" + (circular-progress + :value "${EWW_CPU.avg}" + :class "sys-cpu" + :thickness "3" + (label + :text "" + :class "sys-icon-cpu")) + (box + :orientation "v" + :vexpand "false" + (label + :text "cpu" + :halign "start" + :class "sys-text-cpu") + (label + :text "${round(EWW_CPU.avg,2)}%" + :halign "start" + :class "sys-text-sub") + (label + :text "${EWW_CPU.cores[0].freq} MHz" + :halign "start" + :class "sys-text-sub"))) + + ; memory + (box + :class "sys-box" + :space-evenly "false" + :halign "start" + (circular-progress + :value {memory.percentage} + :class "sys-mem" + :thickness "3" + (label + :text "" + :class "sys-icon-mem")) + (box + :orientation "v" + (label + :text "memory" + :halign "start" + :class "sys-text-mem" ) + (label + :text "${memory.used} | ${memory.total}" + :halign "start" + :class "sys-text-sub" ))) + + ; battery + (box + :class "sys-box" + :space-evenly "false" + (circular-progress + :value "${EWW_BATTERY["BAT0"].capacity}" + :class "sys-bat" + :style "color: ${battery.color};" + :thickness 3 + (label + :text "" + :style "color: ${battery.color};" + :class "sys-icon-bat" )) + (box + :orientation "v" + (label + :text "battery" + :halign "start" + :class "sys-text-bat" ) + (label + :text "${EWW_BATTERY["BAT0"].capacity}% | ${battery.wattage}" + :halign "start" + :class "sys-text-sub" ) + (label + :text "${battery.status}" + :halign "start" + :class "sys-text-sub" ))))) + +(defwindow system_win + :monitor 0 + :geometry (geometry + :x "0%" + :y "0%" + :anchor "top right" + :width "0" + :height "0") + (system)) diff --git a/users/modules/eww/windows/volume_win.yuck b/users/modules/eww/windows/volume_win.yuck new file mode 100644 index 0000000..1af972f --- /dev/null +++ b/users/modules/eww/windows/volume_win.yuck @@ -0,0 +1,46 @@ +(defwidget volume_window [] + (box + :class "volume-window" + :orientation "v" + (box + :space-evenly "false" + (label + :class "volume-icon" + :text "") + (box + :orientation "v" + :class "volume-info" + (label + :class "volume-text" + :text "speaker") + (scale + :class "volume-bar" + :value {volume.percent} + :tooltip "volume on ${volume.percent}%" + :onchange "scripts/volume setvol SINK {}"))) + (box + :space-evenly "false" + (label + :class "volume-icon" + :text "") + (box + :orientation "v" + :class "volume-info" + (label + :class "volume-text" + :text "mic") + (scale + :class "volume-bar" + :value {volume.microphone} + :tooltip "mic on ${volume.microphone}%" + :onchange "scripts/volume setvol SOURCE {}"))))) + +(defwindow volume_win + :monitor 0 + :geometry (geometry + :x "0%" + :y "0%" + :anchor "top right" + :width "0" + :height "0") + (volume_window)) diff --git a/users/modules/hyprland/default.nix b/users/modules/hyprland/default.nix index 3afad9c..1be17d7 100644 --- a/users/modules/hyprland/default.nix +++ b/users/modules/hyprland/default.nix @@ -9,7 +9,7 @@ ../swaylock ../wlsunset ./swayidle.nix - "${inputs.fufexan}/home/graphical/eww" + ../eww inputs.hyprland.homeManagerModules.default ]; @@ -35,7 +35,7 @@ ''; in '' # should be configured per-profile - monitor=eDP-1,preferred,auto,1.6 + monitor=eDP-1,preferred,0x0,1.6 monitor=HDMI-A-1,1920x1080@75,auto,1 workspace=eDP-1,1 workspace=HDMI-A-1,2