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 Clock from "../../misc/Clock.js";
import PanelButton from "../PanelButton.js"; import PanelButton from "../PanelButton.js";
export default ({ format = "%H:%M - %A %e." } = {}) => export default ({ format = "%R - %x" } = {}) =>
PanelButton({ PanelButton({
class_name: "dashboard panel-button", class_name: "dashboard panel-button",
on_clicked: () => App.toggleWindow("dashboard"), on_clicked: () => App.toggleWindow("dashboard"),

View File

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

View File

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

View File

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

View File

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

View File

@@ -16,6 +16,7 @@ export function init() {
warnOnLowBattery(); warnOnLowBattery();
globals(); globals();
tmux(); tmux();
kitty();
gsettigsColorScheme(); gsettigsColorScheme();
gtkFontSettings(); gtkFontSettings();
dependandOptions(); 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() { function tmux() {
if (!Utils.exec("which tmux")) return; if (!Utils.exec("which tmux")) return;

View File

@@ -21,15 +21,28 @@ export const WP = App.configDir + "/assets/";
export const lightColors = { export const lightColors = {
"theme.scheme": "light", "theme.scheme": "light",
"color.red": "#e55f86", "color.red": "#d20f39",
"color.green": "#00D787", "color.green": "#40a02b",
"color.yellow": "#EBFF71", "color.yellow": "#df8e1d",
"color.blue": "#51a4e7", "color.blue": "#1e66f5",
"color.magenta": "#9077e7", "color.magenta": "#8839ef",
"color.teal": "#51e6e6", "color.teal": "#179299",
"color.orange": "#E79E64", "color.orange": "#fe640b",
"theme.bg": "#fffffa", "theme.bg": "transparentize(#eff1f5, 0.3)",
"theme.fg": "#141414", "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 }) => ({ export const Theme = ({ name, icon = " ", ...options }) => ({

View File

@@ -13,13 +13,7 @@ export function initWallpaper() {
export function wallpaper() { export function wallpaper() {
if (!dependencies(["swww"])) return; if (!dependencies(["swww"])) return;
execAsync([ execAsync(["swww", "img", options.desktop.wallpaper.img.value]).catch((err) =>
"swww", console.error(err),
"img", );
"--transition-type",
"grow",
"--transition-pos",
exec("hyprctl cursorpos").replace(" ", ""),
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 * A Theme is a set of options that will be applied
* ontop of the default values. see options.js for possible options * 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 [ export default [
Theme({ Theme({
name: "Kitty Dark", name: "Latte",
icon: "󰄛", icon: "󰄛",
"desktop.screen_corners": false, "desktop.screen_corners": false,
"bar.style": "floating", "bar.style": "floating",
"desktop.wallpaper.img": WP + "Lakeside-2-1.jpg", "desktop.wallpaper.img": WP + "Lakeside-2-1.jpg",
...darkColors,
}), }),
Theme({ Theme({
name: "Kitty Light", name: "Frappe",
icon: "󰄛", icon: "󰄛",
"desktop.screen_corners": false, "desktop.screen_corners": false,
"bar.style": "floating", "bar.style": "floating",
@@ -22,7 +23,7 @@ export default [
"theme.widget.bg": "$accent", "theme.widget.bg": "$accent",
"theme.widget.opacity": 64, "theme.widget.opacity": 64,
}), }),
Theme({ /*Theme({
name: "Leaves", name: "Leaves",
icon: "󰌪", icon: "󰌪",
"desktop.wallpaper.img": WP + "leaves.jpg", "desktop.wallpaper.img": WP + "leaves.jpg",
@@ -66,5 +67,5 @@ export default [
"theme.bg": "transparentize(#171717, 0.3)", "theme.bg": "transparentize(#171717, 0.3)",
"theme.widget.opacity": 95, "theme.widget.opacity": 95,
"bar.flat_buttons": false, "bar.flat_buttons": false,
}), }),*/
]; ];

View File

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

View File

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

View File

@@ -148,7 +148,7 @@
programs.hyprland.enable = true; programs.hyprland.enable = true;
programs.fish.enable = true; programs.fish.enable = true;
security.sudo.configFile = '' security.sudo.configFile = ''
Defaults env_reset,pwfeedback,insults,passprompt="󰟵 " Defaults env_reset,pwfeedback,passprompt="󰟵 "
''; '';
users.defaultUserShell = pkgs.fish; users.defaultUserShell = pkgs.fish;
users.users.${username} = { users.users.${username} = {