Compare commits

..

No commits in common. "dac74a6a14d1a4955e502840f10ae4643edf861f" and "81f693ce21464bc21564eea326f0b06cfe843465" have entirely different histories.

32 changed files with 1384 additions and 183 deletions

View file

@ -3,7 +3,7 @@ module.exports = {
browser: true, browser: true,
es2021: true es2021: true
}, },
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], extends: "eslint:recommended",
overrides: [ overrides: [
{ {
env: { env: {
@ -15,11 +15,9 @@ module.exports = {
} }
} }
], ],
parser: "@typescript-eslint/parser",
parserOptions: { parserOptions: {
ecmaVersion: "latest", ecmaVersion: "latest",
sourceType: "module" sourceType: "module"
}, },
plugins: ["@typescript-eslint"],
rules: {} rules: {}
}; };

View file

@ -1,21 +1,21 @@
const entry = App.configDir + "/ts/main.ts"; import { App, Utils } from "./import.js";
const outdir = "/tmp/ags/js"; import { Bar } from "./js/main.js";
try { const scss = App.configDir + "/main.scss";
await Utils.execAsync([ const css = App.configDir + "/style.css";
"bun",
"build", Utils.exec(`sass ${scss} ${css}`);
entry,
"--outdir", function reloadCss() {
outdir, console.log("scss updating");
"--external", Utils.exec(`sass ${scss} ${css}`);
"resource://*", App.resetCss();
"--external", App.applyCss(css);
"gi://*"
]);
await import(`file://${outdir}/main.js`);
} catch (error) {
console.error(error);
} }
export {}; Utils.monitorFile(`${App.configDir}/scss`, reloadCss, "directory");
export default {
style: css,
windows: [Bar(2)]
};

View file

@ -0,0 +1,23 @@
import App from "resource:///com/github/Aylur/ags/app.js";
import * as Utils from "resource:///com/github/Aylur/ags/utils.js";
import Service from "resource:///com/github/Aylur/ags/service.js";
import Variable from "resource:///com/github/Aylur/ags/variable.js";
import Widget from "resource:///com/github/Aylur/ags/widget.js";
import Audio from "resource:///com/github/Aylur/ags/service/audio.js";
import Hyprland from "resource:///com/github/Aylur/ags/service/hyprland.js";
import Network from "resource:///com/github/Aylur/ags/service/network.js";
import SystemTray from "resource:///com/github/Aylur/ags/service/systemtray.js";
import Mpris from "resource:///com/github/Aylur/ags/service/mpris.js";
export {
App,
Audio,
Hyprland,
Mpris,
Network,
Service,
SystemTray,
Utils,
Variable,
Widget
};

View file

@ -0,0 +1,35 @@
import { Widget } from "../import.js";
import { Time } from "./widgets/time.js";
import { nixosLogo } from "./widgets/images/image.js";
import { Media } from "./widgets/music.js";
import { Workspaces } from "./widgets/hyprland.js";
const Start = () =>
Widget.Box({
hpack: "start",
children: [nixosLogo(), Workspaces()]
});
const Center = () =>
Widget.Box({
children: [Media()]
});
const End = () =>
Widget.Box({
hpack: "end",
children: [Time()]
});
const Bar = (monitor) =>
Widget.Window({
monitor,
name: `bar`,
anchor: ["top", "left", "right"],
exclusivity: "exclusive",
child: Widget.CenterBox({
startWidget: Start(),
centerWidget: Center(),
endWidget: End()
})
});
export { Bar };

View file

@ -0,0 +1,19 @@
import { Hyprland, Widget } from "../../import.js";
const Workspaces = () =>
Widget.Box({
class_name: "workspaces",
children: Hyprland.bind("workspaces").transform((ws) => {
return ws.map(({ id }) =>
Widget.Button({
on_clicked: () => Hyprland.sendMessage(`dispatch workspace ${id}`),
child: Widget.Label(`${id}`),
class_name: Hyprland.active.workspace
.bind("id")
.transform((i) => `${i === id ? "focused" : ""}`)
})
);
})
});
export { Workspaces };

View file

@ -0,0 +1,8 @@
import { Widget } from "../../../import.js";
const nixosLogo = () =>
Widget.Icon({
icon: "/home/notoh/snowflake/home/programs/ags/config/js/widgets/images/static/nixos.png"
});
export { nixosLogo };

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View file

@ -0,0 +1,20 @@
import { Mpris, Widget } from "../../import.js";
const Media = () =>
Widget.Box({
class_name: "media",
child: Widget.Label("-").hook(
Mpris,
(self) => {
if (Mpris.players[0]) {
const { track_artists, track_title } = Mpris.players[0];
self.label = `${track_artists.join(", ")} - ${track_title}`;
} else {
self.label = "Nothing is playing";
}
},
"player-changed"
)
});
export { Media };

View file

@ -0,0 +1,14 @@
import { Utils, Widget } from "../../import.js";
const Time = () =>
Widget.Box({
child: Widget.Label({
className: "date"
}).poll(1000, (self) =>
Utils.execAsync(["date", "+%a %b %d %H:%M"]).then(
(time) => (self.label = time)
)
)
});
export { Time };

View file

@ -0,0 +1,12 @@
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"target": "ES2020",
"jsx": "react",
"allowImportingTsExtensions": true,
"strictNullChecks": true,
"strictFunctionTypes": true
},
"exclude": ["node_modules", "**/node_modules/*"]
}

View file

@ -1 +1,9 @@
@import "./style/main.scss"; @import "scss/bar.scss";
@import "scss/general.scss";
@import "scss/widgets.scss";
* {
all: unset;
margin: 3px;
font-family: "Monaspace Krypton";
}

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,15 @@
{ {
"name": "snowflake-ags", "name": "snowflake-ags",
"version": "0.0.1", "version": "1.0.0",
"description": "", "description": "snowflake ags",
"main": "config.js", "main": "config.js",
"scripts": { "repository": {
"test": "echo \"Error: no test specified\" && exit 1" "type": "git",
"url": "https://git.flake.sh/notohh/snowflake"
}, },
"author": "notohh", "author": "notohh",
"license": "MIT" "license": "MIT",
"devDependencies": {
"eslint": "^8.56.0"
}
} }

View file

@ -0,0 +1,5 @@
@import "colors.scss";
window {
background-color: $background;
}

View file

@ -0,0 +1,24 @@
/* tokyonight */
$red: #f7768e;
$orange: #ff9e64;
$yellow: #e0af68;
$light-green: #9ece6a;
$green: #73daca;
$turquoise: #89ddff;
$light-cyan: #b4f9f8;
$teal: #2ac3de;
$cyan: #7dcfff;
$blue: #7aa2f7;
$magenta: #bb9af7;
$white: #c0caf5;
$light-gray: #9aa5ce;
$parameters: #cfc9c2;
$comment: #565f89;
$black: #414868;
$foreground: #a9b1d6;
$foreground-highlight: #c0caf5;
$foreground-gutter: #363b54;
$background: #1a1b26;
$background-highlight: #30374b;
$background-menu: #16161e;

View file

@ -0,0 +1,21 @@
@import "colors.scss";
@mixin widget {
color: $white;
}
.date {
@include widget();
}
.workspaces {
@include widget();
}
.media {
@include widget();
}
image {
font-size: 24px;
}

View file

@ -1,7 +0,0 @@
* {
all: unset;
}
window {
background: black;
}

View file

@ -1,48 +0,0 @@
const scss = App.configDir + "/main.scss";
const css = App.configDir + "/style.css";
const time = Variable("", {
poll: [
1000,
function () {
return Date().toString();
}
]
});
Utils.monitorFile(
`${App.configDir}/style`,
function () {
const scss = `${App.configDir}/main.scss`;
const css = `./style.css`;
Utils.exec(`sass ${scss} ${css}`);
App.resetCss();
App.applyCss(css);
}
);
const Bar = (monitor: number) =>
Widget.Window({
monitor,
name: `bar${monitor}`,
anchor: ["top", "left", "right"],
exclusivity: "exclusive",
child: Widget.CenterBox({
start_widget: Widget.Label({
hpack: "center",
label: "Welcome to AGS!"
}),
end_widget: Widget.Label({
hpack: "center",
label: time.bind()
})
})
});
App.config({
style: css,
windows: [Bar(2)]
});

View file

@ -1,14 +0,0 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"lib": ["ES2022"],
"allowJs": true,
"checkJs": true,
"strict": true,
"noImplicitAny": false,
"baseUrl": ".",
"typeRoots": ["./types"],
"skipLibCheck": true
}
}

View file

@ -1 +0,0 @@
/home/notoh/.local/share/com.github.Aylur.ags/types

View file

@ -9,7 +9,7 @@ in {
enable = true; enable = true;
extraPackages = with pkgs; [libsoup_3 libdbusmenu-gtk3]; extraPackages = with pkgs; [libsoup_3 libdbusmenu-gtk3];
}; };
home.packages = with pkgs; [dart-sass bun]; home.packages = with pkgs; [dart-sass];
xdg.configFile = { xdg.configFile = {
"ags".source = config.lib.file.mkOutOfStoreSymlink "${configDir}"; "ags".source = config.lib.file.mkOutOfStoreSymlink "${configDir}";
}; };

View file

@ -1,7 +1,7 @@
* { * {
all: unset; all: unset;
transition: 200ms ease-out; transition: 200ms ease-out;
color: #c0caf5; color: #cdd6f4;
font-family: JetBrainsMono NF Medium; font-family: JetBrainsMono NF Medium;
font-size: 1.1rem; font-size: 1.1rem;
} }
@ -18,15 +18,11 @@
margin-top: 0.5rem; margin-top: 0.5rem;
} }
#match {
padding: 3px;
border-radius: 12px;
}
#match:hover, #match:hover,
#match:selected { #match:selected {
background: #45475a; background: #45475a;
padding: 0.6rem; border-radius: 5px;
padding: 0.4rem
} }
entry#entry { entry#entry {
@ -35,8 +31,8 @@ entry#entry {
} }
box#main { box#main {
background: #1a1b26; background: #1e1e2e;
border: 3px solid #f7768e; border: 3px solid #f5c2e7;
border-radius: 10px; border-radius: 12px;
padding: 0.3rem; padding: 0.3rem;
} }

View file

@ -5,10 +5,10 @@ _: {
windowSize = "normal"; windowSize = "normal";
gui.theme = { gui.theme = {
lightTheme = false; lightTheme = false;
activeBorderColor = ["#c0caf5" "bold"]; activeBorderColor = ["#2ac3de" "bold"];
inactiveBorderColor = ["#f7768e"]; inactiveBorderColor = ["#f7768e"];
optionsTextColor = ["#f7768e"]; optionsTextColor = [" #c0caf5"];
selectedLineBgColor = ["#565f89"]; selectedLineBgColor = ["#24283b"];
selectedRangeByColor = ["#24283b"]; selectedRangeByColor = ["#24283b"];
cherryPickedCommitBgColor = ["#94e2d5"]; cherryPickedCommitBgColor = ["#94e2d5"];
cherryPickedCommitFgColor = ["#89b4fa"]; cherryPickedCommitFgColor = ["#89b4fa"];

View file

@ -45,7 +45,7 @@
]; ];
character = { character = {
error_symbol = "[](bold red)"; error_symbol = "[](bold red)";
success_symbol = "[](bold white)"; success_symbol = "[](bold teal)";
}; };
username = { username = {
show_always = false; show_always = false;
@ -63,7 +63,7 @@
truncation_length = 3; truncation_length = 3;
truncation_symbol = "/"; truncation_symbol = "/";
read_only = "🔒"; read_only = "🔒";
style = "red"; style = "teal";
home_symbol = ""; home_symbol = "";
}; };
directory.substitutions = { directory.substitutions = {
@ -77,16 +77,14 @@
impure_msg = "[impure shell](bold red)"; impure_msg = "[impure shell](bold red)";
pure_msg = "[pure shell](bold green)"; pure_msg = "[pure shell](bold green)";
unknown_msg = "[unknown shell](bold yellow)"; unknown_msg = "[unknown shell](bold yellow)";
format = "[$state( \($name\))](bold white)"; format = "via [ $state( \($name\))](bold teal)";
}; };
git_branch = { git_branch = {
symbol = ""; symbol = "";
format = "[$symbol $branch ]($style)"; format = "[$symbol $branch ]($style)";
style = "white";
}; };
git_status = { git_status = {
format = "[$all_status$ahead_behind ]($style)"; format = "[$all_status$ahead_behind ]($style)";
style = "red";
}; };
golang = { golang = {
symbol = " "; symbol = " ";

View file

@ -25,8 +25,8 @@
gaps_in = 10; gaps_in = 10;
gaps_out = 20; gaps_out = 20;
border_size = 4; border_size = 4;
"col.active_border" = "rgb(f7768e) rgb(c0caf5)"; "col.active_border" = "rgb(f7768e) rgb(2ac3de)";
"col.inactive_border" = "rgb(24283b)"; "col.inactive_border" = "rgb(313244)";
layout = "dwindle"; layout = "dwindle";
}; };

View file

@ -2,36 +2,23 @@ _: {
programs.hyprlock = { programs.hyprlock = {
enable = true; enable = true;
backgrounds = let backgrounds = let
verticalWallpaper = "/home/notoh/Pictures/wallpapers/sparkle.png"; wallpaperPath = "/home/notoh/Pictures/wallpapers/cweam.png";
horizontalWallpaper = "/home/notoh/Pictures/wallpapers/sparkle2.png";
in [ in [
{
monitor = "HDMI-A-1";
path = verticalWallpaper;
blur_passes = 3;
blur_size = 4;
brightness = 0.5;
}
{ {
monitor = "DP-1"; monitor = "DP-1";
path = verticalWallpaper; path = wallpaperPath;
blur_passes = 3;
blur_size = 4;
brightness = 0.5;
} }
{ {
monitor = "DP-2"; monitor = "DP-2";
path = horizontalWallpaper; path = wallpaperPath;
blur_passes = 3;
blur_size = 4;
brightness = 0.5;
} }
{ {
monitor = "DP-3"; monitor = "DP-3";
path = horizontalWallpaper; path = wallpaperPath;
blur_passes = 3; }
blur_size = 4; {
brightness = 0.5; monitor = "HDMI-A-1";
path = wallpaperPath;
} }
]; ];
general = { general = {
@ -44,57 +31,40 @@ _: {
{ {
monitor = "DP-2"; monitor = "DP-2";
size = { size = {
width = 350; width = 300;
height = 50; height = 50;
}; };
outline_thickness = 2; outline_thickness = 2;
outer_color = "rgb(f7768e)";
inner_color = "rgb(1a1b26)"; outer_color = "rgb(f5c2e7)";
font_color = "rgb(c0caf5)"; inner_color = "rgb(1e1e2e)";
fail_color = "rgb(f7768e)"; font_color = "rgb(cdd6f4)";
fail_text = "<i>$FAIL <b>($ATTEMPTS)</b></i>";
check_color = "rgb(ff9e64)";
swap_font_color = false;
placeholder_text = '' placeholder_text = ''
<i><span foreground="##c0caf5">Password...</span></i> <span foreground="##cdd6f4">Password...</span>
''; '';
fade_on_empty = false; fade_on_empty = false;
dots_spacing = 0.5; dots_spacing = 0.3;
dots_center = true; dots_center = true;
shadow_passes = 3;
shadow_size = 1;
shadow_color = "rgba(00000099)";
shadow_boost = 1.0;
} }
]; ];
labels = [ labels = [
{ {
monitor = "DP-2"; monitor = "DP-2";
text = '' text = "Hi, $USER";
Hi, <i><span foreground="##f7768e">$USER</span></i> color = "rgb(1e1e2e)";
'';
color = "rgb(c0caf5)";
valign = "center"; valign = "center";
halign = "center"; halign = "center";
shadow_passes = 3;
shadow_size = 1;
shadow_color = "rgba(00000099)";
shadow_boost = 1.0;
} }
{ {
monitor = "DP-2"; monitor = "DP-2";
text = "$TIME"; text = "$TIME";
color = "rgb(c0caf5)"; color = "rgb(1e1e2e)";
position = { position = {
x = 0; x = 0;
y = 120; y = 120;
}; };
valign = "center"; valign = "center";
halign = "center"; halign = "center";
shadow_passes = 3;
shadow_size = 1;
shadow_color = "rgba(00000099)";
shadow_boost = 0.6;
} }
]; ];
}; };

View file

@ -11,11 +11,11 @@
beforeSleepCmd = "${pkgs.systemd}/bin/loginctl lock-session"; beforeSleepCmd = "${pkgs.systemd}/bin/loginctl lock-session";
listeners = [ listeners = [
{ {
timeout = 400; timeout = 500;
onTimeout = "${lib.getExe config.programs.hyprlock.package}"; onTimeout = "${lib.getExe config.programs.hyprlock.package}";
} }
{ {
timeout = 460; timeout = 560;
onTimeout = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off"; onTimeout = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off";
onResume = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on"; onResume = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on";
} }

View file

@ -3,15 +3,12 @@ _: {
enable = true; enable = true;
ipc = true; ipc = true;
splash = false; splash = false;
preloads = [ preloads = ["~/Pictures/wallpapers/frieren.png"];
"~/Pictures/wallpapers/sparkle.png"
"~/Pictures/wallpapers/sparkle2.png"
];
wallpapers = [ wallpapers = [
"HDMI-A-1,~/Pictures/wallpapers/sparkle.png" "HDMI-A-1,~/Pictures/wallpapers/frieren.png"
"DP-1,~/Pictures/wallpapers/sparkle.png" "DP-1,~/Pictures/wallpapers/frieren.png"
"DP-2,~/Pictures/wallpapers/sparkle2.png" "DP-2,~/Pictures/wallpapers/frieren.png"
"DP-3,~/Pictures/wallpapers/sparkle2.png" "DP-3,~/Pictures/wallpapers/frieren.png"
]; ];
}; };
} }

View file

@ -20,16 +20,13 @@
headerStyle = "boxedWidgets"; headerStyle = "boxedWidgets";
disableCollape = true; disableCollape = true;
favicon = "https://em-content.zobj.net/source/twitter/376/cloud_2601-fe0f.png"; favicon = "https://em-content.zobj.net/source/twitter/376/cloud_2601-fe0f.png";
background = "https://i.imgur.com/uU6Jbum.jpg";
cardBlur = "md"; cardBlur = "md";
theme = "dark"; theme = "dark";
color = "gray"; color = "gray";
fiveColumns = true; fiveColumns = true;
statusStyle = "dot"; statusStyle = "dot";
hideVersion = true; hideVersion = true;
background = {
image = "https://i.imgur.com/YLX96sC.jpeg";
brightness = 75;
};
providers = { providers = {
openweathermap = "{{HOMEPAGE_VAR_OPENWEATHERMAP}}"; openweathermap = "{{HOMEPAGE_VAR_OPENWEATHERMAP}}";
}; };