feat: improve ags

This commit is contained in:
2024-01-07 19:26:29 +01:00
parent e5796d4d6e
commit 2c2b62d14e
12 changed files with 60 additions and 35 deletions

View File

@@ -2,7 +2,7 @@ import App from "resource:///com/github/Aylur/ags/app.js";
import Clock from "../../misc/Clock.js";
import PanelButton from "../PanelButton.js";
export default ({ format = "%H:%M - %A %e." } = {}) =>
export default ({ format = "%R - %x" } = {}) =>
PanelButton({
class_name: "dashboard panel-button",
on_clicked: () => App.toggleWindow("dashboard"),

View File

@@ -15,6 +15,7 @@ import { init } from "./settings/setup.js";
import { forMonitors } from "./utils.js";
import { initWallpaper } from "./settings/wallpaper.js";
import options from "./options.js";
import Dock from "./dock/Dock.js";
initWallpaper();
@@ -27,6 +28,7 @@ const windows = () => [
forMonitors(TopBar),
Applauncher(),
Dashboard(),
Dock(),
Overview(),
PowerMenu(),
QuickSettings(),

View File

@@ -19,8 +19,8 @@ export default (index) => {
class_name: "workspace",
vpack: "center",
css: `
min-width: ${1920 * SCALE}px;
min-height: ${1080 * SCALE}px;
min-width: ${3840 * SCALE}px;
min-height: ${2160 * SCALE}px;
`,
connections: [
[

View File

@@ -56,16 +56,17 @@ export default () =>
children: [
Row([Volume()], [SinkSelector(), AppMixer()]),
Microhone(),
Brightness(),
/*Brightness()*/
,
],
}),
Row(
[Homogeneous([NetworkToggle(), BluetoothToggle()]), DND()],
[WifiSelection(), BluetoothDevices()],
[Homogeneous([/*NetworkToggle(),*/ BluetoothToggle()]), DND()],
[/*WifiSelection()*/ BluetoothDevices()],
),
Row(
[Homogeneous([ProfileToggle(), ThemeToggle()]), MicMute()],
[ProfileSelector(), ThemeSelector()],
[Homogeneous([/*ProfileToggle(),*/ ThemeToggle()]), MicMute()],
[/*ProfileSelector(),*/ ThemeSelector()],
),
Media(),
],

View File

@@ -17,7 +17,7 @@ export default () =>
vpack: "center",
hexpand: true,
children: [
Widget.Box({
/*Widget.Box({
class_name: "battery horizontal",
children: [
Widget.Icon({ binds: [["icon", Battery, "icon-name"]] }),
@@ -29,7 +29,7 @@ export default () =>
Widget.Label({
class_name: "uptime",
binds: [["label", uptime, "value", (v) => `up: ${v}`]],
}),
}),*/
Widget.Button({
on_clicked: openSettings,
child: Widget.Icon(icons.ui.settings),

View File

@@ -16,6 +16,7 @@ export function init() {
warnOnLowBattery();
globals();
tmux();
kitty();
gsettigsColorScheme();
gtkFontSettings();
dependandOptions();
@@ -35,6 +36,18 @@ function dependandOptions() {
});
}
function kitty() {
if (!Utils.exec("which kitty")) return;
console.log("kitty");
options.theme.scheme.connect("changed", ({ value }) =>
Utils.execAsync(
`kitty +kitten themes --reload-in=all --config-file-name /home/theaninova/.config/kitty/current-colors.conf Catppuccin-${
value === "light" ? "Latte" : "Frappe"
}`,
),
);
}
function tmux() {
if (!Utils.exec("which tmux")) return;

View File

@@ -21,15 +21,28 @@ export const WP = App.configDir + "/assets/";
export const lightColors = {
"theme.scheme": "light",
"color.red": "#e55f86",
"color.green": "#00D787",
"color.yellow": "#EBFF71",
"color.blue": "#51a4e7",
"color.magenta": "#9077e7",
"color.teal": "#51e6e6",
"color.orange": "#E79E64",
"theme.bg": "#fffffa",
"theme.fg": "#141414",
"color.red": "#d20f39",
"color.green": "#40a02b",
"color.yellow": "#df8e1d",
"color.blue": "#1e66f5",
"color.magenta": "#8839ef",
"color.teal": "#179299",
"color.orange": "#fe640b",
"theme.bg": "transparentize(#eff1f5, 0.3)",
"theme.fg": "#4c4f69",
};
export const darkColors = {
"theme.scheme": "dark",
"color.red": "#e78284",
"color.green": "#a6d189",
"color.yellow": "#e5c890",
"color.blue": "#8caaee",
"color.magenta": "#ca9ee6",
"color.teal": "#81c8be",
"color.orange": "#ef9f76",
"theme.bg": "transparentize(#303446, 0.3)",
"theme.fg": "#c6d0f5",
};
export const Theme = ({ name, icon = " ", ...options }) => ({

View File

@@ -13,13 +13,7 @@ export function initWallpaper() {
export function wallpaper() {
if (!dependencies(["swww"])) return;
execAsync([
"swww",
"img",
"--transition-type",
"grow",
"--transition-pos",
exec("hyprctl cursorpos").replace(" ", ""),
options.desktop.wallpaper.img.value,
]).catch((err) => console.error(err));
execAsync(["swww", "img", options.desktop.wallpaper.img.value]).catch((err) =>
console.error(err),
);
}

View File

@@ -2,18 +2,19 @@
* A Theme is a set of options that will be applied
* ontop of the default values. see options.js for possible options
*/
import { Theme, WP, lightColors } from "./settings/theme.js";
import { Theme, WP, lightColors, darkColors } from "./settings/theme.js";
export default [
Theme({
name: "Kitty Dark",
name: "Latte",
icon: "󰄛",
"desktop.screen_corners": false,
"bar.style": "floating",
"desktop.wallpaper.img": WP + "Lakeside-2-1.jpg",
...darkColors,
}),
Theme({
name: "Kitty Light",
name: "Frappe",
icon: "󰄛",
"desktop.screen_corners": false,
"bar.style": "floating",
@@ -22,7 +23,7 @@ export default [
"theme.widget.bg": "$accent",
"theme.widget.opacity": 64,
}),
Theme({
/*Theme({
name: "Leaves",
icon: "󰌪",
"desktop.wallpaper.img": WP + "leaves.jpg",
@@ -66,5 +67,5 @@ export default [
"theme.bg": "transparentize(#171717, 0.3)",
"theme.widget.opacity": 95,
"bar.flat_buttons": false,
}),
}),*/
];

View File

@@ -6,7 +6,7 @@
services.darkman = let
wallpaperPath = "${config.home.homeDirectory}/.local/state/wallpaper.jpg";
in {
enable = true;
enable = false;
package = pkgs.buildGoModule rec {
pname = "darkman";
version = "1.5.4";

View File

@@ -152,6 +152,7 @@
glib
brightnessctl
ydotool
kitty
]}";
};
Install = {