Skip to content

Commit

Permalink
start-way-displays.sh and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
number5 committed Nov 19, 2024
1 parent 995d794 commit a9ff653
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 97 deletions.
42 changes: 21 additions & 21 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
inputs.nixpkgs.follows = "nixpkgs";
};


disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down
1 change: 0 additions & 1 deletion home/modules/dotfiles/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ _: {
...
}: {
config = {

xdg = {
enable = true;
configFile."git/config".source = ./gitconfig;
Expand Down
18 changes: 7 additions & 11 deletions home/modules/hypridle/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
_:

let
dpmsSettings =
{
timeout = 1200;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
};
in
{
_: let
dpmsSettings = {
timeout = 1200;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
};
in {
services.hypridle = {
enable = true;
settings = {
Expand Down
6 changes: 2 additions & 4 deletions home/modules/hyprlock/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{ pkgs, ... }:

{
home.packages = [ pkgs.hyprlock ];
{pkgs, ...}: {
home.packages = [pkgs.hyprlock];

xdg.configFile."hypr/hyprlock.conf".text = ''
general {
Expand Down
6 changes: 2 additions & 4 deletions home/modules/hyprpaper/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{ pkgs, ... }:

{
home.packages = [ pkgs.hyprpaper ];
{pkgs, ...}: {
home.packages = [pkgs.hyprpaper];
xdg.configFile."hypr/hyprpaper.conf".text = ''
preload=${./hyprland.png}
wallpaper=,${./hyprland.png}
Expand Down
21 changes: 5 additions & 16 deletions home/modules/way-displays/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
_:{ pkgs, ... }:
{
home.packages = [ pkgs.way-displays ];
_: {pkgs, ...}: {
home.packages = [pkgs.way-displays];

systemd.user.services.way-displays = {
Unit = {
Description = "way-displays";
Documentation = [ "man:way-displays(1)" ];
};

Service = {
ExecStart = "${pkgs.way-displays}/bin/way-displays";
};

Install = {
WantedBy = [ "graphical-session.target" ];
};
home.file.".config/hypr/start-way-displays.sh" = {
source = ./start-way-displays.sh;
executable = true;
};
}
5 changes: 5 additions & 0 deletions home/modules/way-displays/start-way-displays.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

sleep 1 # give Hyprland a moment to set its defaults

way-displays > "/tmp/way-displays.${XDG_VTNR}.${USER}.log" 2>&1
5 changes: 1 addition & 4 deletions home/modules/wayland/eww/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
self,
...
}: {
{self, ...}: {
pkgs,
config,
lib,
Expand Down
71 changes: 36 additions & 35 deletions home/modules/wayland/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
pkgs,
lib,
...
}:
let
}: let
fontPkgs = with pkgs; [
font-awesome # awesome fonts
material-design-icons # fonts with glyphs
Expand All @@ -28,23 +27,23 @@ let
pulsemixer # pulseaudio mixer
];

packages = with pkgs; [
brightnessctl # control laptop display brightness
loupe # image viewer
libnotify # notifications
nemo # file manager
nix-search.packages.${system}.default
wl-clipboard # clipboard support
wofi # app launcher
xwaylandvideobridge # screensharing bridge
] ++ fontPkgs ++ audioPkgs;
packages = with pkgs;
[
brightnessctl # control laptop display brightness
loupe # image viewer
libnotify # notifications
nemo # file manager
nix-search.packages.${system}.default
wl-clipboard # clipboard support
wofi # app launcher
xwaylandvideobridge # screensharing bridge
]
++ fontPkgs
++ audioPkgs;

gblast = lib.getExe pkgs.grimblast;
wpctl = "${pkgs.wireplumber}/bin/wpctl";


in
{
in {
imports = [
# ../../shared
# ../../foot
Expand Down Expand Up @@ -83,10 +82,10 @@ in
enable = true;
config = {
common = {
default = [ "hyprland" ];
default = ["hyprland"];
};
hyprland = {
default = [ "gtk" "hyprland" ];
default = ["gtk" "hyprland"];
};
};
extraPortals = with pkgs; [
Expand All @@ -98,26 +97,28 @@ in

wayland.windowManager.hyprland = {
enable = true;
extraConfig = (builtins.readFile ./hyprland.conf) + ''
bind=SUPER,P,exec,${lib.getExe pkgs.wofi} --show run --style=${./wofi.css} --term=footclient --prompt=Run
bind=SUPER,A,exec,${gblast} save area
bind=SUPER,S,exec,${gblast} save screen
bind=SUPERCTRL,L,exec,${lib.getExe pkgs.hyprlock}
# audio volume bindings
bindel=,XF86AudioRaiseVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindel=,XF86AudioLowerVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindl=,XF86AudioMute,exec,${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle
extraConfig =
(builtins.readFile ./hyprland.conf)
+ ''
bind=SUPER,P,exec,${lib.getExe pkgs.wofi} --show run --style=${./wofi.css} --term=footclient --prompt=Run
bind=SUPER,A,exec,${gblast} save area
bind=SUPER,S,exec,${gblast} save screen
bind=SUPERCTRL,L,exec,${lib.getExe pkgs.hyprlock}
# audio volume bindings
bindel=,XF86AudioRaiseVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindel=,XF86AudioLowerVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindl=,XF86AudioMute,exec,${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle
exec-once=${lib.getExe pkgs.hyprpaper}
exec-once=${pkgs.pyprland}/bin/pypr
exec-once=${pkgs.blueman}/bin/blueman-applet
exec-once=${pkgs.networkmanagerapplet}/bin/nm-applet --sm-disable --indicator
exec-once=${lib.getExe pkgs.pasystray}
'';
plugins = [ ];
exec-once=${lib.getExe pkgs.hyprpaper}
exec-once=${pkgs.pyprland}/bin/pypr
exec-once=${pkgs.blueman}/bin/blueman-applet
exec-once=${pkgs.networkmanagerapplet}/bin/nm-applet --sm-disable --indicator
exec-once=${lib.getExe pkgs.pasystray}
'';
plugins = [];
systemd = {
enable = true;
variables = [ "--all" ];
variables = ["--all"];
};
xwayland.enable = true;
};
Expand Down
4 changes: 4 additions & 0 deletions home/modules/wayland/hyprland/hyprland.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
debug:disable_scale_checks=true

exec-once = ${HOME}/.config/hypr/start-way-displays.sh

input {
kb_layout=us
kb_options=ctrl:nocaps
Expand Down Expand Up @@ -31,6 +33,8 @@ misc {

# the only sane way to get initial workspace commands working as expected
initial_workspace_tracking=0

vrr=1
}

gestures {
Expand Down

0 comments on commit a9ff653

Please sign in to comment.