Add laptop config
This commit is contained in:
parent
5325723d7e
commit
b8e127818a
23 changed files with 32 additions and 9 deletions
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
15
common/home-manager/wayland/default.nix
Normal file
15
common/home-manager/wayland/default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ ... }:
|
||||
{
|
||||
home.sessionVariables = {
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
MOZ_USE_XINPUT2 = "1";
|
||||
};
|
||||
|
||||
imports = [
|
||||
./sway.nix
|
||||
./swaylock.nix
|
||||
./waybar.nix
|
||||
./wofi.nix
|
||||
./mako.nix
|
||||
];
|
||||
}
|
||||
38
common/home-manager/wayland/mako.nix
Normal file
38
common/home-manager/wayland/mako.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.mako = {
|
||||
enable = true;
|
||||
|
||||
font = "UbuntuMono Light 11";
|
||||
format = ''<i>%a</i>\n<b>%s</b>\n\n%b'';
|
||||
layer = "overlay";
|
||||
backgroundColor = "#111320d0";
|
||||
width = 300;
|
||||
margin = "5";
|
||||
padding = "5,10";
|
||||
borderSize = 2;
|
||||
borderColor = "#04c2e8";
|
||||
borderRadius = 5;
|
||||
defaultTimeout = 10000;
|
||||
|
||||
extraConfig =
|
||||
''
|
||||
[urgency=low]
|
||||
format=<i>%s</i>\n%b
|
||||
background-color=#111111c0
|
||||
border-color=#ffffff
|
||||
border-size=1
|
||||
|
||||
[urgency=high]
|
||||
background-color=#1e0909d0
|
||||
border-color=#bf616a
|
||||
border-size=4
|
||||
default-timeout=0
|
||||
ignore-timeout=1
|
||||
|
||||
[app-name=lightcord]
|
||||
format=<b>%s</b>\n%b
|
||||
border-color=#88c0d0
|
||||
'';
|
||||
};
|
||||
}
|
||||
105
common/home-manager/wayland/sway.nix
Normal file
105
common/home-manager/wayland/sway.nix
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
modifier = "Mod1";
|
||||
terminal = "alacritty";
|
||||
bgimg = "What_Space_Really_Looks_Like_2880x1800.png";
|
||||
in {
|
||||
|
||||
home.sessionVariables = {
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
MOZ_USE_XINPUT2 = "1";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [ swayidle wl-clipboard wlroots ];
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
config = {
|
||||
inherit modifier terminal;
|
||||
menu = "wofi --show drun";
|
||||
|
||||
fonts = {
|
||||
names = [ "UbuntuMono" ];
|
||||
style = "Medium";
|
||||
size = 11.0;
|
||||
};
|
||||
|
||||
bars = [{ command = "waybar"; }];
|
||||
|
||||
window.border = 1;
|
||||
gaps = {
|
||||
inner = 10;
|
||||
outer = 5;
|
||||
};
|
||||
colors = {
|
||||
unfocused.border = "#333333";
|
||||
unfocused.background = "#000000a0";
|
||||
unfocused.text = "#a0a0a0";
|
||||
unfocused.indicator = "#2d292e";
|
||||
unfocused.childBorder = "#333333";
|
||||
|
||||
focused.border = "#808080";
|
||||
focused.background = "#000000";
|
||||
focused.text = "#ffffff";
|
||||
focused.indicator = "#2d292e";
|
||||
focused.childBorder = "#ffffff";
|
||||
|
||||
focusedInactive.border = "#333333";
|
||||
focusedInactive.background = "#000000";
|
||||
focusedInactive.text = "#ffffff";
|
||||
focusedInactive.indicator = "#4e4850";
|
||||
focusedInactive.childBorder = "#333333";
|
||||
|
||||
urgent.border = "#000000";
|
||||
urgent.background = "#900000";
|
||||
urgent.text = "#ffffff";
|
||||
urgent.indicator = "#900000";
|
||||
urgent.childBorder = "#000000";
|
||||
};
|
||||
|
||||
startup = map (x: { command = x; }) [
|
||||
''~/.azotebg''
|
||||
# Make wob channel
|
||||
''mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob''
|
||||
''swayidle timeout 120 'swaylock -f --grace=180' \
|
||||
timeout 600 'systemctl suspend' \
|
||||
before-sleep 'swaylock -f' ''
|
||||
''export XDG_SESSION_TYPE=wayland''
|
||||
''export XDG_CURRENT_DESKTOP=sway''
|
||||
];
|
||||
|
||||
keybindings = let
|
||||
# Display volume using wob
|
||||
audio-disp = ''pamixer --get-volume > $SWAYSOCK.wob'';
|
||||
audio = cmd: "exec pamixer ${cmd} && ${audio-disp}";
|
||||
brightness-set = x: "exec brightnessctl set ${x}";
|
||||
playerctl = cmd: "exec playerctl ${cmd}";
|
||||
in pkgs.lib.mkOptionDefault {
|
||||
"${modifier}+Shift+d" = ''exec wofi --show run'';
|
||||
"${modifier}+Shift+l" = ''exec swaylock --grace=30'';
|
||||
|
||||
# Screenshot
|
||||
"Print" = ''exec grim -o $(date +%Y-%m-%d_%H-%m-%s)'';
|
||||
"Shift+Print" = ''exec grim -g "$(slurp)" -o $(date +%Y-%m-%d_%H-%m-%s)'';
|
||||
"${modifier}+Print" = ''grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" -o $(date +%Y-%m-%d_%H-%m-%s)'';
|
||||
|
||||
# Special XF86 key bindings
|
||||
"XF86AudioRaiseVolume" = audio "-ui 2";
|
||||
"XF86AudioLowerVolume" = audio "-ud 2";
|
||||
"XF86AudioMute" = ''exec pamixer --toggle-mute'';
|
||||
"XF86AudioMicMute" = ''exec pactl set-source-mute @DEFAULT_SOURCE@ toggle'';
|
||||
"XF86MonBrightnessDown" = brightness-set "5%-";
|
||||
"XF86MonBrightnessUp" = brightness-set "+5%";
|
||||
"XF86AudioPlay" = playerctl "play-pause";
|
||||
"XF86AudioNext" = playerctl "next";
|
||||
"XF86AudioPrev" = playerctl "previous";
|
||||
};
|
||||
|
||||
output."*" = {
|
||||
bg = "${./background/${bgimg}} fill";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
# bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
|
||||
35
common/home-manager/wayland/swaylock.nix
Executable file
35
common/home-manager/wayland/swaylock.nix
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.swaylock-effects ];
|
||||
|
||||
xdg.configFile."swaylock/config".text =
|
||||
''
|
||||
ignore-empty-password
|
||||
grace-no-mouse
|
||||
|
||||
fade-in=0.3
|
||||
|
||||
indicator
|
||||
screenshots
|
||||
|
||||
font=Ubuntu
|
||||
text-color=ffffff
|
||||
|
||||
color=00000000
|
||||
ring-color=151fea
|
||||
key-hl-color=6ecef4
|
||||
|
||||
line-uses-inside
|
||||
|
||||
indicator-radius=120
|
||||
indicator-thickness=7
|
||||
|
||||
|
||||
clock
|
||||
datestr=%A, %e.%m.%Y
|
||||
|
||||
effect-scale=0.4
|
||||
effect-vignette=0.3:0.7
|
||||
effect-blur=2x2
|
||||
'';
|
||||
}
|
||||
234
common/home-manager/wayland/waybar.nix
Normal file
234
common/home-manager/wayland/waybar.nix
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
|
||||
settings = [{
|
||||
height = 30;
|
||||
|
||||
modules-left = [ "sway/workspaces" "sway/mode" ];
|
||||
modules-center = [ "sway/window" ];
|
||||
modules-right = [ "pulseaudio" "network" "backlight" "idle_inhibitor" "clock" ];
|
||||
|
||||
modules = {
|
||||
"sway/mode" = {
|
||||
"format" = "<span style=\"italic\">{}</span>";
|
||||
};
|
||||
"mpd" = {
|
||||
format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ ";
|
||||
format-disconnected = "Disconnected ";
|
||||
format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ";
|
||||
unknown-tag = "N/A";
|
||||
interval = 2;
|
||||
|
||||
consume-icons.on = " ";
|
||||
random-icons.off = "<span color=\"#f53c3c\"></span> ";
|
||||
random-icons.on = " ";
|
||||
repeat-icons.on = " ";
|
||||
single-icons.on = "1 ";
|
||||
state-icons.paused = "";
|
||||
state-icons.playing = "";
|
||||
|
||||
tooltip-format = "MPD (connected)";
|
||||
tooltip-format-disconnected = "MPD (disconnected)";
|
||||
};
|
||||
"idle_inhibitor" = {
|
||||
format = "{icon}";
|
||||
format-icons.activated = "";
|
||||
format-icons.deactivated = "";
|
||||
};
|
||||
"tray" = {
|
||||
# icon-size = 21;
|
||||
spacing = 10;
|
||||
};
|
||||
"clock" = {
|
||||
# timezone = "America/New_York";
|
||||
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
|
||||
format-alt = "{:%Y-%m-%d}";
|
||||
};
|
||||
"cpu" = {
|
||||
format = " {usage}%";
|
||||
tooltip = false;
|
||||
};
|
||||
"memory" = {
|
||||
format = " {}%";
|
||||
};
|
||||
"temperature" = {
|
||||
# thermal-zone = 2;
|
||||
# hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input";
|
||||
critical-threshold = 80;
|
||||
# format-critical = "{temperatureC}°C {icon}";
|
||||
format = "{icon} {temperatureC}°C";
|
||||
format-icons = [ "" "" "" ];
|
||||
};
|
||||
"backlight" = {
|
||||
# device = "acpi_video1";
|
||||
format = "{percent}% {icon}";
|
||||
format-icons = [ "" "" ];
|
||||
};
|
||||
"network" = {
|
||||
# interface = "wlp2*"; # (Optional) To force the use of this interface
|
||||
format-wifi = " {essid} <span foreground='#B0B0B0'>{signalStrength}%</span>";
|
||||
format-ethernet = " wired";
|
||||
format-disconnected = "disconnected";
|
||||
tooltip-format = "{ifname} {ipaddr}";
|
||||
tooltip-format-disconnected = "disconnected";
|
||||
};
|
||||
"pulseaudio" = {
|
||||
# scroll-step = 1; # %, can be a float
|
||||
format = "{icon} {volume}%";
|
||||
format-bluetooth = "{icon} {volume}%";
|
||||
format-bluetooth-muted = "{icon} 0%";
|
||||
format-muted = "{icon} 0%";
|
||||
|
||||
format-icons.headphone = "";
|
||||
format-icons.hands-free = "";
|
||||
format-icons.headset = "";
|
||||
format-icons.phone = "";
|
||||
format-icons.portable = "";
|
||||
format-icons.car = "";
|
||||
format-icons.default = [ "" "" "" ];
|
||||
|
||||
on-click = "pamixer -t";
|
||||
};
|
||||
"custom/media" = {
|
||||
format = "{icon} {}";
|
||||
return-type = "json";
|
||||
max-length = 40;
|
||||
|
||||
format-icons.spotify = "";
|
||||
format-icons.default = "🎜";
|
||||
|
||||
escape = true;
|
||||
};
|
||||
};
|
||||
}];
|
||||
|
||||
style =
|
||||
''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: "UbuntuMono Nerd Font Mono", sans-serif;
|
||||
font-size: 16px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
color: #ffffff;
|
||||
transition-property: background-color;
|
||||
transition-duration: .2s;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
/*
|
||||
window#waybar.empty {
|
||||
background-color: transparent;
|
||||
}
|
||||
window#waybar.solo {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
*/
|
||||
|
||||
window#waybar.termite {
|
||||
background-color: #3F3F3F;
|
||||
}
|
||||
|
||||
window#waybar.chromium {
|
||||
background-color: #000000;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background-color: transparent;
|
||||
color: #ffffff;
|
||||
/* Use box-shadow instead of border so the text isn't offset */
|
||||
box-shadow: inset 0 -3px transparent;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
box-shadow: inset 0 -3px #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background-color: #64727D;
|
||||
border-bottom: 3px solid #ffffff;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#disk,
|
||||
#temperature,
|
||||
#backlight,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#custom-media,
|
||||
#tray,
|
||||
#mode,
|
||||
#idle_inhibitor,
|
||||
#mpd {
|
||||
padding: 0px 10px;
|
||||
margin: 0px 16px 0px 0px;
|
||||
}
|
||||
|
||||
#window,
|
||||
#workspaces {
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
/* If workspaces is the leftmost module, omit left margin */
|
||||
.modules-left > widget:first-child > #workspaces {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* If workspaces is the rightmost module, omit right margin */
|
||||
.modules-right > widget:last-child > #workspaces {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
#clock {
|
||||
box-shadow: inset 0 -3px #0a6cf5;
|
||||
}
|
||||
|
||||
#network {
|
||||
box-shadow: inset 0 -3px #9f78ff;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
box-shadow: inset 0 -3px #5af78e;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
box-shadow: inset 0 -3px #ff5c57;
|
||||
}
|
||||
|
||||
label:focus {
|
||||
background-color: #000000;
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
6
common/home-manager/wayland/wofi.nix
Normal file
6
common/home-manager/wayland/wofi.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.wofi ];
|
||||
|
||||
xdg.configFile.wofi.source = ./wofi;
|
||||
}
|
||||
7
common/home-manager/wayland/wofi/config
Executable file
7
common/home-manager/wayland/wofi/config
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
width=100%
|
||||
xoffset=0px
|
||||
allow_images=true
|
||||
image_size=20px
|
||||
drun-display_generic=true
|
||||
dynamic_lines=true
|
||||
term=alacritty
|
||||
68
common/home-manager/wayland/wofi/style.css
Executable file
68
common/home-manager/wayland/wofi/style.css
Executable file
|
|
@ -0,0 +1,68 @@
|
|||
|
||||
window {
|
||||
margin: 0px;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
font-size: 1.2em;
|
||||
font-family: "Ubuntu Mono";
|
||||
}
|
||||
|
||||
#input {
|
||||
color: white;
|
||||
margin: 0px;
|
||||
margin-right: 10px;
|
||||
margin-left: 10px;
|
||||
border: 0px;
|
||||
border-bottom: 2px solid #eef279;
|
||||
border-radius: 0px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#inner-box {
|
||||
margin: 0px;
|
||||
margin-right: 10px;
|
||||
margin-left: 10px;
|
||||
border-top: 2px solid transparent;
|
||||
color: white;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
expander .entry {
|
||||
margin-left: -15px;
|
||||
}
|
||||
|
||||
#img {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
#outer-box {
|
||||
margin: 0px;
|
||||
border: 0px solid;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#scroll {
|
||||
margin: 0px;
|
||||
border: 0px solid;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#entry{
|
||||
padding: 1px;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#entry:selected{
|
||||
background-color: #eef279;
|
||||
color: #141414;
|
||||
outline: 0px;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
#text:selected{
|
||||
background-color: #eef279;
|
||||
color: #141414;
|
||||
outline: 0px;
|
||||
border-radius: 0px;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue