Skip to content

Commit

Permalink
hyprland: add more binds and rules
Browse files Browse the repository at this point in the history
hypridle: enhance screen dimming
ags: make backgrounds more transparent
  • Loading branch information
fufexan committed May 21, 2024
1 parent fdbc45a commit 585f72d
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 19 deletions.
3 changes: 3 additions & 0 deletions home/programs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
home.packages = with pkgs; [
tdesktop

gnome.gnome-calculator
gnome.gnome-control-center

overskride
mission-center
wineWowPackages.wayland
Expand Down
17 changes: 12 additions & 5 deletions home/programs/wayland/hyprland/binds.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
let
screenshotarea = "hyprctl keyword animation 'fadeOut,0,0,default'; grimblast --notify copysave area; hyprctl keyword animation 'fadeOut,1,4,default'";

# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
workspaces = builtins.concatLists (builtins.genList (
x: let
Expand Down Expand Up @@ -50,8 +48,15 @@ in {
"$mod, Escape, exec, wlogout -p layer-shell"
# lock screen
"$mod, L, exec, loginctl lock-session"
# lock screen, to be used with the F10 special key on my keyboard
"$mod, I, exec, loginctl lock-session"
# select area to perform OCR on
"$mod, O, exec, run-as-service wl-ocr"
", XF86Favorites, exec, run-as-service wl-ocr"
# open calculator
", XF86Calculator, exec, run-as-service gnome-calculator"
# open settings
"$mod, U, exec, XDG_CURRENT_DESKTOP=gnome gnome-control-center"

# move focus
"$mod, left, movefocus, l"
Expand All @@ -60,13 +65,15 @@ in {
"$mod, down, movefocus, d"

# screenshot
# stop animations while screenshotting; makes black border go away
", Print, exec, ${screenshotarea}"
"$mod SHIFT, R, exec, ${screenshotarea}"
# area
", Print, exec, grimblast --notify copysave area"
"$mod SHIFT, R, exec, grimblast --notify copysave area"

# current screen
"CTRL, Print, exec, grimblast --notify --cursor copysave output"
"$mod SHIFT CTRL, R, exec, grimblast --notify --cursor copysave output"

# all screens
"ALT, Print, exec, grimblast --notify --cursor copysave screen"
"$mod SHIFT ALT, R, exec, grimblast --notify --cursor copysave screen"

Expand Down
11 changes: 6 additions & 5 deletions home/programs/wayland/hyprland/rules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@

lowopacity = [
"bar"
"calendar"
"notifications"
"osd"
"logout_dialog"
"system-menu"
];

highopacity = [
# ags
"calendar"
"system-menu"

"anyrun"
"logout_dialog"
];
Expand All @@ -38,6 +35,10 @@
# telegram media viewer
"float, title:^(Media viewer)$"

# gnome calculator
"float, class:^(org.gnome.Calculator)$"
"size 360 490, class:^(org.gnome.Calculator)$"

# allow tearing in games
"immediate, class:^(osu\!|cs2)$"

Expand Down
9 changes: 5 additions & 4 deletions home/programs/wayland/hyprland/settings.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{config, ...}: let
variant = "dark";
c = config.programs.matugen.theme.colors.colors_android.${variant};
c = config.programs.matugen.theme.colors.colors.${variant};
pointer = config.home.pointerCursor;
in {
wayland.windowManager.hyprland.settings = {
Expand Down Expand Up @@ -66,12 +66,13 @@ in {

group = {
groupbar = {
font_size = 16;
font_size = 10;
gradients = false;
text_color = "rgb(${c.primary})";
};

"col.border_active" = "rgba(${c.color_accent_primary}88);";
"col.border_inactive" = "rgba(${c.color_accent_primary_variant}88)";
"col.border_active" = "rgba(${c.primary_container}88);";
"col.border_inactive" = "rgba(${c.on_primary_container}88)";
};

input = {
Expand Down
2 changes: 1 addition & 1 deletion home/services/ags/style/colors-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $blue: #89b4fa;

$tooltip-bg: #000000;
$fg: #ffffff;
$bg: rgba(0, 0, 0, 0.5);
$bg: rgba(0, 0, 0, 0.3);
$bar-bg: rgba(0, 0, 0, 0.21);

$surface: rgba(255, 255, 255, 0.15);
Expand Down
4 changes: 2 additions & 2 deletions home/services/ags/utils/net.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Network } from "../imports.js";

export const getNetIcon = (conn) => {
if (conn == "none") return "";
export const getNetIcon = () => {
if (Network.connectivity == "none") return "";
if (Network.primary == "wired") return "network-wired";

return Network.wifi.icon_name;
Expand Down
7 changes: 5 additions & 2 deletions home/services/wayland/hypridle.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ in {
}
{
timeout = 290;
on-timeout = "${brillo} -u 1000000 -U 20";
on-resume = "${brillo} -u 1000000 -A 20";
# save the current brightness and dim the screen over a period of
# 1 second
on-timeout = "${brillo} -O; ${brillo} -u 1000000 -S 10";
# brighten the screen over a period of 500ms to the saved value
on-resume = "${brillo} -I -u 500000";
}
];
};
Expand Down

0 comments on commit 585f72d

Please sign in to comment.