removed ags

This commit is contained in:
Charlie Root 2024-08-09 16:09:22 +02:00
commit fbf6edb219
14 changed files with 24 additions and 350 deletions

View file

@ -85,9 +85,6 @@
# Stylix my beloved
stylix.url = "github:danth/stylix";
# Aylur's gtk shell. Nice but I hate JS.
ags.url = "github:Aylur/ags";
quickshell = {
url = "git+https://git.outfoxxed.me/outfoxxed/quickshell";
inputs.nixpkgs.follows = "nixpkgs";

View file

@ -23,7 +23,7 @@
programs.kdeconnect.enable = true;
programs.dconf.enable = true;
virtualisation.docker.enable = true;
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
boot.kernelPackages = pkgs.linuxPackages_latest;
modules = {
system = {
programs = {

View file

@ -1,10 +1,8 @@
_: {
imports = [
./vesktop.nix
./gtk.nix
./foot.nix
./mpv.nix
./qt.nix
./zathura.nix
./spicetify.nix
./kitty.nix

View file

@ -161,7 +161,7 @@ in {
security = {
sanitizeOnShutdown = false;
sandbox = true;
sandbox = false;
noSessionRestore = false;
userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0";
};
@ -173,14 +173,14 @@ in {
# taken from diniamo
settings = {
# "gfx.webrender.all" = true;
# "media.ffmpeg.vaapi.enabled" = true;
"gfx.webrender.all" = true;
"media.ffmpeg.vaapi.enabled" = true;
# "media.rdd-ffmpeg.enabled" = true;
# "media.av1.enabled" = true;
# "gfx.x11-egl.force-enabled" = true;
# "widget.dmabuf.force-enabled" = true;
# "layers.acceleration.force-enabled" = true;
"layers.acceleration.force-enabled" = true;
"browser.ctrlTab.sortByRecentlyUsed" = true;
# This makes websites prefer a dark theme (in theory)

View file

@ -5,7 +5,6 @@
...
}:
with lib; let
inherit (config.modules.other.system) username;
cfg = config.modules.programs.steam;
in {
options.modules.programs.steam = {
@ -16,15 +15,13 @@ in {
config = mkIf cfg.enable {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
# remotePlay.openFirewall = true;
# dedicatedServer.openFirewall = true;
gamescopeSession.enable = mkIf cfg.gamescope true;
extraCompatPackages = with pkgs; [proton-ge-bin];
};
# See
# https://wiki.nixos.org/wiki/GameMode
programs.gamemode.enable = true;
# environment.systemPackages = [pkgs.protonup-ng];
environment.sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/${username}/.steam/root/compatibilitytoolds.d";
};
};
}

View file

@ -1,42 +0,0 @@
{
inputs,
lib,
config,
pkgs,
...
}
: let
inherit (config.modules.other.system) username;
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.programs.ags;
in {
options.modules.programs.ags.enable = mkEnableOption "ags";
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
ags
bun
ddcutil
brightnessctl
gtksourceview
webkitgtk
gtksourceview4
ollama
python311Packages.material-color-utilities
python311Packages.pywayland
pywal
sassc
webp-pixbuf-loader
ydotool
accountsservice
];
home-manager.users.${username} = {
imports = [inputs.ags.homeManagerModules.default];
programs.ags = {
enable = true;
configDir = ./config;
};
};
};
}

View file

@ -1,21 +0,0 @@
const main = "/tmp/ags/main.js";
try {
await Utils.execAsync([
"bun",
"build",
`${App.configDir}/main.ts`,
"--outfile",
main,
"--external",
"resource://*",
"--external",
"gi://*",
"--external",
"file://*",
]);
await import(`file://${main}`);
} catch (error) {
console.error(error);
App.quit();
}

View file

@ -1,219 +0,0 @@
const hyprland = await Service.import("hyprland")
const notifications = await Service.import("notifications")
const mpris = await Service.import("mpris")
const audio = await Service.import("audio")
const battery = await Service.import("battery")
const systemtray = await Service.import("systemtray")
const date = Variable("", {
poll: [1000, 'date "+%H:%M:%S %b %e."'],
})
// widgets can be only assigned as a child in one container
// so to make a reuseable widget, make it a function
// then you can simply instantiate one by calling it
function Workspaces() {
const activeId = hyprland.active.workspace.bind("id")
const workspaces = hyprland.bind("workspaces")
.as(ws => ws.map(({ id }) => Widget.Button({
on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`),
child: Widget.Label(`${id}`),
class_name: activeId.as(i => `${i === id ? "focused" : ""}`),
})))
return Widget.Box({
class_name: "workspaces",
children: workspaces,
})
}
function ClientTitle() {
return Widget.Label({
class_name: "client-title",
label: hyprland.active.client.bind("title"),
})
}
function Clock() {
return Widget.Label({
class_name: "clock",
label: date.bind(),
})
}
// we don't need dunst or any other notification daemon
// because the Notifications module is a notification daemon itself
function Notification() {
const popups = notifications.bind("popups")
return Widget.Box({
class_name: "notification",
visible: popups.as(p => p.length > 0),
children: [
Widget.Icon({
icon: "preferences-system-notifications-symbolic",
}),
Widget.Label({
label: popups.as(p => p[0]?.summary || ""),
}),
],
})
}
function Media() {
const label = Utils.watch("", mpris, "player-changed", () => {
if (mpris.players[0]) {
const { track_artists, track_title } = mpris.players[0]
return `${track_artists.join(", ")} - ${track_title}`
} else {
return "Nothing is playing"
}
})
return Widget.Button({
class_name: "media",
on_primary_click: () => mpris.getPlayer("")?.playPause(),
on_scroll_up: () => mpris.getPlayer("")?.next(),
on_scroll_down: () => mpris.getPlayer("")?.previous(),
child: Widget.Label({ label }),
})
}
function Volume() {
const icons = {
101: "overamplified",
67: "high",
34: "medium",
1: "low",
0: "muted",
}
function getIcon() {
const icon = audio.speaker.is_muted ? 0 : [101, 67, 34, 1, 0].find(
threshold => threshold <= audio.speaker.volume * 100)
return `audio-volume-${icons[icon]}-symbolic`
}
const icon = Widget.Icon({
icon: Utils.watch(getIcon(), audio.speaker, getIcon),
})
const slider = Widget.Slider({
hexpand: true,
draw_value: false,
on_change: ({ value }) => audio.speaker.volume = value,
setup: self => self.hook(audio.speaker, () => {
self.value = audio.speaker.volume || 0
}),
})
return Widget.Box({
class_name: "volume",
css: "min-width: 180px",
children: [icon, slider],
})
}
function BatteryLabel() {
const value = battery.bind("percent").as(p => p > 0 ? p / 100 : 0)
const icon = battery.bind("percent").as(p =>
`battery-level-${Math.floor(p / 10) * 10}-symbolic`)
return Widget.Box({
class_name: "battery",
visible: battery.bind("available"),
children: [
Widget.Icon({ icon }),
Widget.LevelBar({
widthRequest: 140,
vpack: "center",
value,
}),
],
})
}
function SysTray() {
const items = systemtray.bind("items")
.as(items => items.map(item => Widget.Button({
child: Widget.Icon({ icon: item.bind("icon") }),
on_primary_click: (_, event) => item.activate(event),
on_secondary_click: (_, event) => item.openMenu(event),
tooltip_markup: item.bind("tooltip_markup"),
})))
return Widget.Box({
children: items,
})
}
// layout of the bar
function Left() {
return Widget.Box({
spacing: 8,
children: [
Workspaces(),
ClientTitle(),
],
})
}
function Center() {
return Widget.Box({
spacing: 8,
children: [
Media(),
Notification(),
],
})
}
function Right() {
return Widget.Box({
hpack: "end",
spacing: 8,
children: [
Volume(),
BatteryLabel(),
Clock(),
SysTray(),
],
})
}
function Bar(monitor = 0) {
return Widget.Window({
name: `bar-${monitor}`, // name has to be unique
class_name: "bar",
monitor,
anchor: ["top", "left", "right"],
exclusivity: "exclusive",
child: Widget.CenterBox({
start_widget: Left(),
center_widget: Center(),
end_widget: Right(),
}),
})
}
App.config({
style: "./style.css",
windows: [
Bar(),
// you can call it, for each monitor
// Bar(0),
// Bar(1)
],
})
export { }

View file

@ -1,40 +0,0 @@
window.bar {
background-color: @theme_bg_color;
color: @theme_fg_color;
}
button {
min-width: 0;
padding-top: 0;
padding-bottom: 0;
background-color: transparent;
}
button:active {
background-color: @theme_selected_bg_color;
}
button:hover {
border-bottom: 3px solid @theme_fg_color;
}
label {
font-weight: bold;
}
.workspaces button.focused {
border-bottom: 3px solid @theme_selected_bg_color;
}
.client-title {
color: @theme_selected_bg_color;
}
.notification {
color: yellow;
}
levelbar block,
highlight {
min-height: 10px;
}

View file

@ -1,7 +1,8 @@
_: {
imports = [
./ags.nix
./stylix.nix
./quickshell
./qt.nix
./gtk.nix
];
}

View file

@ -1,9 +1,11 @@
{config, ...}: {
services.xserver.videoDrivers = ["nvidia"];
hardware.graphics = {
hardware = {
opengl.enable = true;
graphics = {
enable = true;
};
hardware.nvidia = {
nvidia = {
modesetting.enable = true;
open = false;
powerManagement.enable = true;
@ -11,4 +13,5 @@
nvidiaSettings = false;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
};
}