This commit is contained in:
Varris 2023-09-25 15:30:25 +02:00
parent c131ce4037
commit 90d81d4185
9 changed files with 195 additions and 110 deletions

View File

@ -12,7 +12,8 @@
kernel.sysctl."vm.max_map_count" = 16777216; #Star Citizen crash fix
kernelPackages = pkgs.linuxPackages_latest;
#kernelPackages = pkgs.linuxPackages_latest;
supportedFilesystems = [ "bcachefs" ];
kernelModules = [ "i2c-dev" "i2c-piix4" ];
kernelParams =
[
@ -25,7 +26,7 @@
loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
efiSysMountPoint = "/boot";
};
grub = {

View File

@ -8,41 +8,32 @@
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "bcache" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/f2c5e4e6-b94c-496a-90ef-0f77b8e5c645";
fsType = "btrfs";
options = [ "subvol=@nixos" "compress-force=zstd" ];
{ device = "/dev/nvme1n1p2";
fsType = "bcachefs";
};
fileSystems."/boot/efi" =
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/BE4D-EFA9";
fsType = "vfat";
};
fileSystems."/mnt/btrfs" =
{ device = "/dev/disk/by-uuid/f2c5e4e6-b94c-496a-90ef-0f77b8e5c645";
fsType = "btrfs";
};
fileSystems."/mnt/hdd" =
{ device = "/dev/disk/by-uuid/ecbbfb05-ada8-4044-81a6-9a280f93802f";
fsType = "xfs";
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/4dd7a8ea-311a-458b-8839-1d92c7abab1f";
fsType = "xfs";
{ device = "/dev/disk/by-uuid/4af74e31-5ec6-4244-bb1e-192df0b8a175";
fsType = "ext4";
};
swapDevices = [ {
device = "/var/lib/swapfile";
size = 16*1024;
} ];
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -0,0 +1,6 @@
vim.opt.list = true
vim.opt.listchars:append "eol:↴"
require("indent_blankline").setup {
show_end_of_line = true,
}

View File

@ -5,6 +5,7 @@ require("plugins.colorizer")
require("plugins.colorscheme")
require("plugins.comment")
require("plugins.dressing")
require("plugins.indent-blankline")
require("plugins.lspconfig")
require("plugins.lualine")
require("plugins.smartsplits")

View File

@ -2,8 +2,8 @@ vim.g.mapleader = " "
-- 4 space tabs
vim.o.expandtab = true
vim.o.shiftwidth = 2
vim.o.tabstop = 2
vim.o.shiftwidth = 4
vim.o.tabstop = 4
vim.o.smartindent = true
vim.o.background = "dark"

View File

@ -8,6 +8,7 @@
gruvbox-nvim
comment-nvim
dressing-nvim
indent-blankline-nvim
lualine-nvim
luasnip
neo-tree-nvim

View File

@ -1,114 +1,183 @@
const { Widget } = ags.Widget;
const { Mpris, Hyprland, SystemTray } = ags.Service;
const { Mpris, Hyprland, SystemTray, Audio } = ags.Service;
const { execAsync } = ags.Utils;
const { Box, Button, Label, Icon, CenterBox, Window } = Widget;
const { Box, Button, Label, Icon, CenterBox, Stack, Window } = ags.Widget;
const Workspaces = (monitor) => Box({
className: 'workspaces',
connections: [[Hyprland, box => {
if (monitor == 0) {
box.children = [1,2,3].map(i => Button({
onClicked: () => execAsync(`hyprctl dispatch workspace ${i}`),
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}`),
child: Label({ label: `${i}` }),
className: Hyprland.active.workspace.id == i ? 'focused' : '',
}));
}
}]],
className: 'workspaces',
connections: [[Hyprland, box => {
if (monitor == 0) {
box.children = [1,2,3].map(i => Button({
onClicked: () => execAsync(`hyprctl dispatch workspace ${i}`),
onScrollUp: () => execAsync(`hyprctl dispatch workspace +1`),
onScrollDown: () => 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}`),
onScrollUp: () => execAsync(`hyprctl dispatch workspace +1`),
onScrollDown: () => execAsync(`hyprctl dispatch workspace -1`),
child: Label({ label: `${i}` }),
className: Hyprland.active.workspace.id == i ? 'focused' : '',
}));
}
}]],
});
const WindowTitle = () => Label({
connections: [[Hyprland, label => {
label.label = Hyprland.active.client.title || '';
label.toggleClassName('windowTitle', label.label);
}]],
connections: [[Hyprland, label => {
label.label = Hyprland.active.client.title || '';
label.toggleClassName('windowTitle', label.label);
}]],
});
const Volume = () => Button({
className: 'volume',
onScrollUp: () => execAsync('pamixer -i 10'),
onScrollDown: () => execAsync('pamixer -d 10'),
child: Box({
children: [
Stack({
items: [
// tuples of [string, Widget]
['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: [[Audio, stack => {
if (!Audio.speaker)
return;
if (Audio.speaker.isMuted) {
stack.shown = '0';
return;
}
const show = [101, 67, 34, 1, 0].find(
threshold => threshold <= Audio.speaker.volume * 100);
stack.shown = `${show}`;
}, 'speaker-changed']],
}),
Label({
connections: [[Audio, label => {
label.label = ` ${Math.ceil((Audio.speaker.volume * 100) / 10) * 10}%`; // round up to nearest 10
}, 'speaker-changed' ]],
}),
],
}),
});
const Media = () => Button({
className: 'media',
onPrimaryClick: () => Mpris.getPlayer('mpd')?.playPause(),
onScrollUp: () => Mpris.getPlayer('mpd')?.previous(),
onScrollDown: () => Mpris.getPlayer('mpd')?.next(),
child: Label({
connections: [[Mpris, label => {
const mpris = Mpris.getPlayer('mpd');
if (!mpris || mpris.playBackStatus == "Stopped")
label.label = ' Stopped';
else
label.label = `${mpris.playBackStatus == 'Playing' ? ' ' : '󰏤 '}${mpris.trackArtists.join(', ')} - ${mpris.trackTitle}`;
}]],
}),
});
className: 'media',
onPrimaryClick: () => Mpris.getPlayer('mpd')?.playPause(),
onScrollUp: () => Mpris.getPlayer('mpd')?.previous(),
onScrollDown: () => Mpris.getPlayer('mpd')?.next(),
child: Box({
children: [
Stack({
items: [
['paused', Icon('media-playback-pause-symbolic')],
['playing', Icon('media-playback-start-symbolic')],
['stopped', Icon('media-playback-stop-symbolic')],
],
connections: [[Mpris, stack => {
const mpris = Mpris.getPlayer('mpd');
if (mpris.playBackStatus == 'Playing')
stack.shown = 'playing';
else if (mpris.playBackStatus == 'Paused')
stack.shown = 'paused';
else
stack.shown = 'stopped';
}]],
}),
Label({
connections: [[Mpris, label => {
const mpris = Mpris.getPlayer('mpd');
if (!mpris || mpris.playBackStatus == "Stopped")
label.label = ' Stopped';
else
label.label = ` ${mpris.trackArtists.join(', ')} - ${mpris.trackTitle}`;
}]],
}),
],
}),
})
const SysTray = () => Box({
className: 'tray',
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;
}]],
}));
}]],
className: 'tray',
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;
}]],
}));
}]],
});
const Clock = () => Box({
className: 'date',
children: [
Label({
label: ' ',
}),
Label({
connections: [
[1000, label => execAsync(['date', '+%a %d, %B %H:%M'])
.then(date => label.label = date).catch(console.error)],
],
}),
],
className: 'date',
children: [
Icon({
icon: 'x-office-calendar-symbolic',
}),
Label({
connections: [
[1000, label => execAsync(['date', '+%a %d, %B %H:%M'])
.then(date => label.label = ' ' + date).catch(console.error)],
],
}),
],
});
const Left = (monitor) => Box({
children: [
Workspaces(monitor),
WindowTitle(),
],
children: [
Workspaces(monitor),
WindowTitle(),
],
});
const Center = () => Box({
children: [
Media(),
],
children: [
Volume(),
Media(),
],
});
const Right = () => Box({
halign: 'end',
children: [
Clock(),
SysTray(),
],
halign: 'end',
children: [
Clock(),
SysTray(),
],
});
const Bar = ({ monitor } = {}) => Window({
name: `bar-${monitor}`, // name has to be unique
className: 'bar',
monitor,
anchor: ['top', 'left', 'right'],
exclusive: true,
child: CenterBox({
startWidget: Left(`${monitor}`),
centerWidget: Center(),
endWidget: Right(),
}),
name: `bar-${monitor}`, // name has to be unique
className: 'bar',
monitor,
anchor: ['top', 'left', 'right'],
exclusive: true,
child: CenterBox({
startWidget: Left(`${monitor}`),
centerWidget: Center(),
endWidget: Right(),
}),
})
const scss = ags.App.configDir + '/style.scss';
@ -116,9 +185,9 @@ const css = '/tmp/style-ags.css';
ags.Utils.exec(`sassc ${scss} ${css}`);
export default {
style: css,
windows: [
Bar({monitor: 0}),
Bar({monitor: 1}),
],
style: css,
windows: [
Bar({monitor: 0}),
Bar({monitor: 1}),
],
};

View File

@ -33,8 +33,16 @@ $box-bg: rgb(80,73,69);
}
.workspaces button.focused {
background-color: $activewsbg;
border-radius: 0px;
background-color: $activewsbg;
}
.workspaces button:first-child {
border-radius: 10px 0px 0px 10px;
}
.workspaces button:last-child {
border-radius: 0px 10px 10px 0px;
}
.windowTitle {
@ -44,6 +52,13 @@ $box-bg: rgb(80,73,69);
margin: 5px 0px 5px 10px;
}
.volume {
background-color: $box-bg;
border-radius: 10px 0px 0px 10px;
padding: 0px 10px 0px 10px;
margin: 5px 5px 5px 0px;
}
.media {
background-color: $box-bg;
border-radius: 0px 10px 10px 0px;

View File

@ -51,6 +51,7 @@
pavucontrol
playerctl
protontricks
pulsemixer
qbittorrent
qt5ct
samba