autostart

This commit is contained in:
caandt 2024-11-29 00:48:44 -06:00
parent 09a3669b57
commit 693af2e90a
5 changed files with 51 additions and 41 deletions

View file

@ -1,7 +1,24 @@
{config, ...}: { {
config,
pkgs,
lib,
...
}: {
imports = [ imports = [
../../../../user ../../../../user
]; ];
home.username = "ahnwuoa"; home.username = "ahnwuoa";
services.activitywatch = {
enable = true;
watchers = {
aw-watcher-afk.package = pkgs.activitywatch;
aw-watcher-window.package = pkgs.activitywatch;
};
};
systemd.user.targets.activitywatch = {
Unit.Requires = lib.mkForce ["autostart.target"];
Unit.After = lib.mkForce ["autostart.target"];
Install.WantedBy = lib.mkForce ["autostart.target"];
};
} }

View file

@ -4,8 +4,4 @@
package = pkgs.libsForQt5.partitionmanager; package = pkgs.libsForQt5.partitionmanager;
}; };
services.udisks2.enable = true; services.udisks2.enable = true;
systemd.user.services = {
plasma-kactivitymanagerd.enable = false;
plasma-xdg-desktop-portal-kde.enable = false;
};
} }

22
user/autostart.nix Normal file
View file

@ -0,0 +1,22 @@
{pkgs, pkgs-stable, ...}: {
systemd.user.targets.autostart = {
Unit = {
Wants = [
"plasma-polkit-agent.service"
"plasma-xdg-desktop-portal-kde.service"
"plasma-dolphin.service"
"xdg-desktop-portal.service"
"copyq.service"
"fcitx5.service"
"picom.service"
"safeeyes.service"
];
};
};
systemd.user.services = {
copyq.Service.ExecStart = ["${pkgs.copyq}/bin/copyq"];
fcitx5.Service.ExecStart = ["/run/current-system/sw/bin/fcitx5"];
picom.Service.ExecStart = ["${pkgs.picom}/bin/picom"];
safeeyes.Service.ExecStart = ["${pkgs-stable.safeeyes}/bin/safeeyes"];
};
}

View file

@ -1,47 +1,21 @@
#!/bin/sh #!/bin/sh
# set keyboard repeat rate export QT_QPA_PLATFORMTHEME="qt6ct"
xset r rate 200 30
# monitor settings
xrandr --output DisplayPort-1 --mode 1920x1080 --rate 144
# tablet settings
xsetwacom set "Wacom One by Wacom S Pen stylus" MapToOutput DisplayPort-0
# set color temperature
sct 4500
# compositor
picom &
LIBEXEC=/run/current-system/sw/libexec
[ -d "$LIBEXEC" ] || LIBEXEC=/usr/lib
# session manager
"$LIBEXEC"/polkit-kde-authentication-agent-1 &
# desktop portal
"$LIBEXEC"/xdg-desktop-portal-kde &
"$LIBEXEC"/xdg-desktop-portal &
kded5 &
# ime
export GTK_IM_MODULE=fctix export GTK_IM_MODULE=fctix
export QT_IM_MODULE=fcitx export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx export XMODIFIERS=@im=fcitx
fcitx5 &
# file manager daemon
dolphin --daemon &
# qt setting
export QT_QPA_PLATFORMTHEME="qt6ct"
# same dpi for multi monitor
export WINIT_X11_SCALE_FACTOR=1 export WINIT_X11_SCALE_FACTOR=1
safeeyes & _vars="DBUS_SESSION_BUS_ADDRESS DISPLAY SSH_AUTH_SOCK XAUTHORITY XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID QT_PLUGIN_PATH QML2_IMPORT_PATH QT_QPA_PLATFORMTHEME QT_STYLE_OVERRIDE NIX_XDG_DESKTOP_PORTAL_DIR"
systemctl --user import-environment $_vars
copyq & dbus-update-activation-environment $_vars
xrdb -merge ~/.config/Xresources xrdb -merge ~/.config/Xresources
xset r rate 200 30
xrandr --output DisplayPort-1 --mode 1920x1080 --rate 144
xsetwacom set "Wacom One by Wacom S Pen stylus" MapToOutput DisplayPort-0
sct 4500
systemctl --user start autostart.target
exec ${@:-awesome} exec ${@:-awesome}

View file

@ -1,5 +1,6 @@
{...}: { {...}: {
imports = [ imports = [
./autostart.nix
./bin ./bin
./config ./config
./home.nix ./home.nix