monitor mirroring

This commit is contained in:
Vivian 2024-04-02 17:54:13 +02:00
parent 6215afa533
commit ef35ed546e
20 changed files with 977 additions and 536 deletions

View file

@ -2,7 +2,12 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ inputs, lib, pkgs, ... }:
{
inputs,
lib,
pkgs,
...
}:
{
imports = [
./hardware-configuration.nix
@ -37,7 +42,26 @@
};
home-manager.users.vivian = import ./home;
programs.hyprland.enable = true;
services.gnome-autounlock-keyring = {
enable = true;
# target = "hyprland-session.target";
};
services.interception-tools = {
enable = true;
plugins = [ pkgs.interception-tools-plugins.caps2esc ];
udevmonConfig = ''
- JOB: "${pkgs.interception-tools}/bin/intercept -g $DEVNODE | ${pkgs.interception-tools-plugins.caps2esc}/bin/caps2esc | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE"
DEVICE:
EVENTS:
EV_KEY: [KEY_CAPSLOCK, KEY_ESC]
'';
};
# services.desktopManager.cosmic.enable = true;
# services.displayManager.cosmic-greeter.enable = true;
# Enable Ozone rendering for Chromium and Electron apps.
environment.sessionVariables.NIXOS_OZONE_WL = "1";

View file

@ -21,6 +21,7 @@
localsend
obsidian
typst
prismlauncher
];
## Hyprland Config

View file

@ -1,55 +1,138 @@
$light-gray: #9699b7;
* {
all: unset; //Unsets everything so you can style everything from scratch
all: unset; //Unsets everything so you can style everything from scratch
font-family: "JetBrainsMono"
}
tooltip {
background-color: $base;
border-radius: 5px
}
button {
transition: background-color 200ms, color 200ms;
}
.active {
color: $pink;
font-size: 1.4rem;
}
.inactive {
color: $base;
font-size: 1.4rem;
}
.inactive:hover {
color: $light-gray;
}
//Global Styles
.bar {
background-color: #3a3a3a;
color: #b0b4bc;
padding: 10px;
background-color: $mantle;
}
// Styles on classes (see eww.yuck for more information)
.sidestuff slider {
all: unset;
color: #ffd5cd;
.clock {
font-weight: bold;
background-color: $base;
color: $text;
border-radius: 10px;
padding: 0.2rem;
margin: 0.5rem;
}
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.label-ram {
font-size: large;
}
.workspaces button:hover {
color: #D35D6E;
.date {
font-size: 1.5rem;
color: $text;
}
.battery {
font-family: monospace;
font-size: 1.5rem;
color: $teal;
}
.volume,
.dnd,
.wifi {
font-family: monospace;
font-size: 1.5rem;
color: $mauve;
padding: 0 5px;
}
// battery menu
.batterywindow {
background-color: $mantle;
border-radius: 5px;
font-size: 18px;
font-weight: normal;
color: $text;
progressbar {
border-radius: 5px;
}
progressbar progress {
background-color: $green;
}
progressbar trough {
background-color: $base;
}
.batterymenu {
padding: 10px;
}
}
// Calendar
.cal {
background-color: $mantle;
border-radius: 5px;
font-size: 18px;
font-weight: normal;
.cal-in {
padding: 0px 10px 0px 10px;
color: $text;
.cal {
&.highlight {
padding: 20px;
}
padding: 5px 5px 5px 5px;
margin-left: 10px;
}
}
}
calender {
color: $text;
}
calendar:selected {
color: $mauve;
}
calendar.header {
color: $overlay0;
font-weight: bold;
}
calendar.button {
color: $base;
}
calendar.highlight {
color: $overlay0;
font-weight: bold;
}
calendar:indeterminate {
color: $text;
}

View file

@ -1,75 +1,164 @@
(defwidget bar []
(centerbox :orientation "h"
(workspaces)
(music)
(sidestuff)))
(centerbox
:orientation "v"
(box
:valign "start"
:hexpand false
:vexpand false
:orientation "v"
:space-evenly false
)
(workspaces
:halign "center"
:vexpand true
:hexpand false
:orientation "v"
)
(box :valign "end" :hexpand false :vexpand true :orientation "v" :space-evenly false
(wifi)
(do-not-disturb)
(volume)
(battery)
(time)
)
)
)
(defwidget sidestuff []
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
(metric :label "🔊"
:value volume
:onchange "amixer -D pulse sset Master {}%")
(metric :label ""
:value {EWW_RAM.used_mem_perc}
:onchange "")
(metric :label "💾"
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange "")
time))
;; ━━━ BATTERY ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
(defwidget battery []
(eventbox :onclick "eww open batterywindow --toggle"
(label
:text `${
EWW_BATTERY.BAT0.status == "Charging" ? "" :
EWW_BATTERY.BAT0.capacity < 10 ? "" :
EWW_BATTERY.BAT0.capacity < 20 ? "" :
EWW_BATTERY.BAT0.capacity < 30 ? "" :
EWW_BATTERY.BAT0.capacity < 40 ? "" :
EWW_BATTERY.BAT0.capacity < 50 ? "" :
EWW_BATTERY.BAT0.capacity < 60 ? "" :
EWW_BATTERY.BAT0.capacity < 70 ? "" :
EWW_BATTERY.BAT0.capacity < 80 ? "" :
EWW_BATTERY.BAT0.capacity < 90 ? "" : ""
}`
:class "battery"
))
)
(defwidget batterymenu []
(box :orientation "v"
:class "batterymenu"
(label :text "${EWW_BATTERY.BAT0.status}: ${EWW_BATTERY.BAT0.capacity}%")
(progress :value "${EWW_BATTERY.BAT0.capacity}" :orientation "h") ; TODO: change class (and color) on low juice
)
)
(defwindow batterywindow
:monitor 0
:geometry (geometry
:x "53px"
:y "30px"
:anchor "bottom left"
)
(batterymenu)
)
; ━━━ do-not-disturb ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
(defvar dnd "")
(defwidget do-not-disturb []
(eventbox
:orientation "h"
:halign "center"
:space-evenly false
:onclick "nohup ./scripts/do-not-disturb.sh &"
(label
:text {dnd}
:class "dnd"
)
)
)
;; ━━━ WIFI ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
(defpoll wifi :interval "30s" "./scripts/wifi.sh")
(defwidget wifi []
(box
:orientation "h"
:halign "center"
:space-evenly false
(label
:text {wifi.icon}
:tooltip {wifi.status}
:class "wifi"
)
)
)
;; ━━━ VOLUME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
(defpoll volume :interval "1s" "./scripts/volume.sh")
(defwidget volume []
(eventbox
:orientation "h"
:halign "center"
:space-evenly false
:onclick "pamixer -t"
(label
:text {volume.icon}
:tooltip "${volume.percent}%"
:class "volume"
)
)
)
;; ━━━ TIME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
(defpoll hour :interval "10s" "date +%H")
(defpoll minute :interval "10s" "date +%M")
(defpoll dateVar :interval "600s" "date '+%A %d.%m.%y'")
(defwidget time []
(eventbox
:cursor "hand"
:hexpand false
:vexpand false
:tooltip "${dateVar}"
:onclick "eww open calendar --toggle &"
(box :orientation "v" :hexpand false :vexpand false :space-evenly false :class "clock"
(label :class "date" :text "${hour}")
(label :class "date" :text "${minute}")
)
)
)
;; Calendar
(defpoll calendar_day :interval "20h" "date '+%d'")
(defpoll calendar_year :interval "20h" "date '+%Y'")
(defwidget cal []
(box :class "cal" :orientation "v"
(box :class "cal-in"
(calendar :class "cal"
:day calendar_day
:year calendar_year))))
(defwindow calendar
:monitor 0
:geometry (geometry :x "53px"
:y "5px"
:anchor "bottom left"
:width "270px"
:height "60px")
(cal))
(deflisten workspaces_listen "./scripts/workspaces.sh")
(defwidget workspaces []
(box :class "workspaces"
:orientation "h"
:space-evenly true
:halign "start"
:spacing 10
(button :onclick "wmctrl -s 0" 1)
(button :onclick "wmctrl -s 1" 2)
(button :onclick "wmctrl -s 2" 3)
(button :onclick "wmctrl -s 3" 4)
(button :onclick "wmctrl -s 4" 5)
(button :onclick "wmctrl -s 5" 6)
(button :onclick "wmctrl -s 6" 7)
(button :onclick "wmctrl -s 7" 8)
(button :onclick "wmctrl -s 8" 9)))
(defwidget music []
(box :class "music"
:orientation "h"
:space-evenly false
:halign "center"
{music != "" ? "🎵${music}" : ""}))
(defwidget metric [label value onchange]
(box :orientation "h"
:class "metric"
:space-evenly false
(box :class "label" label)
(scale :min 0
:max 101
:active {onchange != ""}
:value value
:onchange onchange)))
(deflisten music :initial ""
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
(defpoll volume :interval "1s"
"scripts/getvol")
(defpoll time :interval "10s"
"date '+%H:%M %b %d, %Y'")
(literal :content workspaces_listen))
(defwindow bar
:monitor 0
:windowtype "dock"
:geometry (geometry :x "0%"
:y "0%"
:width "90%"
:height "10px"
:anchor "top center")
:reserve (struts :side "top" :distance "4%")
:exclusive false
:geometry (geometry :height "1080px" :x "-4px" :y "0px"
:width "52px"
:anchor "top left")
:stacking "fg"
(bar))

View file

@ -0,0 +1,10 @@
#!/usr/bin/env nix-shell
#! nix-shell -p jq -i bash
if makoctl mode | rg -q "do-not-disturb"; then
eww update dnd=""
makoctl mode -r do-not-disturb > /dev/null
else
eww update dnd=""
makoctl mode -a do-not-disturb > /dev/null
fi

View file

@ -0,0 +1,15 @@
#!/bin/sh
per="???"
if pamixer --get-mute | rg -q true; then
icon="婢"
elif [ "$per" -gt 66 ]; then
icon="墳" # high
elif [ "$per" -gt 33 ]; then
icon="奔" # med
else
icon="奄" #low
fi
printf "{\"icon\": \"${icon}\", \"percent\": \"${per}\"}"

View file

@ -0,0 +1,11 @@
#!/bin/sh
if wpa_cli status | rg -q "wpa_state=COMPLETED"; then
icon="直"
status="Connected"
else
icon="睊"
status="offline"
fi
printf "{\"icon\": \"${icon}\", \"status\": \"${status}\"}"

View file

@ -0,0 +1,21 @@
#!/usr/bin/env lua
aw = io.popen("hyprctl monitors | grep active | sed 's/()/(1)/g' | sort | awk 'NR>1{print $1}' RS='(' FS=')'")
active_workspace = aw:read("*a")
aw:close()
box = "(box :orientation \"v\" :spacing 1 :space-evenly \"true\" "
for i = 1,10 do
if i == tonumber(active_workspace) then
local btn = "(button :class \"active\" :onclick \"hyprctl dispatch workspace "..i.." \" \"\")"
box = box .. btn
else
local btn = "(button :class \"inactive\" :onclick \"hyprctl dispatch workspace "..i.."\" \"\")"
box = box .. btn
end
end
box = box .. ")"
print(box)

View file

@ -0,0 +1,10 @@
#!/bin/sh
workspaces() {
./scripts/workspaces.lua
}
workspaces
tail -f /tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/hyprland.log | grep --line-buffered "Changed to workspace" | while read -r; do
workspaces
done

View file

@ -1,156 +0,0 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,auto
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
# Set programs that you use
$terminal = kitty
$fileManager = dolphin
$menu = wofi --show drun
# Some default env vars.
# env = XCURSOR_SIZE,24
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_options=caps:escape
touchpad {
natural_scroll= true
}
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 20
border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = dwindle
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 10
blur {
enabled = true
size = 3
passes = 1
}
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = true
}
misc {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
force_default_wallpaper = 2 # Set to 0 or 1 to disable the anime mascot wallpapers
}
# Window Rules
windowrulev2 = suppressevent maximize, class:.* # You'll probably like this.
windowrulev2 = workspace 1 silent, class:^(Element)$
windowrulev2 = workspace 1 silent, class:^(discord)$
windowrulev2 = workspace 2 silent, class:^(firefox)$
windowrulev2 = float,class:^(firefox)$,title:^(Picture-in-Picture)$
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, RETURN, exec, $terminal
bind = $mainMod, Q, killactive,
bind = $mainMod SHIFT, escape, exit,
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, D, exec, $menu
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
# Fullscreen
bind=SUPER,m,fullscreen
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# vim: ft=hyprlang

View file

@ -1,5 +1,32 @@
{ pkgs, ... }:
{ pkgs, config, ... }:
{
systemd.user.services.mako = {
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
Type = "dbus";
BusName = "org.freedesktop.Notifications";
ExecCondition = ''
${pkgs.bash}/bin/bash -c '[ -n "$WAYLAND_DISPLAY" ]'
'';
ExecStart = ''
${pkgs.mako}/bin/mako
'';
ExecReload = ''
${pkgs.mako}/bin/makoctl reload
'';
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
programs = {
wofi = {
enable = true;
@ -7,12 +34,14 @@
eww = {
enable = true;
package = pkgs.eww-wayland;
configDir = ./eww;
};
mako.enable = true;
waybar = {
enable = true;
style = ./waybar.css;
settings = {
mainBar = {
layer = "top";
@ -20,7 +49,57 @@
height = 30;
modules-left = [ "hyprland/workspaces" ];
modules-center = [ "clock" ];
modules-right = [ "wireplumber" "power-profiles-daemon" "network" "battery" ];
modules-right = [
"wireplumber"
"power-profiles-daemon"
"network"
"battery"
];
wireplumber = {
format = "󰕾 {volume}%";
format-muted = "󰖁";
};
network = {
format-wifi = "󰖩 {essid} ({signalStrength}%)";
format-ethernet = "󰈀 {ifname}: {ipaddr}/{cidr}";
format-disconnected = "󰌙 ";
tooltip-format = "{ifname}: {ipaddr}";
};
power-profiles-daemon = {
format = "{icon}";
format-icons = {
performance = "󰓅";
balanced = "󰾅";
power-saver = "󰾆";
};
};
battery = {
states = {
warning = 30;
critical = 15;
};
format = "󱐋 {capacity}%";
format-discharging = "{icon} {capacity}%";
format-icons = [
"󰂎"
"󰁺"
"󰁻"
"󰁼"
"󰁽"
"󰁾"
"󰁿"
"󰂀"
"󰂁"
"󰂂"
"󰁹"
];
};
};
};
systemd = {
@ -30,134 +109,164 @@
};
};
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = true;
wayland.windowManager.hyprland =
let
toggle_mirror = pkgs.writeScriptBin "toggle_mirror.sh" ''
#!/usr/bin/env bash
if [ $(hyprctl monitors all -j | ${pkgs.jq}/bin/jq '.[1].activeWorkspace.id') = '-1' ]; then
hyprctl keyword monitor ",preferred,auto,1"
else
hyprctl keyword monitor ",preferred,auto,1,mirror,eDP-1"
fi
'';
in
{
enable = true;
systemd.enable = true;
settings = {
monitor = ",preferred,auto,auto";
input = {
kb_options = "caps:escape";
touchpad.natural_scroll = true;
};
general = {
gaps_in = 5;
gaps_out = 20;
border_size = 2;
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
"col.inactive_border" = "rgba(595959aa)";
layout = "dwindle";
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false;
};
decoration = {
rounding = 10;
settings =
let
inherit (builtins) genList concatLists toString;
wpctl = "${pkgs.wireplumber}/bin/wpctl";
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
menu = "${config.programs.wofi.package}/bin/wofi --show run,drun";
terminal = "${config.programs.kitty.package}/bin/kitty";
fileManager = "${pkgs.gnome.nautilus}/bin/nautilus";
in
{
"$mod" = "SUPER";
exec-once = [
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
];
monitor = [
"eDP-1, 3840x2400@60,0x0,2"
",highres,auto,1"
];
input = {
touchpad.natural_scroll = true;
};
general = {
gaps_in = 5;
gaps_out = 20;
border_size = 2;
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
"col.inactive_border" = "rgba(595959aa)";
layout = "dwindle";
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false;
};
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 3;
passes = 1;
blur = {
enabled = true;
size = 3;
passes = 1;
};
drop_shadow = "yes";
shadow_range = 4;
shadow_render_power = 3;
"col.shadow" = "rgba(1a1a1aee)";
};
animations = {
enabled = "yes";
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
];
};
dwindle = {
preserve_split = "yes";
pseudotile = "yes";
};
gestures.workspace_swipe = true;
misc = {
force_default_wallpaper = 1;
disable_splash_rendering = true;
};
windowrulev2 = [
"suppressevent maximize, class:.* # You'll probably like this."
"workspace 1 silent, class:^(Element)$"
"workspace 1 silent, class:^(discord)$"
"workspace 2 silent, class:^(firefox)$"
"float,class:^(firefox)$,title:^(Picture-in-Picture)$"
];
# l -> works when screen is locked
# e -> repeats when held
bindel = [
",XF86AudioRaiseVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-"
",XF86MonBrightnessUp,exec,${brightnessctl} -q s +5%"
",XF86MonBrightnessDown,exec,${brightnessctl} -q s 5%-"
];
bindl = [ ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" ];
bind =
[
"$mod, RETURN, exec, ${terminal}"
"$mod, Q, killactive,"
"$mod SHIFT, escape, exit,"
"$mod, E, exec, ${fileManager}"
"$mod, V, togglefloating,"
"$mod, D, exec, ${menu}"
"$mod, P, pseudo, # dwindle"
"$mod, J, togglesplit, # dwindle"
"SUPER,m,fullscreen"
# Move focus with arrow keys
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Scratch workspace
"$mod, S, togglespecialworkspace, magic"
"$mod SHIFT, S, movetoworkspace, special:magic"
# PrintScreen
",Print,exec, grimblast copysave area /home/vivian/cloud/Pictures/Screenshots/$(date --iso=seconds).png"
]
++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
concatLists (
genList (
x:
let
ws =
let
c = (x + 1) / 10;
in
toString (x + 1 - (c * 10));
in
[
"$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}"
]
) 10
)
);
# Bind mouse
bindm = [
# Move/resize windows with mod + LMB/RMB and dragging
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
drop_shadow = "yes";
shadow_range = 4;
shadow_render_power = 3;
"col.shadow" = "rgba(1a1a1aee)";
};
animations = {
enabled = "yes";
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
];
};
dwindle = {
preserve_split = "yes";
pseudotile = "yes";
};
gestures.workspace_swipe = true;
};
extraConfig = ''
$terminal = kitty
$fileManager = dolphin
$menu = wofi --show drun
misc {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
force_default_wallpaper = 2 # Set to 0 or 1 to disable the anime mascot wallpapers
disable_splash_rendering = true
}
# Window Rules
windowrulev2 = suppressevent maximize, class:.* # You'll probably like this.
windowrulev2 = workspace 1 silent, class:^(Element)$
windowrulev2 = workspace 1 silent, class:^(discord)$
windowrulev2 = workspace 2 silent, class:^(firefox)$
windowrulev2 = float,class:^(firefox)$,title:^(Picture-in-Picture)$
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, RETURN, exec, $terminal
bind = $mainMod, Q, killactive,
bind = $mainMod SHIFT, escape, exit,
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, D, exec, $menu
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
# Fullscreen
bind=SUPER,m,fullscreen
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
'';
};
}

View file

@ -0,0 +1,125 @@
/* Catppucin Frappe */
@define-color base #303446;
@define-color mantle #292c3c;
@define-color crust #232634;
@define-color text #c6d0f5;
@define-color subtext0 #a5adce;
@define-color subtext1 #b5bfe2;
@define-color surface0 #414559;
@define-color surface1 #51576d;
@define-color surface2 #626880;
@define-color overlay0 #737994;
@define-color overlay1 #838ba7;
@define-color overlay2 #949cbb;
@define-color blue #8caaee;
@define-color lavender #babbf1;
@define-color sapphire #85c1dc;
@define-color sky #99d1db;
@define-color teal #81c8be;
@define-color green #a6d189;
@define-color yellow #e5c890;
@define-color peach #ef9f76;
@define-color maroon #ea999c;
@define-color red #e78284;
@define-color mauve #ca9ee6;
@define-color pink #f4b8e4;
@define-color flamingo #eebebe;
@define-color rosewater #f2d5cf;
window {
border: none;
font-family: DejaVuSansM Nerd Font, sans-serif;
font-size: 13px;
color: @text;
}
window#waybar {
color: @text;
background-color: rgba(0, 0, 0, 0);
transition-property: background-color;
transition-duration: 0.5s;
transition-duration: .5s;
}
window#waybar.hidden {
opacity: 0.2;
}
#workspaces {
/* background: @overlay0; */
}
#workspaces button {
color: @text;
background: @background3;
/* margin: 7px 5px 10px 5px; */
}
#workspaces button:hover {
background: @surface0;
color: @text;
}
#workspaces button.active {
color: @crust;
background: @overlay2;
border: none;
}
#clock,
#battery,
#network,
#power-profiles-daemon,
#wireplumber {
padding: 0px 20px;
border-radius: 8px;
margin-left: 5px;
color: @crust;
}
#wireplumber {
padding: 0px 20px 0px 17px;
background-color: @teal;
}
#network {
padding: 0px 15px 0px 20px;
background-color: @green;
}
#battery {
background-color: @lavender;
}
#clock {
background-color: @pink;
}
#power-profiles-daemon {
background-color: @mauve;
}
@keyframes blink {
to {
background-color: rgba(30, 34, 42, 0.5);
color: #abb2bf;
}
}
#battery.critical:not(.charging) {
color: #f53c3c;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}