dotfiles/home-manager/desktop.nix

249 lines
8.0 KiB
Nix
Raw Normal View History

2022-09-15 10:14:50 +02:00
{ lib, pkgs, options, ... }:
2021-05-29 18:32:09 +02:00
let
2022-05-15 14:35:03 +02:00
bin = pkgs.callPackage ../bin { };
2021-08-08 17:21:28 +02:00
fixed_slack = pkgs.slack.override {
xdg-utils = pkgs.xdg-utils.overrideAttrs (o: {
2022-07-06 10:33:40 +02:00
buildInputs = (o.buildInputs or []) ++ [ pkgs.makeWrapper ];
2021-08-08 17:21:28 +02:00
postInstall = o.postInstall + ''
wrapProgram "$out/bin/xdg-open" --unset GDK_BACKEND
'';
});
};
bg = {
xps9360 = "/home/yorick/wp/thorns__4k__by_kasperja-daqi5g7.jpg fill";
desktop = "/home/yorick/wp/beyond-4k-2560×1440.jpg fill";
x11carbon = "/home/yorick/wp/lawn_forest_mountains_144578_3840x2400.jpg fill";
};
in {
2021-05-29 18:32:09 +02:00
# TODO: waybar module from home-manager
2022-04-11 15:58:15 +02:00
xdg.configFile."waybar/config" = {
text =
builtins.toJSON (builtins.fromTOML (builtins.readFile ./waybar.toml));
2021-05-29 18:32:09 +02:00
onChange = "systemctl --user restart waybar";
};
2022-09-15 10:14:50 +02:00
systemd.user.services.waybar.Service.Environment = [
2022-10-03 17:33:50 +02:00
"PATH=${lib.makeBinPath (with pkgs; [ pavucontrol xdg-utils bin.y-cal-widget playerctl bluez gnugrep bash ])}"
2022-09-15 10:14:50 +02:00
];
2022-04-11 15:58:15 +02:00
programs.waybar = {
enable = true;
style = ./waybar.css;
systemd.enable = true;
};
2022-10-03 17:33:50 +02:00
programs.mako = {
enable = true;
defaultTimeout = 60 * 1000; # ms
};
2022-05-04 11:25:01 +02:00
services.gpg-agent.pinentryFlavor = "gnome3";
2021-05-29 18:32:09 +02:00
wayland.windowManager.sway = {
enable = true;
config = {
bars = [ ];
2021-05-29 18:32:09 +02:00
gaps.inner = 5;
modifier = "Mod4";
window.hideEdgeBorders = "smart";
fonts.names = [ "DejaVu Sans Mono" ];
fonts.size = 11.0;
2021-05-29 18:32:09 +02:00
window.border = 2;
floating.modifier = "Mod4";
focus.newWindow = "urgent";
2021-05-29 18:32:09 +02:00
keybindings = with pkgs;
(builtins.head (builtins.head
options.wayland.windowManager.sway.config.type.getSubModules).imports).options.keybindings.default
// (let
exec = pkg: cmd: "exec --no-startup-id ${pkg}/bin/${cmd}";
mod = "Mod4";
in {
"${mod}+Shift+c" = "kill";
"${mod}+j" = "focus left";
"${mod}+k" = "focus right";
"${mod}+d" = "layout toggle split";
"${mod}+i" =
"exec --no-startup-id bash /home/yorick/dotfiles/bin/invert.sh";
#"${mod}+ctrl+l" = "exec --no-startup-id loginctl lock-session";
"${mod}+ctrl+l" =
2023-01-18 18:03:30 +01:00
"exec --no-startup-id \"playerctl -a pause; (bluetoothctl disconnect 88:C9:E8:AD:73:E8 &) && sleep 1s && pkill -USR1 swayidle\"";
2021-05-29 18:32:09 +02:00
"${mod}+Return" = "exec alacritty";
"${mod}+Escape" = "workspace back_and_forth";
"${mod}+0" = "workspace 10";
"${mod}+Shift+0" = "move container to workspace 10";
"${mod}+Shift+Left" = "move left";
"${mod}+Shift+Right" = "move right";
"${mod}+Shift+Up" = "move up";
"${mod}+Shift+Down" = "move down";
"${mod}+Ctrl+Right" = "move workspace to output right";
"${mod}+Ctrl+Left" = "move workspace to output left";
"${mod}+Ctrl+Up" = "move workspace to output up";
"${mod}+Ctrl+Down" = "move workspace to output down";
2022-01-17 20:38:55 +01:00
"XF86MonBrightnessUp" = exec light "light -T 1.1";
"XF86MonBrightnessDown" = exec light "light -T 0.9";
2021-05-29 18:32:09 +02:00
"ctrl+XF86MonBrightnessUp" = exec light "light -A 1";
"ctrl+XF86MonBrightnessDown" = exec light "light -U 1";
2022-10-04 10:15:29 +02:00
"XF86AudioLowerVolume" = exec alsa-utils "amixer set Master 1%-";
"XF86AudioRaiseVolume" = exec alsa-utils "amixer set Master 1%+";
"XF86AudioMute" = exec alsa-utils "amixer set Master toggle";
2022-04-13 10:19:22 +02:00
"XF86AudioPause" = "exec playerctl pause";
"XF86AudioPlay" = "exec playerctl play";
"${mod}+Shift+s" = exec bin.screenshot_public "screenshot_public >> ~/screenshot-public.log";
2021-05-29 18:32:09 +02:00
"Print" = exec bin.screenshot_public "screenshot_public";
"${mod}+Shift+t" =
"exec --no-startup-id /home/yorick/dotfiles/bin/toggle_solarized.sh";
"--locked ${mod}+x" = "exec /home/yorick/dotfiles/bin/docked.sh";
"${mod}+p" = "exec /home/yorick/dotfiles/bin/ala-fzf-pass.sh";
#"${mod}+p" = exec rofi-pass "rofi-pass";
"${mod}+e" = exec pkgs.wldash "wldash start-or-kill";
"--locked ${mod}+bracketleft" =
"exec --no-startup-id /home/yorick/dotfiles/bin/sunplate.sh 0";
"--locked ${mod}+bracketright" =
"exec --no-startup-id /home/yorick/dotfiles/bin/sunplate.sh 1";
});
workspaceAutoBackAndForth = true;
# xps9360
input."1267:8400:ELAN_Touchscreen".map_to_output = "eDP-1";
input."1267:12679:ELAN0672:00_04F3:3187_Touchpad" = {
natural_scroll = "enabled";
tap = "enabled";
dwt = "enabled";
};
2022-07-06 21:40:44 +02:00
output."Sharp Corporation 0x144A Unknown".bg = bg.xps9360;
# desk
2022-09-15 10:14:50 +02:00
output."HYC CO., LTD. Unknown" = {
position = "0 0";
bg = bg.desktop;
max_render_time = "4";
2022-09-15 10:14:50 +02:00
};
output."HYC CO., LTD. " = {
position = "0 0";
bg = bg.desktop;
};
output."BenQ Corporation BenQ GW2765 36H03689019" = {
position = "2560 0";
bg = bg.desktop;
max_render_time = "4";
};
# x11 carbon
input."2:10:TPPS/2_Elan_TrackPoint".accel_profile = "flat";
2022-07-06 21:40:44 +02:00
output."California Institute of Technology 0x1403 Unknown".bg = bg.x11carbon;
input."1739:30383:DLL075B:01_06CB:76AF_Touchpad" = {
natural_scroll = "enabled";
tap = "enabled";
dwt = "enabled";
};
# generic
input."1:1:AT_Translated_Set_2_keyboard".xkb_options = "caps:escape";
input."1133:16498:Logitech_MX_Anywhere_2".left_handed = "enabled";
input."1133:45087:MX_Anywhere_2_Mouse".left_handed = "enabled";
window.commands = [
{
criteria.app_id = "ala-fzf";
command = "floating enable";
}
{
criteria.app_id = "emacs";
command = "opacity 0.95";
}
];
startup = [
{ command = "mako"; }
{
command = ''
swayidle timeout 300 'swaymsg "output * dpms off"; swaylock' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock' '';
}
];
2021-05-29 18:32:09 +02:00
};
systemdIntegration = true;
2022-05-04 11:25:01 +02:00
# fix pinentry-gnome3
extraConfig = ''
include /etc/sway/config.d/*
'';
2021-05-29 18:32:09 +02:00
};
2022-04-16 10:44:45 +02:00
programs.firefox = {
enable = true;
2023-01-18 18:03:48 +01:00
package = pkgs.latest.firefox-bin;
2022-04-16 10:44:45 +02:00
};
2021-05-29 18:32:09 +02:00
home.sessionVariables = {
MOZ_USE_XINPUT2 = "1";
MOZ_ENABLE_WAYLAND = "1";
EDITOR = "emacsclient";
#GDK_BACKEND = "wayland";
TERMINAL = "alacritty";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_QPA_PLATFORM = "wayland";
_JAVA_AWT_WM_NONREPARENTING = "1";
XCURSOR_THEME = "Adwaita";
2022-10-04 10:15:29 +02:00
XCURSOR_PATH = "${pkgs.gnome.adwaita-icon-theme}/share/icons";
2021-05-29 18:32:09 +02:00
XDG_CURRENT_DESKTOP = "sway";
};
# todo: use home-manager unit
systemd.user.services.gmi = {
Unit.ConditionPathExists = "/home/yorick/mail/account.gmail/.gmailieer.json";
Service = {
2022-09-15 10:14:50 +02:00
Environment = [
"PATH=${lib.makeBinPath (with pkgs; [ bash lieer notmuch afew ])}"
];
Type = "oneshot";
ExecStart = "/usr/bin/env bash -c 'gmi pull && notmuch new'";
WorkingDirectory = "/home/yorick/mail/account.gmail";
};
};
systemd.user.timers.gmi = {
Timer = {
OnActiveSec = "30m";
OnBootSec = "5m";
RandomizedDelaySec = 30;
};
Install.WantedBy = ["timers.target"];
};
2021-05-29 18:32:09 +02:00
2022-09-15 10:14:50 +02:00
# systemd.user.services.gebaard = {
# Unit = {
# Description = "gebaard";
# After = [ "graphical-session-pre.target" ];
# PartOf = [ "graphical-session.target" ];
# };
2021-05-29 18:32:09 +02:00
2022-09-15 10:14:50 +02:00
# Install = { WantedBy = [ "graphical-session.target" ]; };
2021-05-29 18:32:09 +02:00
2022-09-15 10:14:50 +02:00
# Service = {
# ExecStart = ''
# ${pkgs.gebaar-libinput}/bin/gebaard
# '';
# };
# };
2021-05-29 18:32:09 +02:00
home.packages = with pkgs; [
2022-04-11 15:27:39 +02:00
gtk-engine-murrine
hicolor-icon-theme
libnotify
light
mosquitto
pavucontrol
playerctl
vanilla-dmz
2022-04-11 15:27:39 +02:00
2022-06-04 14:33:18 +02:00
libwebp
2021-05-29 18:32:09 +02:00
gebaar-libinput
grim
2022-05-18 12:09:50 +02:00
element-desktop-wayland
2021-05-29 18:32:09 +02:00
libreoffice
obs-studio
2021-05-29 18:32:09 +02:00
obs-wlrobs
2021-08-08 17:21:28 +02:00
fixed_slack
2021-05-29 18:32:09 +02:00
slurp
2022-06-04 14:33:18 +02:00
sway-contrib.grimshot
2021-05-29 18:32:09 +02:00
swaybg
swayidle
swaylock
waybar
waypipe
wl-clipboard
wldash
# zoom-us
2022-04-16 09:59:10 +02:00
bin.y-cal-widget
2021-05-29 18:32:09 +02:00
];
}