updated ags config to make worky again

This commit is contained in:
Varris 2023-10-15 01:16:19 +02:00
parent 0dfd9c5694
commit fa24db296c
17 changed files with 202 additions and 183 deletions

View File

@ -49,11 +49,6 @@
flake = false;
};
grub2-themes = {
url = "github:vinceliuice/grub2-themes";
inputs.nixpkgs.follows = "nixpkgs";
};
nixd = {
url = "github:nix-community/nixd";
inputs.nixpkgs.follows = "nixpkgs";
@ -125,7 +120,6 @@
useGlobalPkgs = true;
};
}
inputs.grub2-themes.nixosModules.default
inputs.chaotic-nyx.nixosModules.default
inputs.hyprland.nixosModules.default
];

View File

@ -10,16 +10,6 @@
fonts = ["JetBrainsMono"];
};
openmw = prev.openmw.overrideAttrs (old: {
version = "9999";
src = inputs.openmw-git;
buildInputs = old.buildInputs ++ [prev.libyamlcpp prev.luajit];
patches = [];
dontWrapQtApps = false;
});
steam = prev.steam.override {
extraPkgs = prev: [
prev.libkrb5

View File

@ -24,26 +24,21 @@
"net.ifnames=0"
"amd_pstate.shared_mem=1"
"amd_pstate=active"
# "video=DP-1:2560x1440@144"
# "video=DP-2:2560x1440@144"
];
loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
grub = {
enable = true;
useOSProber = false;
efiSupport = true;
device = "nodev";
systemd-boot = {
enable = true;
configurationLimit = 5;
consoleMode = "max";
};
grub2-theme = {
enable = true;
theme = "stylish";
screen = "2k";
};
};
};
@ -51,7 +46,7 @@
networking = {
hostName = "terra"; # Define your hostname.
networkmanager.enable = true;
dhcpcd.enable = true;
firewall.enable = false;
extraHosts = ''
192.168.0.18 steam.deck

View File

@ -13,7 +13,7 @@
];
boot.initrd.availableKernelModules = ["nvme"];
boot.initrd.kernelModules = [];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
@ -22,7 +22,7 @@
fsType = "xfs";
};
fileSystems."/boot/efi" = {
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/BE4D-EFA9";
fsType = "vfat";
};

View File

@ -3,7 +3,7 @@
enable = true;
settings = {
plugins = "ftintitle fetchart embedart chroma edit replaygain badfiles fish";
plugins = "duplicates ftintitle fetchart embedart chroma edit replaygain badfiles fish";
directory = "/mnt/hdd/Music";
library = "/mnt/hdd/Music/library.db";

View File

@ -57,7 +57,7 @@
e = "nvim";
ls = "${pkgs.eza}/bin/eza --icons";
ll = "${pkgs.eza}/bin/eza --icons -l";
nf = "${pkgs.neofetch}/bin/neofetch";
nf = "${pkgs.fastfetch}/bin/fastfetch";
};
};
}

View File

@ -1,16 +1,19 @@
import Panel from './js/panel/panel.js';
import VolumeOSD from './js/volume_osd/volosd.js';
import App from 'resource:///com/github/Aylur/ags/app.js'
import { exec } from 'resource://com/github/Aylur/ags/utils.js'
const scss = ags.App.configDir + '/style.scss';
import Panel from './js/panel/panel.js';
import {
forMonitors
}
from './js/utils.js';
const scss = App.configDir + '/style.scss';
const css = '/tmp/style-ags.css';
ags.Utils.exec(`sassc ${scss} ${css}`);
exec(`sassc ${scss} ${css}`);
export default {
style: css,
windows: [
Panel(0),
Panel(1),
// VolumeOSD(),
],
forMonitors(Panel),
].flat(2),
};

View File

@ -1,3 +1,5 @@
import { Box, CenterBox, Window } from 'resource:///com/github/Aylur/ags/widget.js';
import Workspaces from './widgets/workspaces.js';
import WindowTitle from './widgets/windowTitle.js';
//
@ -7,38 +9,34 @@ import Mpris from './widgets/mpris.js'
import SysTray from './widgets/sysTray.js';
import Clock from './widgets/clock.js';
const Left = monitor => ags.Widget.Box({
const Left = monitor => Box({
children: [
Workspaces(monitor),
WindowTitle(),
Workspaces(monitor), WindowTitle(),
],
});
const Center = () => ags.Widget.Box({
const Center = () => Box({
children: [
Volume(),
Mpris('mpd')
Volume(), Mpris('mpd')
],
});
const Right = () => ags.Widget.Box({
const Right = () => Box({
halign: 'end',
children: [
SysTray(),
Clock(),
SysTray(), Clock(),
],
});
export default monitor => ags.Widget.Window({
name: `bar-${monitor}`, // name has to be unique
export default monitor => Window({
name: `bar-${monitor}`,
exclusive: true,
className: 'bar',
monitor,
anchor: ['top', 'left', 'right'],
exclusive: true,
child: ags.Widget.CenterBox({
startWidget: Left(`${monitor}`),
child: CenterBox({
startWidget: Left(monitor),
centerWidget: Center(),
endWidget: Right(),
}),
})

View File

@ -1,16 +1,19 @@
export default () => ags.Widget.Box({
import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
export default () => Box({
className: 'date',
children: [
ags.Widget.Icon({
icon: 'x-office-calendar-symbolic',
Icon({
icon: 'x-office-calendar-symbolic',
}),
ags.Widget.Label({
Label({
connections: [
[1000, label => ags.Utils.execAsync(['date', '+%a %d, %B %H:%M'])
.then(date => label.label = ' ' + date).catch(console.error)],
[1000, label => execAsync(['date', '+%a %d, %B %H:%M'])
.then(date => label.label = ' ' + date).catch(console.error)
],
],
}),
],
});

View File

@ -1,45 +1,50 @@
export default player => ags.Widget.Button({
className: 'media',
onPrimaryClick: () => ags.Service.Mpris.getPlayer(player)?.playPause(),
onScrollUp: () => ags.Service.Mpris.getPlayer(player)?.previous(),
onScrollDown: () => ags.Service.Mpris.getPlayer(player)?.next(),
import { Box, Button, Icon, Label, Stack } from 'resource:///com/github/Aylur/ags/widget.js';
import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js';
child: ags.Widget.Box({
export default player => Button({
className: 'media',
onPrimaryClick: () => Mpris.getPlayer(player)?.playPause(),
onScrollUp: () => Mpris.getPlayer(player)?.previous(),
onScrollDown: () => Mpris.getPlayer(player)?.next(),
child: Box({
children: [
ags.Widget.Stack({
Stack({
items: [
['paused', ags.Widget.Icon('media-playback-pause-symbolic')],
['playing', ags.Widget.Icon('media-playback-start-symbolic')],
['stopped', ags.Widget.Icon('media-playback-stop-symbolic')],
['paused', Icon('media-playback-pause-symbolic')],
['playing', Icon('media-playback-start-symbolic')],
['stopped', Icon('media-playback-stop-symbolic')],
],
connections: [[ags.Service.Mpris, statusIcon => {
const mpris = ags.Service.Mpris.getPlayer(player);
connections: [
[Mpris, statusIcon => {
const mpris = Mpris.getPlayer(player);
switch (mpris.playBackStatus) {
case "Playing":
statusIcon.shown = 'playing';
break;
case "Paused":
statusIcon.shown = 'paused';
break;
default:
statusIcon.shown = 'stopped';
}
}]],
switch (mpris.playBackStatus) {
case "Playing":
statusIcon.shown = 'playing';
break;
case "Paused":
statusIcon.shown = 'paused';
break;
default:
statusIcon.shown = 'stopped';
}
}]
],
}),
ags.Widget.Label({
connections: [[ags.Service.Mpris, label => {
const mpris = ags.Service.Mpris.getPlayer(player);
if (!mpris || mpris.playBackStatus == "Stopped")
label.label = ' Stopped';
else
label.label = ` ${mpris.trackArtists.join(', ')} - ${mpris.trackTitle}`;
}]],
Label({
connections: [
[Mpris, label => {
const mpris = Mpris.getPlayer(player);
if (!mpris || mpris.playBackStatus == "Stopped")
label.label = ' Stopped';
else
label.label = ` ${mpris.trackArtists.join(', ')} - ${mpris.trackTitle}`;
}]
],
}),
],
}),
})

View File

@ -1,17 +1,22 @@
export default () => ags.Widget.Box({
import { Box, Button, Icon } from 'resource:///com/github/Aylur/ags/widget.js';
import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js';
export default () => Box({
className: 'tray',
connections: [[ags.Service.SystemTray, box => {
box.children = ags.Service.SystemTray.items.map(item => ags.Widget.Button({
className: 'tray-icon',
child: ags.Widget.Icon(),
onPrimaryClick: (_, event) => item.activate(event),
onSecondaryClick: (_, event) => item.openMenu(event),
connections: [[item, button => {
button.child.icon = item.icon;
button.tooltipMarkup = item.tooltipMarkup;
}]],
}));
}]],
connections: [
[SystemTray, box => {
box.children = SystemTray.items.map(item => Button({
className: 'tray-icon',
child: Icon(),
onPrimaryClick: (_, event) => item.activate(event),
onSecondaryClick: (_, event) => item.openMenu(event),
connections: [
[item, button => {
button.child.icon = item.icon;
button.tooltipMarkup = item.tooltipMarkup;
}]
],
}));
}]
],
});

View File

@ -1,44 +1,50 @@
export default () => ags.Widget.Button({
import { Box, Button, Icon, Label, Stack } from 'resource:///com/github/Aylur/ags/widget.js';
import Audio from 'resource:///com/github/Aylur/ags/service/audio.js';
export default () => Button({
className: 'volume',
onScrollUp: () => ags.Utils.execAsync('pamixer -i 10'),
onScrollDown: () => ags.Utils.execAsync('pamixer -d 10'),
child: ags.Widget.Box({
onScrollUp: () => execAsync('pamixer -i 10'),
onScrollDown: () => execAsync('pamixer -d 10'),
child: Box({
children: [
ags.Widget.Stack({
Stack({
items: [
// tuples of [string, Widget]
['101', ags.Widget.Icon('audio-volume-overamplified-symbolic')],
['67', ags.Widget.Icon('audio-volume-high-symbolic')],
['34', ags.Widget.Icon('audio-volume-medium-symbolic')],
['1', ags.Widget.Icon('audio-volume-low-symbolic')],
['0', ags.Widget.Icon('audio-volume-muted-symbolic')],
['101', Icon('audio-volume-overamplified-symbolic')],
['67', Icon('audio-volume-high-symbolic')],
['34', Icon('audio-volume-medium-symbolic')],
['1', Icon('audio-volume-low-symbolic')],
['0', Icon('audio-volume-muted-symbolic')],
],
connections: [[ags.Service.Audio, stack => {
if (!ags.Service.Audio.speaker)
return;
connections: [
[Audio, stack => {
if (!Audio.speaker)
return;
if (ags.Service.Audio.speaker.isMuted) {
stack.shown = '0';
return;
}
if (Audio.speaker.isMuted) {
stack.shown = '0';
return;
}
const show = [101, 67, 34, 1, 0].find(
threshold => threshold <= ags.Service.Audio.speaker.volume * 100);
const show = [101, 67, 34, 1, 0].find(
threshold => threshold <= Audio.speaker.volume * 100);
stack.shown = `${show}`;
}, 'speaker-changed']],
stack.shown = `${show}`;
}, 'speaker-changed']
],
}),
ags.Widget.Label({
connections: [[ags.Service.Audio, label => {
if (!ags.Service.Audio.speaker)
return;
Label({
connections: [
[Audio, label => {
if (!Audio.speaker)
return;
label.label = ` ${Math.ceil((ags.Service.Audio.speaker.volume * 100) / 10) * 10}%`; // round up to nearest 10
}, 'speaker-changed' ]],
label.label = ` ${Math.floor((Audio.speaker.volume * 100) / 10) * 10}%`; // round down to nearest 10
}, 'speaker-changed']
],
}),
],
}),
});

View File

@ -1,8 +1,11 @@
export default () => ags.Widget.Label({
connections: [[ags.Service.Hyprland, label => {
label.label = ags.Service.Hyprland.active.client.title || '';
label.toggleClassName('windowTitle', label.label);
}]],
import { Label } from 'resource:///com/github/Aylur/ags/widget.js';
import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
export default () => Label({
connections: [
[Hyprland, label => {
label.label = Hyprland.active.client.title || '';
label.toggleClassName('windowTitle', label.label);
}]
],
});

View File

@ -1,24 +1,32 @@
export default monitor => ags.Widget.Box({
import { Box, Button, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import { execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
export default monitor => Box({
className: 'workspaces',
connections: [[ags.Service.Hyprland, box => {
if (monitor == 0) {
box.children = [1,2,3].map(i => ags.Widget.Button({
onClicked: () => ags.Utils.execAsync(`hyprctl dispatch workspace ${i}`),
onScrollDown: () => ags.Utils.execAsync(`hyprctl dispatch workspace +1`),
onScrollUp: () => ags.Utils.execAsync(`hyprctl dispatch workspace -1`),
child: ags.Widget.Label({ label: `${i}` }),
className: ags.Service.Hyprland.active.workspace.id == i ? 'focused' : '',
}));
} else if (monitor == 1) {
box.children = [4,5,6].map(i => ags.Widget.Button({
onClicked: () => ags.Utils.execAsync(`hyprctl dispatch workspace ${i}`),
onScrollDown: () => ags.Utils.execAsync(`hyprctl dispatch workspace +1`),
onScrollUp: () => ags.Utils.execAsync(`hyprctl dispatch workspace -1`),
child: ags.Widget.Label({ label: `${i}` }),
className: ags.Service.Hyprland.active.workspace.id == i ? 'focused' : '',
}));
}
}]],
connections: [
[Hyprland, box => {
if (monitor == 0) {
box.children = [1, 2, 3].map(i => Button({
onClicked: () => execAsync(`hyprctl dispatch workspace ${i}`),
onScrollDown: () => execAsync(`hyprctl dispatch workspace +1`),
onScrollUp: () => execAsync(`hyprctl dispatch workspace -1`),
child: Label({
label: `${i}`
}),
className: Hyprland.active.workspace.id == i ? 'focused' : '',
}));
} else if (monitor == 1) {
box.children = [4, 5, 6].map(i => Button({
onClicked: () => execAsync(`hyprctl dispatch workspace ${i}`),
onScrollDown: () => execAsync(`hyprctl dispatch workspace +1`),
onScrollUp: () => execAsync(`hyprctl dispatch workspace -1`),
child: Label({
label: `${i}`
}),
className: Hyprland.active.workspace.id == i ? 'focused' : '',
}));
}
}]
],
});

View File

@ -0,0 +1,6 @@
import { exec } from 'resource:///com/github/Aylur/ags/utils.js'
export function forMonitors(widget) {
const ws = JSON.parse(exec('hyprctl -j monitors'));
return ws.map(mon => widget(mon.id));
}

View File

@ -1,10 +1,15 @@
export default () => ags.Widget.Window({
const {
Label,
Window
} = ags.Widget;
export default () => Window({
name: `volume-osd`,
className: `osd`,
monitor: null,
focusable: false,
anchor: [ 'center' ],
anchor: ['center'],
popup: true,
child: ags.Widget.Label('hello world'),
})
child: Label('hello world'),
})

View File

@ -6,16 +6,14 @@
}: let
leftMonitor = {
display = "DP-2";
res = "2560x1440";
pos = "-2560x0";
refreshRate = "144";
res = "preferred";
pos = "0x0";
};
rightMonitor = {
display = "DP-1";
res = "2560x1440";
pos = "0x0";
refreshRate = "144";
res = "preferred";
pos = "2560x0";
};
modKey = "SUPER";
@ -66,8 +64,8 @@ in {
wayland.windowManager.hyprland = {
enable = true;
extraConfig = ''
monitor=${leftMonitor.display}, ${leftMonitor.res}@${leftMonitor.refreshRate}, ${leftMonitor.pos}, 1
monitor=${rightMonitor.display}, ${rightMonitor.res}@${rightMonitor.refreshRate}, ${rightMonitor.pos}, 1
monitor=${leftMonitor.display}, ${leftMonitor.res}, ${leftMonitor.pos}, 1
monitor=${rightMonitor.display}, ${rightMonitor.res}, ${rightMonitor.pos}, 1
workspace = 1, monitor:${rightMonitor.display}
workspace = 2, monitor:${rightMonitor.display}
@ -138,7 +136,7 @@ in {
exec-once = ${pkgs.openrgb}/bin/openrgb --startminimized --profile autorun.orp
exec-once = ${pkgs.blueman}/bin/blueman-applet
exec-once = ${pkgs.networkmanagerapplet}/bin/nm-applet --indicator
# exec-once = ${pkgs.networkmanagerapplet}/bin/nm-applet --indicator
exec-once = ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1
# exec-once = ${pkgs.mullvad-vpn}/bin/mullvad-gui
exec-once = ${pkgs.ydotool}/bin/ydotoold