feat(ags): add nixos-logo icon and move into separate file
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-03-05 19:36:25 -05:00
parent 8bf5eccee0
commit 0c70dbd866
3 changed files with 51 additions and 24 deletions

View file

@ -1,4 +1,4 @@
const { Box, Label } = Widget; const { Box, Icon } = Widget;
import Audio from '../hovers/audio.ts'; import Audio from '../hovers/audio.ts';
import Bluetooth from '../hovers/bluetooth.ts'; import Bluetooth from '../hovers/bluetooth.ts';
@ -70,7 +70,7 @@ export default () => {
...hoverRevealers, ...hoverRevealers,
Label(' '), Icon('nixos-logo-symbolic'),
Separator(SPACING), Separator(SPACING),
], ],

View file

@ -28,30 +28,22 @@ in {
programs.ags.enable = true; programs.ags.enable = true;
home = { home = {
file = { file =
".config/ags".source = symlink /home/${mainUser}/.nix/modules/ags/config; {
".config/ags".source = symlink /home/${mainUser}/.nix/modules/ags/config;
# Icons "${agsConfigDir}/types".source = agsTypes.source;
"${agsConfigDir}/icons/mouse-razer-symbolic.svg".source = pkgs.fetchurl { "${agsConfigDir}/config.js".text =
url = "https://raw.githubusercontent.com/bithatch/razer-icon-font/main/src/devices/mouse.svg"; /*
hash = "sha256-A1+eIp2VEFDyY23GIHKhbnByHXrnVS3QgIJ9sjjtuZw="; javascript
}; */
"${agsConfigDir}/icons/down-large-symbolic.svg".source = pkgs.fetchurl { ''
url = "https://www.svgrepo.com/download/158537/down-chevron.svg"; import { transpileTypeScript } from './js/utils.js';
hash = "sha256-mOfNjgZh0rt6XosKA2kpLY22lJldSS1XCphgrnvZH1s=";
};
"${agsConfigDir}/types".source = agsTypes.source; export default (await transpileTypeScript('${hostName}')).default;
"${agsConfigDir}/config.js".text = '';
/* }
javascript // (import ./icons.nix {inherit pkgs agsConfigDir;});
*/
''
import { transpileTypeScript } from './js/utils.js';
export default (await transpileTypeScript('${hostName}')).default;
'';
};
packages = packages =
[config.customPkgs.coloryou] [config.customPkgs.coloryou]

35
modules/ags/icons.nix Normal file
View file

@ -0,0 +1,35 @@
{
agsConfigDir,
pkgs,
...
}: {
"${agsConfigDir}/icons/mouse-razer-symbolic.svg".source = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/bithatch/razer-icon-font/main/src/devices/mouse.svg";
hash = "sha256-A1+eIp2VEFDyY23GIHKhbnByHXrnVS3QgIJ9sjjtuZw=";
};
"${agsConfigDir}/icons/down-large-symbolic.svg".source = pkgs.fetchurl {
url = "https://www.svgrepo.com/download/158537/down-chevron.svg";
hash = "sha256-mOfNjgZh0rt6XosKA2kpLY22lJldSS1XCphgrnvZH1s=";
};
"${agsConfigDir}/icons/nixos-logo-symbolic.svg".text =
/*
xml
*/
''
<svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<path id="lambda" d="M7.352 1.592l-1.364.002L5.32 2.75l1.557 2.713-3.137-.008-1.32 2.34H14.11l-1.353-2.332-3.192-.006-2.214-3.865z" fill="#000000" />
</defs>
<use xlink:href="#lambda" />
<use xlink:href="#lambda" transform="rotate(120 12 12)" />
<use xlink:href="#lambda" transform="rotate(240 12 12)" />
<g opacity=".7">
<use xlink:href="#lambda" transform="rotate(60 12 12)" />
<use xlink:href="#lambda" transform="rotate(180 12 12)" />
<use xlink:href="#lambda" transform="rotate(300 12 12)" />
</g>
</svg>
'';
}