refactor(hyprland): move scripts to the hyprland configuration
This commit is contained in:
parent
f75542ade9
commit
cc8717c4ae
|
@ -70,71 +70,6 @@
|
||||||
source = ./scripts;
|
source = ./scripts;
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
".local/share/scripts/hyprland/start_services.sh" = {
|
|
||||||
executable = true;
|
|
||||||
text = # sh
|
|
||||||
''
|
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
#
|
|
||||||
# Make sure xdg-desktop-portal-hyprland has access to what it needs
|
|
||||||
#
|
|
||||||
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start waybar.
|
|
||||||
#
|
|
||||||
waybar &
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start xwaylandvideobridge
|
|
||||||
#
|
|
||||||
xwaylandvideobridge &
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start wallpaper daemon
|
|
||||||
#
|
|
||||||
~/.local/share/scripts/wallpaper.sh &
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start notification daemon.
|
|
||||||
#
|
|
||||||
mako &
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start polkit agent
|
|
||||||
#
|
|
||||||
${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start kwallet service
|
|
||||||
#
|
|
||||||
kwalletd6 &
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start kdeconnect daemon
|
|
||||||
#
|
|
||||||
kdeconnectd &
|
|
||||||
|
|
||||||
#
|
|
||||||
# Clipboard manager
|
|
||||||
#
|
|
||||||
wl-paste --type text --watch cliphist store &
|
|
||||||
wl-paste --type image --watch cliphist store &
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start Fcitx5
|
|
||||||
#
|
|
||||||
fcitx5 &
|
|
||||||
|
|
||||||
#
|
|
||||||
# Start the blueman applet for managing bluetooth devices
|
|
||||||
#
|
|
||||||
blueman-applet &
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Configure XDG
|
# Configure XDG
|
||||||
|
|
|
@ -1,7 +1,16 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
options.modules.hyprland.extraConfig = lib.mkOption {
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.hyprland;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.modules.hyprland = {
|
||||||
|
extraConfig = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "";
|
default = "";
|
||||||
example = # hyprlang
|
example = # hyprlang
|
||||||
|
@ -12,6 +21,12 @@
|
||||||
description = "Configuration to be appended to my own.";
|
description = "Configuration to be appended to my own.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
scripts = {
|
||||||
|
screenshot.enable = lib.mkEnableOption "screenshot";
|
||||||
|
startup.enable = lib.mkEnableOption "startup";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
xdg.configFile."hypr/frappe.conf".source = builtins.fetchurl {
|
xdg.configFile."hypr/frappe.conf".source = builtins.fetchurl {
|
||||||
url = "https://raw.githubusercontent.com/catppuccin/hyprland/main/themes/frappe.conf";
|
url = "https://raw.githubusercontent.com/catppuccin/hyprland/main/themes/frappe.conf";
|
||||||
|
@ -138,11 +153,23 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Set-up the scripts for services and apps.
|
||||||
|
home.packages = lib.mkIf cfg.scripts.startup.enable [
|
||||||
|
(import ./scripts/start_services.nix pkgs)
|
||||||
|
(import ./scripts/start_apps.nix pkgs)
|
||||||
|
];
|
||||||
|
|
||||||
|
# Then add the hyprland screenshot scripts.
|
||||||
|
xdg.dataFile = lib.mkIf cfg.scripts.screenshot.enable {
|
||||||
|
"scripts/hyprland/screenshot.sh".source = ./scripts/screenshot.sh;
|
||||||
|
"scripts/hyprland/screenshot_area.sh".source = ./scripts/screenshot_area.sh;
|
||||||
|
};
|
||||||
|
|
||||||
# Configure hyprland - we enable it in NixOS.
|
# Configure hyprland - we enable it in NixOS.
|
||||||
xdg.configFile."hypr/hyprland.conf".text = # hyprlang
|
xdg.configFile."hypr/hyprland.conf".text = # hyprlang
|
||||||
''
|
''
|
||||||
source = $HOME/.config/hypr/frappe.conf
|
source = $HOME/.config/hypr/frappe.conf
|
||||||
${config.modules.hyprland.extraConfig}
|
${cfg.extraConfig}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Please note not all available settings / options are set here.
|
# Please note not all available settings / options are set here.
|
||||||
|
@ -157,10 +184,10 @@
|
||||||
exec-once = /etc/profiles/per-user/wizardlink/etc/profile.d/hm-session-vars.sh
|
exec-once = /etc/profiles/per-user/wizardlink/etc/profile.d/hm-session-vars.sh
|
||||||
|
|
||||||
# Start the core services of my desktop
|
# Start the core services of my desktop
|
||||||
exec-once = ~/.local/share/scripts/hyprland/start_services.sh
|
exec-once = start_services
|
||||||
|
|
||||||
# Open the apps I always use
|
# Open the apps I always use
|
||||||
exec-once = ~/.local/share/scripts/hyprland/start_apps.sh
|
exec-once = start_apps
|
||||||
|
|
||||||
# Set cursor size.
|
# Set cursor size.
|
||||||
env = HYPRCURSOR_SIZE, 36
|
env = HYPRCURSOR_SIZE, 36
|
||||||
|
|
15
modules/home-manager/programs/hyprland/scripts/start_apps.nix
Executable file
15
modules/home-manager/programs/hyprland/scripts/start_apps.nix
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
pkgs:
|
||||||
|
|
||||||
|
pkgs.writeShellScriptBin "start_apps" ''
|
||||||
|
# Open qbittorrent
|
||||||
|
qbittorrent &
|
||||||
|
|
||||||
|
# Open vesktop
|
||||||
|
vesktop &
|
||||||
|
|
||||||
|
# Open steam
|
||||||
|
steam &
|
||||||
|
|
||||||
|
# Open firefox
|
||||||
|
firefox
|
||||||
|
''
|
|
@ -0,0 +1,59 @@
|
||||||
|
pkgs:
|
||||||
|
|
||||||
|
pkgs.writeShellScriptBin "start_services" ''
|
||||||
|
#
|
||||||
|
# Make sure xdg-desktop-portal-hyprland has access to what it needs
|
||||||
|
#
|
||||||
|
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &
|
||||||
|
|
||||||
|
#
|
||||||
|
# Start waybar.
|
||||||
|
#
|
||||||
|
waybar &
|
||||||
|
|
||||||
|
#
|
||||||
|
# Start xwaylandvideobridge
|
||||||
|
#
|
||||||
|
xwaylandvideobridge &
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Start wallpaper daemon
|
||||||
|
#
|
||||||
|
~/.local/share/scripts/wallpaper.sh &
|
||||||
|
|
||||||
|
#
|
||||||
|
# Start notification daemon.
|
||||||
|
#
|
||||||
|
mako &
|
||||||
|
|
||||||
|
#
|
||||||
|
# Start polkit agent
|
||||||
|
#
|
||||||
|
${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1 &
|
||||||
|
|
||||||
|
#
|
||||||
|
# Start kwallet service
|
||||||
|
#
|
||||||
|
kwalletd6 &
|
||||||
|
|
||||||
|
#
|
||||||
|
# Start kdeconnect daemon
|
||||||
|
#
|
||||||
|
kdeconnectd &
|
||||||
|
|
||||||
|
#
|
||||||
|
# Start Fcitx5
|
||||||
|
#
|
||||||
|
fcitx5 &
|
||||||
|
|
||||||
|
#
|
||||||
|
# Start the blueman applet for managing bluetooth devices
|
||||||
|
#
|
||||||
|
blueman-applet &
|
||||||
|
|
||||||
|
#
|
||||||
|
# Clipboard manager
|
||||||
|
#
|
||||||
|
${pkgs.wl-clipboard}/bin/wl-paste --watch cliphist store &
|
||||||
|
''
|
|
@ -1,13 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Open qbittorrent
|
|
||||||
qbittorrent &
|
|
||||||
|
|
||||||
# Open vesktop
|
|
||||||
vesktop &
|
|
||||||
|
|
||||||
# Open steam
|
|
||||||
steam &
|
|
||||||
|
|
||||||
# Open firefox
|
|
||||||
firefox
|
|
Loading…
Reference in a new issue