Chnaged AGS config

This commit is contained in:
2024-04-17 23:02:37 +02:00
parent 8aa6bcd5cb
commit 7676943e69
9 changed files with 446 additions and 288 deletions

View File

@@ -0,0 +1,130 @@
env:
es2022: true
extends:
- "eslint:recommended"
- "plugin:@typescript-eslint/recommended"
parser: "@typescript-eslint/parser"
parserOptions:
ecmaVersion: 2022
sourceType: "module"
project: "./tsconfig.json"
warnOnUnsupportedTypeScriptVersion: false
root: true
ignorePatterns:
- types/
plugins:
- "@typescript-eslint"
rules:
"@typescript-eslint/ban-ts-comment":
- "off"
"@typescript-eslint/no-non-null-assertion":
- "off"
# "@typescript-eslint/no-explicit-any":
# - "off"
"@typescript-eslint/no-unused-vars":
- error
- varsIgnorePattern: (^unused|_$)
argsIgnorePattern: ^(unused|_)
"@typescript-eslint/no-empty-interface":
- "off"
arrow-parens:
- error
- as-needed
comma-dangle:
- error
- always-multiline
comma-spacing:
- error
- before: false
after: true
comma-style:
- error
- last
curly:
- error
- multi-or-nest
- consistent
dot-location:
- error
- property
eol-last:
- error
eqeqeq:
- error
- always
indent:
- error
- 4
- SwitchCase: 1
keyword-spacing:
- error
- before: true
lines-between-class-members:
- error
- always
- exceptAfterSingleLine: true
padded-blocks:
- error
- never
- allowSingleLineBlocks: false
prefer-const:
- error
quotes:
- error
- double
- avoidEscape: true
semi:
- error
- never
nonblock-statement-body-position:
- error
- below
no-trailing-spaces:
- error
no-useless-escape:
- off
max-len:
- error
- code: 100
func-call-spacing:
- error
array-bracket-spacing:
- error
space-before-function-paren:
- error
- anonymous: never
named: never
asyncArrow: ignore
space-before-blocks:
- error
key-spacing:
- error
object-curly-spacing:
- error
- always
globals:
Widget: readonly
Utils: readonly
App: readonly
Variable: readonly
Service: readonly
pkg: readonly
ARGV: readonly
Debugger: readonly
GIRepositoryGType: readonly
globalThis: readonly
imports: readonly
Intl: readonly
log: readonly
logError: readonly
print: readonly
printerr: readonly
window: readonly
TextEncoder: readonly
TextDecoder: readonly
console: readonly
setTimeout: readonly
setInterval: readonly
clearTimeout: readonly
clearInterval: readonly

View File

@@ -4,9 +4,7 @@ const { messageAsync } = await Service.import("hyprland")
const { const {
hyprland, hyprland,
theme: { theme: {
spacing,
radius, radius,
border: { width },
blur, blur,
shadows, shadows,
dark: { dark: {
@@ -21,10 +19,8 @@ const {
const deps = [ const deps = [
"hyprland", "hyprland",
spacing.id,
radius.id, radius.id,
blur.id, blur.id,
width.id,
shadows.id, shadows.id,
darkActive.id, darkActive.id,
lightActive.id, lightActive.id,
@@ -49,12 +45,10 @@ function sendBatch(batch: string[]) {
} }
async function setupHyprland() { async function setupHyprland() {
const wm_gaps = Math.floor(hyprland.gaps.value * spacing.value)
sendBatch([ sendBatch([
`general:border_size ${width}`, `general:border_size ${hyprland.borderSize.value}`,
`general:gaps_out ${wm_gaps}`, `general:gaps_out ${hyprland.gapsOut.value}`,
`general:gaps_in ${Math.floor(wm_gaps / 2)}`, `general:gaps_in ${hyprland.gapsIn.value}`,
`general:col.active_border rgba(${activeBorder()}ff)`, `general:col.active_border rgba(${activeBorder()}ff)`,
`general:col.inactive_border rgba(${hyprland.inactiveBorder.value})`, `general:col.inactive_border rgba(${hyprland.inactiveBorder.value})`,
`decoration:rounding ${radius}`, `decoration:rounding ${radius}`,

View File

@@ -71,8 +71,8 @@ export function mkOptions<T extends object>(cacheFile: string, object: T) {
Utils.ensureDirectory(cacheFile.split("/").slice(0, -1).join("/")) Utils.ensureDirectory(cacheFile.split("/").slice(0, -1).join("/"))
const configFile = `${TMP}/config.json` const configFile = `${App.configDir}/config.json`
console.log(configFile) console.log("Config file: " + configFile)
const values = getOptions(object).reduce((obj, { id, value }) => ({ [id]: value, ...obj }), {}) const values = getOptions(object).reduce((obj, { id, value }) => ({ [id]: value, ...obj }), {})
Utils.writeFileSync(JSON.stringify(values, null, 2), configFile) Utils.writeFileSync(JSON.stringify(values, null, 2), configFile)
Utils.monitorFile(configFile, () => { Utils.monitorFile(configFile, () => {

View File

@@ -4,7 +4,7 @@ import { icon } from "lib/utils"
import icons from "lib/icons" import icons from "lib/icons"
const options = mkOptions(OPTIONS, { const options = mkOptions(OPTIONS, {
autotheme: opt(false), autotheme: opt(true),
wallpaper: { wallpaper: {
resolution: opt<import("service/wallpaper").Resolution>(1920), resolution: opt<import("service/wallpaper").Resolution>(1920),
@@ -52,14 +52,14 @@ const options = mkOptions(OPTIONS, {
shadows: opt(true), shadows: opt(true),
padding: opt(7), padding: opt(7),
spacing: opt(12), spacing: opt(12),
radius: opt(11), radius: opt(14),
}, },
transition: opt(200), transition: opt(200),
font: { font: {
size: opt(13), size: opt(12),
name: opt("Ubuntu Nerd Font"), name: opt("CaskaydiaCove Nerd Font"),
}, },
bar: { bar: {
@@ -69,7 +69,7 @@ const options = mkOptions(OPTIONS, {
layout: { layout: {
start: opt<Array<import("widget/bar/Bar").BarWidget>>([ start: opt<Array<import("widget/bar/Bar").BarWidget>>([
"launcher", "launcher",
//"workspaces", "workspaces",
"taskbar", "taskbar",
"expander", "expander",
"messages", "messages",
@@ -83,8 +83,8 @@ const options = mkOptions(OPTIONS, {
"systray", "systray",
"colorpicker", "colorpicker",
"screenrecord", "screenrecord",
"system",
"battery", "battery",
"system",
"powermenu", "powermenu",
]), ]),
}, },
@@ -95,12 +95,12 @@ const options = mkOptions(OPTIONS, {
}, },
label: { label: {
colored: opt(false), colored: opt(false),
label: opt(" Applications"), label: opt(""),
}, },
action: opt(() => App.toggleWindow("launcher")), action: opt(() => App.toggleWindow("launcher")),
}, },
date: { date: {
format: opt("%H:%M - %A %e."), format: opt("%H:%M - %d.%m.%Y"),
action: opt(() => App.toggleWindow("datemenu")), action: opt(() => App.toggleWindow("datemenu")),
}, },
battery: { battery: {
@@ -116,7 +116,7 @@ const options = mkOptions(OPTIONS, {
}, },
taskbar: { taskbar: {
iconSize: opt(0), iconSize: opt(0),
monochrome: opt(true), monochrome: opt(false),
exclusive: opt(false), exclusive: opt(false),
}, },
messages: { messages: {
@@ -129,7 +129,7 @@ const options = mkOptions(OPTIONS, {
]), ]),
}, },
media: { media: {
monochrome: opt(true), monochrome: opt(false),
preferred: opt("spotify"), preferred: opt("spotify"),
direction: opt<"left" | "right">("right"), direction: opt<"left" | "right">("right"),
format: opt("{artists} - {title}"), format: opt("{artists} - {title}"),
@@ -140,7 +140,6 @@ const options = mkOptions(OPTIONS, {
action: opt(() => App.toggleWindow("powermenu")), action: opt(() => App.toggleWindow("powermenu")),
}, },
}, },
launcher: { launcher: {
width: opt(0), width: opt(0),
margin: opt(80), margin: opt(80),
@@ -156,12 +155,9 @@ const options = mkOptions(OPTIONS, {
max: opt(6), max: opt(6),
favorites: opt([ favorites: opt([
[ [
"firefox", "brave",
"org.gnome.Nautilus",
"org.gnome.Calendar", "org.gnome.Calendar",
"obsidian", "obsidian",
"discord",
"spotify",
], ],
]), ]),
}, },
@@ -170,7 +166,7 @@ const options = mkOptions(OPTIONS, {
overview: { overview: {
scale: opt(9), scale: opt(9),
workspaces: opt(7), workspaces: opt(7),
monochromeIcon: opt(true), monochromeIcon: opt(false),
}, },
powermenu: { powermenu: {
@@ -189,9 +185,9 @@ const options = mkOptions(OPTIONS, {
}, },
width: opt(380), width: opt(380),
position: opt<"left" | "center" | "right">("right"), position: opt<"left" | "center" | "right">("right"),
networkSettings: opt("gtk-launch gnome-control-center"), networkSettings: opt("nm-connection-editor"),
media: { media: {
monochromeIcon: opt(true), monochromeIcon: opt(false),
coverSize: opt(100), coverSize: opt(100),
}, },
}, },
@@ -228,12 +224,15 @@ const options = mkOptions(OPTIONS, {
notifications: { notifications: {
position: opt<Array<"top" | "bottom" | "left" | "right">>(["top", "right"]), position: opt<Array<"top" | "bottom" | "left" | "right">>(["top", "right"]),
blacklist: opt(["Spotify"]), blacklist: opt([""]),
width: opt(440), width: opt(440),
}, },
hyprland: { hyprland: {
gaps: opt(2.4), gaps: opt(2.4),
gapsIn: opt(2),
gapsOut: opt(3),
borderSize: opt(1),
inactiveBorder: opt("333333ff"), inactiveBorder: opt("333333ff"),
gapsWhenOnly: opt(false), gapsWhenOnly: opt(false),
}, },

View File

@@ -0,0 +1,19 @@
{
"name": "ags-dotfiles",
"author": "Aylur",
"kofi": "https://ko-fi.com/aylur",
"repository": {
"type": "git",
"url": "git+https://github.com/Aylur/dotfiles.git"
},
"devDependencies": {
"@girs/accountsservice-1.0": "^1.0.0-3.2.7",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"eslint": "^8.56.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"typescript": "^5.3.3"
}
}

View File

@@ -54,7 +54,7 @@ class Wallpaper extends Service {
params: { params: {
resolution: options.wallpaper.resolution.value, resolution: options.wallpaper.resolution.value,
format: "json", format: "json",
image_format: "jpg", image_format: "png",
index: "random", index: "random",
mkt: options.wallpaper.market.value, mkt: options.wallpaper.market.value,
}, },
@@ -89,9 +89,9 @@ class Wallpaper extends Service {
this.#wallpaper() this.#wallpaper()
}) })
Utils.execAsync("swww-daemon") Utils.execAsync("swww init")
.then(this.#wallpaper) .then(() => this.#wallpaper)
.catch(() => null) .catch((e) => console.warn(e))
} }
} }

View File

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

View File

@@ -59,12 +59,6 @@ const BluetoothIndicator = () => Widget.Overlay({
icon: icons.bluetooth.enabled, icon: icons.bluetooth.enabled,
visible: bluetooth.bind("enabled"), visible: bluetooth.bind("enabled"),
}), }),
overlay: Widget.Label({
hpack: "end",
vpack: "start",
label: bluetooth.bind("connected_devices").as(c => `${c.length}`),
visible: bluetooth.bind("connected_devices").as(c => c.length > 0),
}),
}) })
const NetworkIndicator = () => Widget.Icon().hook(network, self => { const NetworkIndicator = () => Widget.Icon().hook(network, self => {

View File

@@ -116,6 +116,9 @@ export default [
), ),
Page("General", icons.ui.settings, Page("General", icons.ui.settings,
Group("Hyprland", Group("Hyprland",
Row({ opt: h.gapsIn, title: "Gaps Inside" }),
Row({ opt: h.gapsOut, title: "Gaps Outside" }),
Row({ opt: h.borderSize, title: "Border Size" }),
Row({ opt: h.gapsWhenOnly, title: "Gaps When Only" }), Row({ opt: h.gapsWhenOnly, title: "Gaps When Only" }),
), ),
Group("Launcher", Group("Launcher",