feat(ags): get custom icons with fetchurl and append them to icon theme
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-02-26 16:28:54 -05:00
parent 16c76043bd
commit cba58c5b47
8 changed files with 21 additions and 24 deletions

View file

@ -5,6 +5,7 @@ import Bar from './ts/bar/binto.ts';
import { NotifPopups, NotifCenter } from './ts/notifications/binto.ts';
import Powermenu from './ts/powermenu.ts';
App.addIcons(`${App.configDir}/icons`);
// TODO: add OSD, workspace indicator and current window indicator
export default {
@ -12,8 +13,6 @@ export default {
globalThis.Pointers = Pointers;
},
icons: './icons',
windows: [
AppLauncher(),
NotifCenter(),

View file

@ -1,9 +0,0 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 -3 14 14" id="meteor-icon-kit__regular-chevron-down-s" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
<g id="SVGRepo_iconCarrier">
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.70711 0.29289C1.31658 -0.09763 0.68342 -0.09763 0.29289 0.29289C-0.09763 0.68342 -0.09763 1.3166 0.29289 1.7071L6.2929 7.7071C6.6834 8.0976 7.3166 8.0976 7.7071 7.7071L13.7071 1.7071C14.0976 1.3166 14.0976 0.68342 13.7071 0.29289C13.3166 -0.09763 12.6834 -0.09763 12.2929 0.29289L7 5.5858L1.70711 0.29289z" fill="#ffffff"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 879 B

View file

@ -61,7 +61,7 @@ export const BluetoothMenu = () => {
transition: 'slide_down',
child: Icon({
icon: `${App.configDir }/icons/down-large.svg`,
icon: 'down-large-symbolic',
class_name: 'scrolled-indicator',
size: 16,
css: '-gtk-icon-transform: rotate(180deg);',
@ -72,7 +72,7 @@ export const BluetoothMenu = () => {
transition: 'slide_up',
child: Icon({
icon: `${App.configDir }/icons/down-large.svg`,
icon: 'down-large-symbolic',
class_name: 'scrolled-indicator',
size: 16,
}),

View file

@ -162,7 +162,7 @@ const GridButton = ({
},
child: Icon({
icon: `${App.configDir }/icons/down-large.svg`,
icon: 'down-large-symbolic',
class_name: 'grid-chev',
setup: (self) => {

View file

@ -78,7 +78,7 @@ export const NetworkMenu = () => {
transition: 'slide_down',
child: Icon({
icon: `${App.configDir }/icons/down-large.svg`,
icon: 'down-large-symbolic',
class_name: 'scrolled-indicator',
size: 16,
css: '-gtk-icon-transform: rotate(180deg);',
@ -89,7 +89,7 @@ export const NetworkMenu = () => {
transition: 'slide_up',
child: Icon({
icon: `${App.configDir }/icons/down-large.svg`,
icon: 'down-large-symbolic',
class_name: 'scrolled-indicator',
size: 16,
}),

View file

@ -11,7 +11,7 @@ import { RevealerGeneric } from 'global-types';
export default (rev: RevealerGeneric) => {
const child = Icon({
icon: `${App.configDir}/icons/down-large.svg`,
icon: 'down-large-symbolic',
class_name: 'arrow',
css: '-gtk-icon-transform: rotate(180deg);',
});

View file

@ -10,12 +10,11 @@ import OSK from './ts/on-screen-keyboard/main.ts';
import Powermenu from './ts/powermenu.ts';
import QSettings from './ts/quick-settings/main.ts';
App.addIcons(`${App.configDir}/icons`);
Setup();
export default {
icons: './icons',
windows: [
...Corners(),

View file

@ -23,18 +23,26 @@ in {
# https://github.com/Aylur/ags/blob/e1f2d311ceb496a69ef6daa6aebb46ce511b2f22/nix/hm-module.nix#L69
agsTypes = config.home.file.".local//share/com.github.Aylur.ags/types";
agsConfigDir = ".nix/modules/ags/config";
in {
programs.ags.enable = true;
home = {
file = {
".config/ags".source = symlink /home/${mainUser}/.nix/modules/ags/config;
".nix/modules/ags/config/icons/mouse-razer-symbolic.svg".source = pkgs.fetchurl {
# Icons
"${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=";
};
".nix/modules/ags/config/types".source = agsTypes.source;
".nix/modules/ags/config/config.js".text =
"${agsConfigDir}/icons/down-large-symbolic.svg".source = pkgs.fetchurl {
url = "https://www.svgrepo.com/download/158537/down-chevron.svg";
hash = "sha256-mOfNjgZh0rt6XosKA2kpLY22lJldSS1XCphgrnvZH1s=";
};
"${agsConfigDir}/types".source = agsTypes.source;
"${agsConfigDir}/config.js".text =
/*
javascript
*/
@ -72,7 +80,6 @@ in {
]
++ optionals isTouchscreen ["squeekboard"];
bindn = [",Escape, exec, ags run-js 'closeAll()'"];
bind = [
"$mainMod SHIFT, E , exec, ags -t powermenu"
"$mainMod , D , exec, ags -t applauncher"
@ -82,6 +89,7 @@ in {
", XF86MonBrightnessUp, exec, ags -r 'Brightness.screen += 0.05'"
", XF86MonBrightnessDown, exec, ags -r 'Brightness.screen -= 0.05'"
];
bindn = [",Escape, exec, ags run-js 'closeAll()'"];
bindr = ["CAPS, Caps_Lock, exec, ags -r 'Brightness.fetchCapsState()'"];
};
};