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

View file

@ -1,21 +1,21 @@
const entry = App.configDir + "/ts/main.ts";
const outdir = "/tmp/ags/js";
import { App, Utils } from "./import.js";
import { Bar } from "./js/main.js";
try {
await Utils.execAsync([
"bun",
"build",
entry,
"--outdir",
outdir,
"--external",
"resource://*",
"--external",
"gi://*"
]);
await import(`file://${outdir}/main.js`);
} catch (error) {
console.error(error);
const scss = App.configDir + "/main.scss";
const css = App.configDir + "/style.css";
Utils.exec(`sass ${scss} ${css}`);
function reloadCss() {
console.log("scss updating");
Utils.exec(`sass ${scss} ${css}`);
App.resetCss();
App.applyCss(css);
}
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",
"version": "0.0.1",
"description": "",
"version": "1.0.0",
"description": "snowflake ags",
"main": "config.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"repository": {
"type": "git",
"url": "https://git.flake.sh/notohh/snowflake"
},
"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;
extraPackages = with pkgs; [libsoup_3 libdbusmenu-gtk3];
};
home.packages = with pkgs; [dart-sass bun];
home.packages = with pkgs; [dart-sass];
xdg.configFile = {
"ags".source = config.lib.file.mkOutOfStoreSymlink "${configDir}";
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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