From 90d81d418542adaa14b32f2501327ebc4fd3c0d8 Mon Sep 17 00:00:00 2001 From: Varris Date: Mon, 25 Sep 2023 15:30:25 +0200 Subject: [PATCH] update --- system/configuration.nix | 5 +- system/hardware-configuration.nix | 23 +- .../config/lua/plugins/indent-blankline.lua | 6 + .../neovim/config/lua/plugins/init.lua | 1 + user/configs/neovim/config/lua/settings.lua | 4 +- user/configs/neovim/default.nix | 1 + user/configs/wayland/ags/ags-config/config.js | 247 +++++++++++------- .../configs/wayland/ags/ags-config/style.scss | 17 +- user/home.nix | 1 + 9 files changed, 195 insertions(+), 110 deletions(-) create mode 100755 user/configs/neovim/config/lua/plugins/indent-blankline.lua diff --git a/system/configuration.nix b/system/configuration.nix index 81ab37c..6cd7a6a 100755 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -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 = { diff --git a/system/hardware-configuration.nix b/system/hardware-configuration.nix index 0d95178..05616ee 100644 --- a/system/hardware-configuration.nix +++ b/system/hardware-configuration.nix @@ -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 diff --git a/user/configs/neovim/config/lua/plugins/indent-blankline.lua b/user/configs/neovim/config/lua/plugins/indent-blankline.lua new file mode 100755 index 0000000..bbce58f --- /dev/null +++ b/user/configs/neovim/config/lua/plugins/indent-blankline.lua @@ -0,0 +1,6 @@ +vim.opt.list = true +vim.opt.listchars:append "eol:↴" + +require("indent_blankline").setup { + show_end_of_line = true, +} diff --git a/user/configs/neovim/config/lua/plugins/init.lua b/user/configs/neovim/config/lua/plugins/init.lua index c1dfa16..2d6c200 100755 --- a/user/configs/neovim/config/lua/plugins/init.lua +++ b/user/configs/neovim/config/lua/plugins/init.lua @@ -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") diff --git a/user/configs/neovim/config/lua/settings.lua b/user/configs/neovim/config/lua/settings.lua index a361f47..59fdc7a 100755 --- a/user/configs/neovim/config/lua/settings.lua +++ b/user/configs/neovim/config/lua/settings.lua @@ -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" diff --git a/user/configs/neovim/default.nix b/user/configs/neovim/default.nix index 3ab3177..a4b006e 100755 --- a/user/configs/neovim/default.nix +++ b/user/configs/neovim/default.nix @@ -8,6 +8,7 @@ gruvbox-nvim comment-nvim dressing-nvim + indent-blankline-nvim lualine-nvim luasnip neo-tree-nvim diff --git a/user/configs/wayland/ags/ags-config/config.js b/user/configs/wayland/ags/ags-config/config.js index cc35e89..8413e28 100644 --- a/user/configs/wayland/ags/ags-config/config.js +++ b/user/configs/wayland/ags/ags-config/config.js @@ -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}), + ], }; diff --git a/user/configs/wayland/ags/ags-config/style.scss b/user/configs/wayland/ags/ags-config/style.scss index f6ec9b3..390410a 100644 --- a/user/configs/wayland/ags/ags-config/style.scss +++ b/user/configs/wayland/ags/ags-config/style.scss @@ -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; diff --git a/user/home.nix b/user/home.nix index dfd4fc9..12db25f 100755 --- a/user/home.nix +++ b/user/home.nix @@ -51,6 +51,7 @@ pavucontrol playerctl protontricks + pulsemixer qbittorrent qt5ct samba