-
Notifications
You must be signed in to change notification settings - Fork 0
/
wayland.nix
125 lines (117 loc) · 3.77 KB
/
wayland.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{config, pkgs, ...}:
let
tofi-run = "${pkgs.wofi}/bin/wofi -i --show run";
wofi = "${pkgs.wofi}/bin/wofi -d -i";
hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
hyprmenu = pkgs.writers.writeBashBin "hyprmenu" ''
${tofi-run}
'';
hypr-ws-rename = pkgs.writers.writeBashBin "hypr-ws-rename" ''
FRE_STORE=$HOME/.local/share/lanta/desktop-names
NAME=$(fre --sorted --store $FRE_STORE | ${wofi} -p "Rename Workspace ")
if [[ -n $NAME ]] ; then
ID=$(${hyprctl} activeworkspace -j | jq '.id')
${hyprctl} dispatch renameworkspace $ID $NAME
fre --add "$NAME" --store $FRE_STORE
fi
'';
hypr-ws-switch = pkgs.writers.writeBashBin "hypr-ws-switch" ''
FRE_STORE=$HOME/.local/share/lanta/desktop-names
NAME=$(${hyprctl} workspaces -j | jq -r '.[] | @text "\(.id) \(.name)"' | ${wofi} -p "Switch To ")
if [[ -n $NAME ]] ; then
${hyprctl} dispatch focusworkspaceoncurrentmonitor $(echo $NAME | awk '{print $1}')
fi
'';
hypr-screenoff = pkgs.writers.writeBashBin "hypr-screenoff" ''
sleep 1 && ${hyprctl} dispatch dpms off
'';
in {
home.packages = [pkgs.wofi hyprmenu hypr-ws-rename hypr-ws-switch];
programs.waybar = {
enable = true;
systemd.enable = true;
settings = {
mainBar = {
layer = "top";
position = "bottom";
height = 30;
output = [
"DP-1"
"DP-4"
];
modules-left = [ "hyprland/workspaces" "cpu" ];
modules-center = [ "hyprland/window" ];
modules-right = [ "memory" "temperature" "clock" ];
};
};
};
services.mako = {
enable = true;
borderRadius = 5;
borderSize = 2;
};
programs.swaylock.enable = true;
xdg.configFile."tofi/config" = {
enable = true;
text = ''
width = 100%
height = 100%
border-width = 0
outline-width = 0
padding-left = 35%
padding-top = 35%
result-spacing = 25
num-results = 12
font = monospace
background-color = #000A
'';
};
wayland.windowManager.hyprland = {
enable = true;
extraConfig = let colors = config.colors.fn "0xff"; in ''
$mod = Alt
bind = $mod, C, exec, wezterm
bind = $mod, G, exec, hypr-ws-switch
bind = $mod, N, workspace, empty
bind = $mod, R, exec, hypr-ws-rename
bind = $mod, P, exec, hyprmenu
bind = $mod, H, movefocus, l
bind = $mod, J, movefocus, d
bind = $mod, K, movefocus, u
bind = $mod, L, movefocus, r
bind = $mod and Shift, H, swapwindow, l
bind = $mod and Shift, J, swapwindow, d
bind = $mod and Shift, K, swapwindow, u
bind = $mod and Shift, L, swapwindow, r
bind = $mod, D, killactive,
bind = $mod and Shift, S, exec, sleep 1 && hyprctl dispatch dpms off
bindm = $mod, mouse:272, movewindow
monitor=DP-4,2560x1440,0x0,1
monitor=DP-1,2560x1440,0x1440,1
general {
layout = master
border_size = 3
gaps_out = 0
col.inactive_border = ${colors.base02}
col.active_border = ${colors.base0B}
}
decoration {
rounding = 10
drop_shadow = false
}
animation=windows,1,3,default
input {
kb_layout = us
kb_variant = dvp
kb_options = caps:escape
}
master {
orientation = center
mfact = 0.4
}
misc {
key_press_enables_dpms = true
}
'';
};
}