This commit is contained in:
flick0
2023-11-02 19:23:50 +00:00
commit 1afec9ef1a
27 changed files with 1400 additions and 0 deletions

9
.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
cover.png
current_wall
argparse
cv2
json
np
os
pywal
subprocess

13
binds.conf Normal file
View File

@@ -0,0 +1,13 @@
$MOD1=SUPER
$MOD2=ALT
bind=$MOD1,1,exec,$THEME/scripts/workspace_switch 1
bind=$MOD1,2,exec,$THEME/scripts/workspace_switch 2
bind=$MOD1,3,exec,$THEME/scripts/workspace_switch 3
bind=$MOD1,4,exec,$THEME/scripts/workspace_switch 4
bind=$MOD1,5,exec,$THEME/scripts/workspace_switch 5
bind=$MOD1,6,exec,$THEME/scripts/workspace_switch 6
bind=$MOD1,7,exec,$THEME/scripts/workspace_switch 7
bind=$MOD1,8,exec,$THEME/scripts/workspace_switch 8
bind=$MOD1,9,exec,$THEME/scripts/workspace_switch 9
bind=$MOD1,0,exec,$THEME/scripts/workspace_switch 10

19
colors Normal file
View File

@@ -0,0 +1,19 @@
0: #1b3c46
1: #9DBAD8
2: #DABAC8
3: #B2C2DE
4: #B4C6E3
5: #D5C7DA
6: #E6C9D5
7: #dedde8
8: #9b9aa2
9: #9DBAD8
10: #DABAC8
11: #B2C2DE
12: #B4C6E3
13: #D5C7DA
14: #E6C9D5
15: #dedde8
background: #1b3c46
foreground: #dedde8
cursor: #dedde8

View File

@@ -0,0 +1,20 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="64.932" height="15.759" viewBox="0 0 64.932 15.759">
<defs>
<style>
.cls-1 {
fill: none;
stroke: #48463d;
stroke-miterlimit: 10;
}
.cls-2 {
fill: #48463d;
}
</style>
</defs>
<line class="cls-1" y1="0.5" x2="64.932" y2="0.5"/>
<rect class="cls-2" x="55.072" y="0.959" width="9.86" height="4.762"/>
<ellipse class="cls-2" cx="23.12" cy="6.041" rx="2.308" ry="2.365"/>
<ellipse class="cls-2" cx="31.809" cy="6.041" rx="2.308" ry="2.365"/>
<ellipse class="cls-2" cx="27.465" cy="13.394" rx="2.308" ry="2.365"/>
</svg>

After

Width:  |  Height:  |  Size: 672 B

View File

@@ -0,0 +1,15 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="367.705" height="234.894" viewBox="0 0 367.705 234.894">
<defs>
<style>
.cls-1 {
fill: #e3dec5;
}
.cls-2 {
fill: #48463d;
}
</style>
</defs>
<path class="cls-1" d="M0,117.447l90.7,90.7,272.151-90.7L90.7,26.747Zm105.983,0a17.3,17.3,0,1,1-17.3-17.3A17.3,17.3,0,0,1,105.983,117.447Z"/>
<rect class="cls-2" x="340.658" y="207.848" width="27.046" height="27.046" transform="translate(132.81 575.553) rotate(-90)"/>
<rect class="cls-2" x="340.658" width="27.046" height="27.046" transform="translate(340.658 367.705) rotate(-90)"/>
</svg>

After

Width:  |  Height:  |  Size: 670 B

View File

@@ -0,0 +1,12 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="367.705" height="234.894" viewBox="0 0 367.705 234.894">
<defs>
<style>
.cls-1 {
fill: #48463d;
}
</style>
</defs>
<path class="cls-1" d="M0,117.447l90.7,90.7,272.151-90.7L90.7,26.747Zm105.983,0a17.3,17.3,0,1,1-17.3-17.3A17.3,17.3,0,0,1,105.983,117.447Z"/>
<rect class="cls-1" x="340.658" y="207.848" width="27.046" height="27.046" transform="translate(132.81 575.553) rotate(-90)"/>
<rect class="cls-1" x="340.658" width="27.046" height="27.046" transform="translate(340.658 367.705) rotate(-90)"/>
</svg>

After

Width:  |  Height:  |  Size: 624 B

101
components/ags/config.js Normal file
View File

@@ -0,0 +1,101 @@
// importing
import {
Hyprland,
Notifications,
Mpris,
Audio,
Battery,
SystemTray,
App,
Widget,
Utils,
Variable,
} from "./imports.js";
import {
NierLongButton,
NierLongButtonGroup,
NierToggle,
} from "./nier/buttons.js";
import { css, scss } from "./util.js";
import { Workspaces } from "./widgets/workspace.js";
Utils.exec(`sassc ${scss} ${css}`);
Utils.subprocess(
[
"inotifywait",
"--recursive",
"--event",
"create,modify",
"-m",
App.configDir + "/style",
],
() => {
Utils.exec(`sassc ${scss} ${css}`);
App.resetCss();
App.applyCss(css);
}
);
// const Workspaces = () =>
// Widget.Box({
// className: "workspaces",
// children: Array.from({ length: 10 }, (_, i) => i + 1).map((i) =>
// Widget.EventBox({
// className: [`${i}`],
// child: NierToggle({
// name: `workspace-${i}`,
// className: [`${i}`],
// label: `${i}`,
// size: 80,
// }),
// onPrimaryClick: (self) => {
// Utils.execAsync(`hyprctl dispatch workspace ${i}`);
// },
// })
// ),
// connections: [
// [
// Hyprland,
// (box) => {
// //loop through children
// for (const element of box.children) {
// console.log(element.className, Hyprland.active.workspace.id);
// if (element.className.includes(`${Hyprland.active.workspace.id}`)) {
// element.child.className = ["nier-toggle-on", "workspace"];
// } else {
// element.child.className = ["nier-toggle-off"];
// }
// }
// },
// ],
// ],
// });
const Bar = ({ monitor } = {}) => {
return Widget.Window({
name: `bar-${monitor}`, // name has to be unique
className: "bar",
monitor,
margin: [50, 50],
anchor: ["top", "left", "right"],
exclusive: true,
layer: "top",
child: Widget.Box({
children: [Workspaces()],
}),
});
};
export default {
style: css,
windows: [
// BottomBar()
Bar(),
// you can call it, for each monitor
// Bar({ monitor: 0 }),
// Bar({ monitor: 1 })
],
};

19
components/ags/imports.js Normal file
View File

@@ -0,0 +1,19 @@
const resource = (file) => `resource:///com/github/Aylur/ags/${file}.js`;
const require = async (file) => (await import(resource(file))).default;
const service = async (file) => await require(`service/${file}`);
export const App = await require("app");
export const Widget = await require("widget");
export const Service = await require("service");
export const Variable = await require("variable");
export const Utils = await import(resource("utils"));
export const Applications = await service("applications");
export const Audio = await service("audio");
export const Battery = await service("battery");
export const Bluetooth = await service("bluetooth");
export const Hyprland = await service("hyprland");
export const Mpris = await service("mpris");
export const Network = await service("network");
export const Notifications = await service("notifications");
export const SystemTray = await service("systemtray");

View File

@@ -0,0 +1,135 @@
import { Widget, App } from "../imports.js";
import { arradd, arrremove } from "../util.js";
const { Button, Label, Overlay, EventBox, Box, Scrollable, Icon } = Widget;
export const NierLongButtonGroup = ({
heading = "",
scrollable = false,
className = [],
buttons = [],
horizontal = false,
min_scale = 200,
...props
}) => {
let inner = Box({
children: [
Box({
className: ["nier-long-button-group-ruler"],
}),
Box({
vertical: !horizontal,
className: [
horizontal
? "nier-long-button-group"
: "nier-long-button-group-vertical",
...className,
],
children: [...buttons],
}),
],
...props,
});
if (scrollable) {
return Scrollable({
hscroll: horizontal ? "always" : "never",
vscroll: horizontal ? "never" : "always",
style: `${horizontal ? "min-width" : "min-height"}: ${min_scale}px;`,
child: inner,
});
} else {
return inner;
}
};
export const NierLongButton = ({
name = "",
className = [],
containerClassName = [],
containerConnections = [],
label = "",
toggled = false,
tab_style = false,
dat = "",
passedOnHoverLost = async (self) => {},
passedOnHover = async (self) => {},
...props
}) =>
Box({
className: ["nier-long-button-container", ...containerClassName],
connections: [...containerConnections],
children: [
Icon({
icon: App.configDir + "/assets/nier-pointer.svg",
size: 37,
className: [
"nier-long-button-hover-icon",
"nier-long-button-hover-icon-hidden",
],
}),
Button({
name,
child: Label({
label: "⬛ " + label,
xalign: 0,
justification: "left",
}),
onHover: (self) => {
passedOnHover(self);
self.className = arradd(self.className, "nier-long-button-hover");
self.parent.children[0].className = [
"nier-long-button-hover-icon",
"nier-long-button-hover-icon-visible",
];
},
onHoverLost: (self) => {
passedOnHoverLost(self);
self.className = arrremove(self.className, "nier-long-button-hover");
self.parent.children[0].className = [
"nier-long-button-hover-icon",
"nier-long-button-hover-icon-hidden",
];
},
className: ["nier-long-button", ...className],
...props,
}),
],
});
export const NierShortButton = ({ name, className, label, ...props }) =>
Button({
name,
className: ["nier-short-button", ...className],
...props,
});
export const NierToggle = ({
name,
className,
label,
_value = "",
state = false,
size = 70,
...props
}) =>
Button({
name,
className: ["nier-toggle", ...className],
child: Icon({
icon: App.configDir + "/assets/nier-border.svg",
size: size,
}),
// onClicked: (self) => {
// console.log(state, self.className);
// if (state) {
// self.className = arradd(self.className, "nier-toggle-off");
// self.className = arrremove(self.className, "nier-toggle-on");
// state = false;
// } else {
// self.className = arrremove(self.className, "nier-toggle-off");
// self.className = arradd(self.className, "nier-toggle-on");
// state = true;
// }
// },
...props,
});

View File

@@ -0,0 +1,6 @@
$tan: rgba(194, 189, 166, 1);
$brown: rgba(72, 70, 61, 1);
$brown25: rgba(72, 70, 61, .25);
$brown15: rgba(72, 70, 61, .15);
$brown025: rgba(72, 70, 61, .025);
$darkBrown: rgba(69, 67, 58, 1);

View File

View File

@@ -0,0 +1 @@
@import "nier/longbutton";

View File

@@ -0,0 +1,113 @@
@import "../color";
$accent_border: 3px;
$accent_border_dist: 4px;
$button_dist_from_ruler: 14px;
$button_spacing_vertical: 10px;
$button_spacing_horizontal: 5px;
@mixin long-button-hover {
border-top: $brown $accent_border solid;
border-bottom: $brown $accent_border solid;
padding-top: $accent_border_dist;
padding-bottom: $accent_border_dist;
label {
padding-top: calc(8px - #{$accent_border_dist});
padding-bottom: calc(7px - #{$accent_border_dist});
background-position: -100%;
color: $tan;
}
}
@mixin long-button {
border: none;
border-top: transparent $accent_border solid;
border-bottom: transparent $accent_border solid;
min-width: 200px;
}
.nier-toggle {
// border: blue 2px solid;
}
.nier-toggle-on {
opacity: 1;
transition: opacity 0.3s ease-in-out;
}
.nier-toggle-off {
opacity: 0.3;
transition: opacity 0.3s ease-in-out;
}
// the actual button looking thing ( is actuaally a label :0 )
.nier-long-button label {
font-size: 2rem;
background: linear-gradient(
90deg,
$brown25 0%,
$brown25 50%,
$brown 50%,
$brown 100%
);
background-size: 200%;
color: $brown;
padding: 8px 8px 7px;
transition: background 0.1s cubic-bezier(0.15, 0.79, 0, 1),
border-color 0.3s ease-in-out, color 0.3s ease-in-out,
box-shadow 0.4s ease-in-out;
}
//.nier-long-button-container = pointer + buttons
.nier-long-button-group-vertical .nier-long-button-container {
margin-bottom: $button_spacing_vertical;
&:last-child {
margin-bottom: 0;
}
}
// same but horizontal
.nier-long-button-group .nier-long-button-container {
margin-right: $button_spacing_horizontal;
&:last-child {
margin-right: 0;
}
}
// top and bottom borders
.nier-long-button {
@include long-button;
transition: border 0.3s ease-in-out;
}
.nier-long-button-hover {
@include long-button-hover;
label {
transition: background 1s cubic-bezier(0.15, 0.79, 0, 1);
}
}
.nier-long-button-group-ruler {
margin-top: 5px;
background: linear-gradient(
90deg,
$brown25 7px,
transparent 0px,
transparent 13px,
$brown25 13px,
transparent 18px
);
min-width: 20px;
}
// pointer thing
.nier-long-button-hover-icon {
margin-left: -14px;
margin-right: $button_dist_from_ruler;
}
.nier-long-button-hover-icon-visible {
opacity: 1;
transition: opacity 0.3s ease-in-out;
}
.nier-long-button-hover-icon-hidden {
opacity: 0;
transition: opacity 0.3s ease-in-out;
}

View File

@@ -0,0 +1,190 @@
* {
all: unset; }
.nier-toggle-on {
opacity: 1;
transition: opacity 0.3s ease-in-out; }
.nier-toggle-off {
opacity: 0.3;
transition: opacity 0.3s ease-in-out; }
.nier-long-button label {
font-size: 2rem;
background: linear-gradient(90deg, rgba(72, 70, 61, 0.25) 0%, rgba(72, 70, 61, 0.25) 50%, #48463d 50%, #48463d 100%);
background-size: 200%;
color: #48463d;
padding: 8px 8px 7px;
transition: background 0.1s cubic-bezier(0.15, 0.79, 0, 1), border-color 0.3s ease-in-out, color 0.3s ease-in-out, box-shadow 0.4s ease-in-out; }
.nier-long-button-group-vertical .nier-long-button-container {
margin-bottom: 10px; }
.nier-long-button-group-vertical .nier-long-button-container:last-child {
margin-bottom: 0; }
.nier-long-button-group .nier-long-button-container {
margin-right: 5px; }
.nier-long-button-group .nier-long-button-container:last-child {
margin-right: 0; }
.nier-long-button {
border: none;
border-top: transparent 3px solid;
border-bottom: transparent 3px solid;
min-width: 200px;
transition: border 0.3s ease-in-out; }
.nier-long-button-hover {
border-top: #48463d 3px solid;
border-bottom: #48463d 3px solid;
padding-top: 4px;
padding-bottom: 4px; }
.nier-long-button-hover label {
padding-top: calc(8px - 4px);
padding-bottom: calc(7px - 4px);
background-position: -100%;
color: #c2bda6; }
.nier-long-button-hover label {
transition: background 1s cubic-bezier(0.15, 0.79, 0, 1); }
.nier-long-button-group-ruler {
margin-top: 5px;
background: linear-gradient(90deg, rgba(72, 70, 61, 0.25) 7px, transparent 0px, transparent 13px, rgba(72, 70, 61, 0.25) 13px, transparent 18px);
min-width: 20px; }
.nier-long-button-hover-icon {
margin-left: -14px;
margin-right: 14px; }
.nier-long-button-hover-icon-visible {
opacity: 1;
transition: opacity 0.3s ease-in-out; }
.nier-long-button-hover-icon-hidden {
opacity: 0;
transition: opacity 0.3s ease-in-out; }
.nier-toggle-on {
opacity: 1;
transition: opacity 0.3s ease-in-out; }
.nier-toggle-off {
opacity: 0.3;
transition: opacity 0.3s ease-in-out; }
.nier-long-button label {
font-size: 2rem;
background: linear-gradient(90deg, rgba(72, 70, 61, 0.25) 0%, rgba(72, 70, 61, 0.25) 50%, #48463d 50%, #48463d 100%);
background-size: 200%;
color: #48463d;
padding: 8px 8px 7px;
transition: background 0.1s cubic-bezier(0.15, 0.79, 0, 1), border-color 0.3s ease-in-out, color 0.3s ease-in-out, box-shadow 0.4s ease-in-out; }
.nier-long-button-group-vertical .nier-long-button-container {
margin-bottom: 10px; }
.nier-long-button-group-vertical .nier-long-button-container:last-child {
margin-bottom: 0; }
.nier-long-button-group .nier-long-button-container {
margin-right: 5px; }
.nier-long-button-group .nier-long-button-container:last-child {
margin-right: 0; }
.nier-long-button {
border: none;
border-top: transparent 3px solid;
border-bottom: transparent 3px solid;
min-width: 200px;
transition: border 0.3s ease-in-out; }
.nier-long-button-hover {
border-top: #48463d 3px solid;
border-bottom: #48463d 3px solid;
padding-top: 4px;
padding-bottom: 4px; }
.nier-long-button-hover label {
padding-top: calc(8px - 4px);
padding-bottom: calc(7px - 4px);
background-position: -100%;
color: #c2bda6; }
.nier-long-button-hover label {
transition: background 1s cubic-bezier(0.15, 0.79, 0, 1); }
.nier-long-button-group-ruler {
margin-top: 5px;
background: linear-gradient(90deg, rgba(72, 70, 61, 0.25) 7px, transparent 0px, transparent 13px, rgba(72, 70, 61, 0.25) 13px, transparent 18px);
min-width: 20px; }
.nier-long-button-hover-icon {
margin-left: -14px;
margin-right: 14px; }
.nier-long-button-hover-icon-visible {
opacity: 1;
transition: opacity 0.3s ease-in-out; }
.nier-long-button-hover-icon-hidden {
opacity: 0;
transition: opacity 0.3s ease-in-out; }
.workspace-button-container.active-no-hover .nier-long-button {
border-top: #48463d 3px solid;
border-bottom: #48463d 3px solid;
padding-top: 4px;
padding-bottom: 4px;
animation: active 0.5s cubic-bezier(0.15, 0.79, 0, 1) forwards;
animation-delay: 0.3s; }
.workspace-button-container.active-no-hover .nier-long-button label {
padding-top: calc(8px - 4px);
padding-bottom: calc(7px - 4px);
background-position: -100%;
color: #c2bda6; }
.workspace-button-container.active-no-hover .nier-long-button label {
transition: background 0.3s cubic-bezier(0.15, 0.79, 0, 1);
animation: active-label 0.5s cubic-bezier(0.15, 0.79, 0, 1) forwards;
animation-delay: 0.3s; }
.workspace-button-container.active .nier-long-button {
animation: active 0.5s cubic-bezier(0.15, 0.79, 0, 1) forwards; }
.workspace-button-container.active .nier-long-button label {
transition: background 0.3s cubic-bezier(0.15, 0.79, 0, 1);
animation: active-label 0.5s cubic-bezier(0.15, 0.79, 0, 1) forwards; }
.active-on-hold .nier-long-button-hover-icon,
.active-no-hover-on-hold .nier-long-button-hover-icon {
opacity: 1; }
.under-workspaces {
margin-top: -8px;
margin-right: 120px; }
.workspace-button {
margin-bottom: 20px;
transition: border 0.3s cubic-bezier(0.15, 0.79, 0, 1); }
.workspace-button-container .nier-long-button-hover-icon {
margin-bottom: 20px; }
.workspace-button-container .nier-long-button {
transition: margin 0.1s cubic-bezier(0.15, 0.79, 0, 1); }
.workspace-button-container.active .nier-long-button-hover-icon,
.workspace-button-container.active-no-hover .nier-long-button-hover-icon {
opacity: 1; }
@keyframes active-label {
0% {
padding-bottom: 8px; }
100% {
padding-bottom: 20px; } }
@keyframes active {
0% {
margin-bottom: 20px;
border: transparent 0px; }
100% {
margin-bottom: 0px;
border: none;
border-top: transparent 3px solid;
border-bottom: transparent 3px solid;
min-width: 200px; } }

View File

@@ -0,0 +1,7 @@
* {
all: unset;
}
@import "nier";
@import "widgets/workspace.scss";

View File

@@ -0,0 +1,78 @@
@import "../color";
@import "../nier/longbutton.scss";
.workspace-button-container.active-no-hover {
.nier-long-button {
@include long-button-hover;
label {
transition: background 0.3s cubic-bezier(0.15, 0.79, 0, 1);
animation: active-label 0.5s cubic-bezier(0.15, 0.79, 0, 1) forwards;
animation-delay: 0.3s;
}
animation: active 0.5s cubic-bezier(0.15, 0.79, 0, 1) forwards;
animation-delay: 0.3s;
}
}
.workspace-button-container.active {
.nier-long-button {
label {
transition: background 0.3s cubic-bezier(0.15, 0.79, 0, 1);
animation: active-label 0.5s cubic-bezier(0.15, 0.79, 0, 1) forwards;
}
animation: active 0.5s cubic-bezier(0.15, 0.79, 0, 1) forwards;
}
}
.active-on-hold,
.active-no-hover-on-hold {
.nier-long-button-hover-icon {
opacity: 1;
}
}
.under-workspaces {
margin-top: -8px;
margin-right: 120px;
}
.workspace-button {
margin-bottom: 20px;
transition: border 0.3s cubic-bezier(0.15, 0.79, 0, 1);
}
.workspace-button-container {
.nier-long-button-hover-icon {
margin-bottom: 20px;
}
.nier-long-button {
transition: margin 0.1s cubic-bezier(0.15, 0.79, 0, 1);
}
}
.workspace-button-container.active,
.workspace-button-container.active-no-hover {
.nier-long-button-hover-icon {
opacity: 1;
}
}
@keyframes active-label {
0% {
padding-bottom: 8px;
}
100% {
padding-bottom: 20px;
}
}
@keyframes active {
0% {
margin-bottom: 20px;
border: transparent 0px;
}
100% {
margin-bottom: 0px;
@include long-button;
}
}

48
components/ags/util.js Normal file
View File

@@ -0,0 +1,48 @@
import { App, Utils } from "./imports.js";
function arrremove(arr, value) {
return arr.filter(function (ele) {
return ele != value;
});
}
function arradd(arr, value) {
if (arr.includes(value)) {
return arr;
}
arr.push(value);
return arr;
}
const home = `/home/${Utils.exec("whoami")}`;
const themedir = App.configDir.split("/").slice(0, -2).join("/");
const scss = App.configDir + "/style/style.scss";
const css = App.configDir + "/style/style.css";
const { execAsync } = Utils;
const { exec } = Utils;
const SCREEN_WIDTH = Number(
exec(
`bash -c "xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1 | head -1"`
)
);
const SCREEN_HEIGHT = Number(
exec(
`bash -c "xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2 | head -1"`
)
);
globalThis["SCREEN_WIDTH"] = SCREEN_WIDTH;
globalThis["SCREEN_HEIGHT"] = SCREEN_HEIGHT;
export {
arradd,
arrremove,
home,
themedir,
scss,
css,
SCREEN_HEIGHT,
SCREEN_WIDTH,
zoom_out,
};

View File

@@ -0,0 +1,167 @@
// importing
import {
Hyprland,
Notifications,
Mpris,
Audio,
Battery,
SystemTray,
App,
Widget,
Utils,
Variable,
} from "../imports.js";
import {
NierLongButton,
NierLongButtonGroup,
NierToggle,
} from "../nier/buttons.js";
import { SCREEN_HEIGHT, SCREEN_WIDTH, arradd, arrremove } from "../util.js";
const { Box, Label } = Widget;
const { execAsync } = Utils;
let HOVERING = false;
let REALLY_HOVERING = false;
export const Workspaces = () =>
Box({
vertical: true,
children: [
NierLongButtonGroup({
horizontal: true,
min_scale: SCREEN_WIDTH,
className: ["workspaces"],
buttons: Array.from({ length: 10 }, (_, i) => i + 1).map((i) => {
return NierLongButton({
className: ["workspace-button"],
containerClassName: [
"workspace-button-container",
`workspace-button-${i}`,
],
label: `${i}`,
onClicked: () => {
execAsync(`hyprctl dispatch workspace ${i}`);
},
passedOnHover: async (self) => {
if (
!(
self.parent.className.includes("active") ||
self.parent.className.includes("active-no-hover")
)
) {
HOVERING = true;
REALLY_HOVERING = true;
}
if (HOVERING) {
for (let button of self.parent.parent.children) {
if (
button.className.includes("active") ||
button.className.includes("active-no-hover")
) {
button.className = arrremove(
button.className,
"active-no-hover"
);
button.className = arrremove(button.className, "active");
button.className = arradd(
button.className,
"active-no-hover-on-hold"
);
}
}
}
},
passedOnHoverLost: async (self) => {
if (!self.className.includes("active")) {
HOVERING = false;
await new Promise((r) => setTimeout(r, 300));
if (!HOVERING && REALLY_HOVERING) {
REALLY_HOVERING = false;
}
}
if (!HOVERING) {
for (let button of self.parent.parent.children) {
if (button.className.includes("active-on-hold")) {
button.className = arrremove(
button.className,
"active-on-hold"
);
button.className = arradd(button.className, "active");
}
if (button.className.includes("active-no-hover-on-hold")) {
button.className = arrremove(
button.className,
"active-no-hover-on-hold"
);
button.className = arradd(
button.className,
"active-no-hover"
);
}
}
}
},
containerConnections: [
[
Hyprland.active.workspace,
async (self) => {
console.log(
"workspacec changed to :: ",
Hyprland.active.workspace.id
);
if (
!self.className.includes(
`workspace-button-${Hyprland.active.workspace.id}`
)
) {
self.className = arrremove(
self.className,
"active-on-hold"
);
self.className = arrremove(
self.className,
"active-no-hover-on-hold"
);
self.className = arrremove(self.className, "active");
self.className = arrremove(
self.className,
"active-no-hover"
);
self.children[0].icon =
App.configDir + "/assets/nier-pointer.svg";
} else {
if (
!self.children[1].className.includes(
"nier-long-button-hover"
)
) {
self.className = arradd(
self.className,
"active-no-hover"
);
} else {
self.children[1].className = arrremove(
self.children[1].className,
"nier-long-button-hover"
);
self.className = arradd(self.className, "active");
}
await new Promise((r) => setTimeout(r, 300));
self.children[0].icon =
App.configDir + "/assets/nier-pointer-white.svg";
}
},
],
],
});
}),
}),
Box({
className: ["under-workspaces"],
style: `background: url("${App.configDir}/assets/nier-border.svg") repeat-x;`,
child: Label(""),
}),
],
});

5
deps Normal file
View File

@@ -0,0 +1,5 @@
aylurs-gtk-shell
cava
python
python-colorz
pywal

1
readme.md Normal file
View File

@@ -0,0 +1 @@
:0

19
scripts/apply.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env fish
set -Ux STARSHIP_CONFIG $argv[1]/starship.toml
set -Ux HYPRLAND_THEME $argv[1]
set color ~/.config/hypr/scripts/color
pkill dunst &
pkill -USR2 fish &
swww init &
#TODO: add a check for asusctl
asusctl led-mode static -c "$($color cursor -n)" &
python $argv[1]/scripts/pywal_set.py 1 &
ags -c ~/rice/themes/aurora/components/ags/config.js &

132
scripts/apply_wall Executable file
View File

@@ -0,0 +1,132 @@
#!/usr/bin/env python
import subprocess
import os
import pywal
import numpy as np
import matplotlib as mpl
import time
def colormix(c1, c2, mix=0):
# get np arrays c1 and c2 from hex
c1 = np.array(mpl.colors.to_rgb(c1))
c2 = np.array(mpl.colors.to_rgb(c2))
return mpl.colors.to_hex((1 - mix) * c1 + mix * c2)
def alpha(c1, a):
c1 = np.array(mpl.colors.to_rgb(c1))
return mpl.colors.to_hex(c1 + (1 - c1) * a)
def apply(pre=None, wallpaper=None):
if not pre:
colors = pywal.colors.get(wallpaper, backend="wal")
else:
colors = pre
print(wallpaper)
print("colors::::: ", colors)
cmd = f"swww img '{wallpaper}' --transition-type grow --transition-step 1 --transition-duration 1 --transition-pos 0.5,1.0"
subprocess.run(cmd, shell=True)
with open(os.path.expanduser("~/.config/hypr/themes/colors_base"), "r") as cr:
raw = cr.read()
new_colors = {}
for line in raw.split("\n"):
if line and not line.startswith("#"):
color, value = line.split(":")
if color.isnumeric():
new_colors[color.strip()] = colormix(
value.strip(),
colors["colors"]["color" + color.strip()],
mix=0.8,
)
for color, value in colors["special"].items():
new_colors[color] = value
with open(os.path.expanduser("~/.config/hypr/themes/colors"), "w") as f:
for color, value in new_colors.items():
f.write(f"{color}: {value}\n")
with open(os.path.expanduser("~/.config/hypr/themes/uicolors"), "w") as f:
for color, value in colors["colors"].items():
f.write(f"{color[5:]}: {value}\n")
for color, value in colors["special"].items():
f.write(f"{color}: {value}\n")
subprocess.run("touch ~/.config/hypr/themes/uicolors", shell=True)
# active borders
gradient = ""
for color, value in colors["colors"].items():
gradient += f"rgba({value[1:]}ff) "
gradient += " 45deg"
cmd = f"hyprctl keyword general:col.active_border '{gradient}'"
print(cmd)
subprocess.run(cmd, shell=True)
# inactive borders
gradient = ""
for color, value in colors["colors"].items():
gradient += f"rgba({value[1:]}44) "
gradient += " 0deg"
cmd = f"hyprctl keyword general:col.inactive_border '{gradient}'"
print(cmd)
subprocess.run(cmd, shell=True)
cmd = (
f"hyprctl keyword decoration:col.shadow '0x33{colors['colors']['color5'][1:]}'"
)
print(cmd)
subprocess.run(cmd, shell=True)
cmd = f"hyprctl keyword decoration:col.shadow_inactive '0x22{colors['special']['background'][1:]}'"
print(cmd)
subprocess.run(cmd, shell=True)
# keyboard
cmd = f"asusctl led-mode static -c '{colors['colors']['color0'][1:]}'"
print(cmd)
subprocess.run(cmd, shell=True)
# cava
with open(os.path.expanduser("~/.config/cava/config"), "r") as f:
conf = f.read()
conf = conf.split("#--- cover2bg.py ---")[0]
conf += (
"\n#--- cover2bg.py ---\n"
+ f"""
[color]
background = '{colors["special"]["background"]}'
gradient = 1
gradient_color_1 = '{colors["colors"]["color0"]}'
gradient_color_2 = '{colors["colors"]["color1"]}'
gradient_color_3 = '{colors["colors"]["color2"]}'
gradient_color_4 = '{colors["colors"]["color3"]}'
gradient_color_5 = '{colors["colors"]["color4"]}'
gradient_color_6 = '{colors["colors"]["color5"]}'
gradient_color_7 = '{colors["colors"]["color6"]}'
gradient_color_8 = '{colors["colors"]["color7"]}'
"""
)
with open(os.path.expanduser("~/.config/cava/config"), "w") as f:
f.write(conf)
time.sleep(0.5)
subprocess.run("pkill -USR2 cava", shell=True)
subprocess.run("pkill -USR2 fish", shell=True)
def main():
apply(wallpaper="/tmp/bg.png")
if __name__ == "__main__":
main()

68
scripts/cover2bg Executable file
View File

@@ -0,0 +1,68 @@
#!/usr/bin/env bash
HQ=0
if [ -z "$1" ]; then
echo "Please provide an image"
exit 1
fi
if [ ! -f "$1" ]; then
echo "Image does not exist"
exit 1
fi
if ! file "$1" | grep -qE 'image|bitmap'; then
echo "Image is not a valid image"
exit 1
fi
# get json from hyprctl
json=$(hyprctl monitors -j)
json=$(echo $json | jq '.[0]')
width=$(echo $json | jq '.width')
height=$(echo $json | jq '.height')
if [ -f /tmp/prev_bg.png ]; then
if cmp -s "$1" /tmp/prev_bg.png; then
echo "Image is the same"
exit 0
fi
fi
cp "$1" /tmp/prev_bg.png
echo "Image is different"
cp "$1" /tmp/bg.png
magick mogrify -fuzz 4% -trim +repage -shave 7x7 -format png /tmp/bg.png
#if HQ == 1
if [ $HQ -eq 1 ]; then
convert /tmp/bg.png -resize $((width))x$((height))^ -gravity center -extent $((width))x$((height)) /tmp/bg.png
else
convert /tmp/bg.png -resize $((width / 2))x$((height / 2))^ -gravity center -extent $((width / 2))x$((height / 2)) /tmp/bg.png
fi
img_width=$(identify -format "%w" /tmp/bg.png)
img_height=$(identify -format "%h" /tmp/bg.png)
convert /tmp/bg.png -blur 0x40 /tmp/bg.png
color=$(convert /tmp/bg.png -gravity center -crop 1x1+0+0 +repage txt:- | grep -m 1 -o '#[0-9A-F]\{6\}')
convert -size ${width}x$((height / 3)) gradient:$color-transparent /tmp/gradient.png
convert /tmp/bg.png /tmp/gradient.png -gravity north -composite /tmp/bg.png
# if /tmp/texture.png is not a file
if [ ! -f /tmp/texture.png ]; then
echo "texture not found"
convert -size ${img_width}x${img_height} xc:gray +noise Random -channel A -threshold 90% /tmp/texture.png
fi
# convert -size ${img_width}x${img_height} xc:gray +noise Random -channel A -threshold 90% /tmp/texture.png
convert /tmp/texture.png -alpha set -channel A -evaluate set 5% /tmp/texture.png
convert /tmp/bg.png /tmp/texture.png -gravity center -compose overlay -composite /tmp/bg.png
ags -r "dominant_color.value = '$color';"
$HYPRLAND_THEME/scripts/apply_wall /tmp/bg.png

171
scripts/pywal_set Executable file
View File

@@ -0,0 +1,171 @@
#!/usr/bin/env python
import pywal
import argparse
import os
import subprocess
import numpy as np
import matplotlib as mpl
import time
THEME_DIR = os.environ.get("HYPRLAND_THEME")
print(THEME_DIR)
def colormix(c1, c2, mix=0):
# get np arrays c1 and c2 from hex
c1 = np.array(mpl.colors.to_rgb(c1))
c2 = np.array(mpl.colors.to_rgb(c2))
return mpl.colors.to_hex((1 - mix) * c1 + mix * c2)
def alpha(c1, a):
c1 = np.array(mpl.colors.to_rgb(c1))
return mpl.colors.to_hex(c1 + (1 - c1) * a)
def apply(pre=None, wallpaper=None):
if not pre:
colors = pywal.colors.get(wallpaper, backend="wal")
else:
colors = pre
print(wallpaper)
print("colors::::: ", colors)
cmd = f"swww img '{wallpaper}' --transition-type outer --transition-step 1 --transition-duration 1 --transition-pos 0.5,1.0"
subprocess.run(cmd, shell=True)
with open(os.path.expanduser("~/.config/hypr/themes/colors_base"), "r") as cr:
raw = cr.read()
new_colors = {}
for line in raw.split("\n"):
if line and not line.startswith("#"):
color, value = line.split(":")
if color.isnumeric():
new_colors[color.strip()] = colormix(
value.strip(),
colors["colors"]["color" + color.strip()],
mix=0.75,
)
for color, value in colors["special"].items():
new_colors[color] = value
with open(os.path.expanduser("~/.config/hypr/themes/colors"), "w") as f:
for color, value in new_colors.items():
f.write(f"{color}: {value}\n")
with open(os.path.expanduser("~/.config/hypr/themes/uicolors"), "w") as f:
for color, value in colors["colors"].items():
f.write(f"{color[5:]}: {value}\n")
for color, value in colors["special"].items():
f.write(f"{color}: {value}\n")
subprocess.run("touch ~/.config/hypr/themes/uicolors", shell=True)
# active borders
gradient = ""
for color, value in colors["colors"].items():
gradient += f"rgba({value[1:]}ff) "
gradient += " 45deg"
cmd = f"hyprctl keyword general:col.active_border '{gradient}'"
print(cmd)
subprocess.run(cmd, shell=True)
# inactive borders
gradient = ""
for color, value in colors["colors"].items():
gradient += f"rgba({value[1:]}44) "
gradient += " 0deg"
cmd = f"hyprctl keyword general:col.inactive_border '{gradient}'"
print(cmd)
subprocess.run(cmd, shell=True)
cmd = (
f"hyprctl keyword decoration:col.shadow '0x33{colors['colors']['color5'][1:]}'"
)
print(cmd)
subprocess.run(cmd, shell=True)
cmd = f"hyprctl keyword decoration:col.shadow_inactive '0x22{colors['special']['background'][1:]}'"
print(cmd)
subprocess.run(cmd, shell=True)
# keyboard
cmd = f"asusctl led-mode static -c '{colors['colors']['color0'][1:]}'"
print(cmd)
subprocess.run(cmd, shell=True)
# cava
with open(os.path.expanduser("~/.config/cava/config"), "r") as f:
conf = f.read()
conf = conf.split("#--- cover2bg.py ---")[0]
conf += (
"\n#--- cover2bg.py ---\n"
+ f"""
[color]
background = '{colors["special"]["background"]}'
gradient = 1
gradient_color_1 = '{colors["colors"]["color0"]}'
gradient_color_2 = '{colors["colors"]["color1"]}'
gradient_color_3 = '{colors["colors"]["color2"]}'
gradient_color_4 = '{colors["colors"]["color3"]}'
gradient_color_5 = '{colors["colors"]["color4"]}'
gradient_color_6 = '{colors["colors"]["color5"]}'
gradient_color_7 = '{colors["colors"]["color6"]}'
gradient_color_8 = '{colors["colors"]["color7"]}'
"""
)
with open(os.path.expanduser("~/.config/cava/config"), "w") as f:
f.write(conf)
time.sleep(0.5)
subprocess.run("pkill -USR2 cava", shell=True)
subprocess.run("pkill -USR2 fish", shell=True)
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--index", help="wallpaper index")
parser.add_argument(
"--nosave",
help="to save wallpaper to `currentwall` or not",
action="store_true",
)
parser.add_argument(
"--reset", help="to set wallpaper in `currentwall`", action="store_true"
)
# parser.add_argument("cycle", help="cycle wall", required=False)
args = parser.parse_args()
if args.reset:
with open(os.path.join(THEME_DIR, "currentwall"), "r") as f:
index = f.read()
args.index = index
if args.index and args.index.isdigit():
index = int(args.index)
wallpaper = os.listdir(os.path.join(THEME_DIR, "wallpapers"))[index - 1]
wallpaper = os.path.join(os.path.join(THEME_DIR, "wallpapers"), wallpaper)
else:
wallpaper = os.path.expanduser(args.index)
if not args.nosave:
with open(os.path.join(THEME_DIR, "currentwall"), "w") as f:
f.write(str(args.index))
try:
apply(wallpaper=wallpaper)
except Exception:
wallpaper = os.listdir(os.path.join(THEME_DIR, "wallpapers"))[0]
wallpaper = os.path.join(os.path.join(THEME_DIR, "wallpapers"), wallpaper)
apply(wallpaper=wallpaper)
if __name__ == "__main__":
main()

6
scripts/workspace_switch Normal file
View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
hyprctl keyword monitor "eDP-1,addreserved,50,50,50,50"
sleep 0.1
hyprctl dispatch workspace $1
sleep 0.1
hyprctl keyword monitor "eDP-1,addreserved,0,0,0,0"

16
starship.toml Normal file
View File

@@ -0,0 +1,16 @@
# Use custom format:
format="$directory$git_branch$character"
# Prompt symbols
[character]
success_symbol = "[🞈](bright-green bold)"
error_symbol = "[🞈](bright-red)"
vicmd_symbol = "[🞈](bright-yellow)"
[directory]
format = "[]($style)[(bg:white fg:black)$path](bg:white fg:black)[ ]($style)"
style = "bg:background fg:white"
[git_branch]
format = "[]($style)[[ ](bg:white fg:black bold)$branch](bg:white fg:black)[ ]($style)"
style = "bg:background fg:white"

29
theme.conf Normal file
View File

@@ -0,0 +1,29 @@
exec=cp $THEME/colors $HOME/.config/hypr/themes/colors
exec=$THEME/scripts/apply.sh $THEME
decoration {
drop_shadow = true
shadow_range=100
shadow_render_power=2
col.shadow= 0x33D5C7DA
col.shadow_inactive=0x221b3c46
rounding=15
}
general {
col.active_border=rgba(cba6f7ff) rgba(89b4faff) rgba(94e2d5ff) 10deg
col.inactive_border=0xff45475a
border_size=5
}
animations {
enabled=1
# bezier=overshot,0.05,0.9,0.1,1.1
bezier=overshot,0.13,0.99,0.29,1.1
bezier = linear, 0.0, 0.0, 1.0, 1.0
animation=windows,1,4,overshot,slide
animation=border,1,10,default
animation=fade,1,10,default
animation=workspaces,1,6,overshot,slide
animation = borderangle, 1, 100, linear, loop
}