1
Fork 0

Started working on guest@euporie

This commit is contained in:
Matei Adriel 2023-05-28 02:00:10 +02:00
parent 0503a81ee8
commit 230a739327
No known key found for this signature in database
62 changed files with 188 additions and 135 deletions

View file

@ -0,0 +1,60 @@
# Common wayland stuff
{ lib, pkgs, upkgs, ... }: {
imports = [
./wofi.nix
./dunst.nix
../desktop/wezterm # Default hyprland terminal
];
# Makes some stuff run on wayland (?)
# Taken from [here](https://github.com/fufexan/dotfiles/blob/3b0075fa7a5d38de13c8c32140c4b020b6b32761/home/wayland/default.nix#L14)
# TODO: ask author what those do
# home.sessionVariables = {
# QT_QPA_PLATFORM = "wayland";
# SDL_VIDEODRIVER = "wayland";
# XDG_SESSION_TYPE = "wayland";
# };
# TODO: set up
# - wallpaper
# - notification daemon
# - screen recording
# - volume/backlight controls
# - eww bar
# - configure hyprland colors using base16 stuff
# - look into swaylock or whatever people use
# - look into greetd or something
# - multiple keyboard layouts
home.packages =
let
_ = lib.getExe;
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste";
# TODO: put this in it's own file perhaps?
# Taken from [here](https://github.com/fufexan/dotfiles/blob/3b0075fa7a5d38de13c8c32140c4b020b6b32761/home/wayland/default.nix#L14)
wl-ocr = pkgs.writeShellScriptBin "wl-ocr" ''
${_ pkgs.grim} -g "$(${_ pkgs.slurp})" -t ppm - \
| ${_ pkgs.tesseract5} - - \
| ${wl-copy}
${_ pkgs.libnotify} "Run ocr on area with output \"$(${wl-paste})\""
'';
in
with pkgs; [
# Utils
libnotify # Send notifications
wl-ocr # Custom ocr script
wl-clipboard # Clipboard manager
wlogout # Nice logout script
# REASON: not available on stable yet
upkgs.hyprpicker # Color picker
# Screenshot related tools
grim # Take screenshot
slurp # Area selector
];
}

View file

@ -0,0 +1,5 @@
{
services.dunst = {
enable = true;
};
}

View file

@ -0,0 +1,11 @@
{ pkgs, inputs, ... }: {
imports = [ ../default.nix ];
home.packages = [ inputs.hyprland-contrib.packages.${pkgs.system}.grimblast ];
wayland.windowManager.hyprland = {
enable = true;
recommendedEnvironment = true;
extraConfig = builtins.readFile ./hyprland.conf;
};
}

View file

@ -0,0 +1,131 @@
# Monitors
# https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,1
general {
cursor_inactive_timeout = 30 # Hide cursor after being inactive for 30s
resize_on_border = true # Click on borders with the mouse to resize
}
decoration {
rounding = 10 # Rounded corners of 10px
blur = true
blur_size = 10
blur_passes = 3
active_opacity = 0.9
inactive_opacity = 0.9
}
input {
kb_layout = us
# TODO: standardize the touchpad settings.
# Right now I also have similar settings for xorg.
touchpad {
natural_scroll = true # Invert scrolling direction
}
}
gestures {
workspace_swipe = true
workspace_swipe_fingers = 3
}
# Execute apps at launch
exec-once = NO_TMUX=1 wezterm & firefox & discord
# {{{ Window rules
# {{{ Automatically move stuff to workspaces
windowrulev2 = workspace 2 silent, title:^(.*Firefox.*)$
windowrulev2 = workspace 3 silent, title:^(.*(Disc|WebC)ord.*)$
windowrulev2 = workspace 6 silent, title:^(.*Spotify.*)$
# }}}
# {{{ Idleinhibit rules
# - while firefox is fullscreen
windowrulev2 = idleinhibit fullscreen, class:^(firefox)$
# - while watching videos
windowrulev2 = idleinhibit focus, class:^(mpv|.+exe)$
windowrulev2 = idleinhibit focus, class:^(firefox)$, title:^(.*YouTube.*)$
# }}}
# }}}
# {{{ Keybinds
$mod = SUPER
#u {{{ General
bind = $mod, C, killactive, # Kill current
bind = $mod, F, fullscreen, # Fullscreen
# Execute external things
bind = $mod, return, exec, NO_TMUX=1 wezterm # Launch wezterm
bind = $mod, T, exec, wl-ocr # Use ocr script
bind = $mod SHIFT, T, exec, hyprpicker | wl-copy && libnotify "Copied color $(wp-paste)" # Color picker
bind = $mod, Q, exec, wlogout # Show logout menu
bind = $mod, L, exec, loginctl lock-session # Lock screen
bind = $mod, P, exec, wofi --show drun # Launch app
# Work with the special workspace
bind = $mod, x, togglespecialworkspace,
bind = $mod SHIFT, x, movetoworkspace, special
# }}}
# {{{ Screenshotting
bind = $mod, S, exec, grimblast --notify copysave area
bind = $mod SHIFT, S, exec, grimblast --notify copysave active
bind = $mod CONTROL, S, exec, grimblast --notify copysave screen
# }}}
# {{{ Grouping
bind = $mod, G, togglegroup,
bind = $mod SHIFT, D, changegroupactive, f
bind = $mod SHIFT, S, changegroupactive, b
# }}}
# {{{ Mouse move/resize
# Move/resize windows with mod + LMB/RMB and dragging
bindm = $mod, mouse:272, movewindow
bindm = $mod, mouse:273, resizewindow
# }}}
# {{{ Move focus
bind = $mod, h, movefocus, l
bind = $mod, l, movefocus, r
bind = $mod, k, movefocus, u
bind = $mod, j, movefocus, d
# }}}
# {{{ Switch to workspace
bind = $mod, 1, workspace, 1
bind = $mod, 2, workspace, 2
bind = $mod, 3, workspace, 3
bind = $mod, 4, workspace, 4
bind = $mod, 5, workspace, 5
bind = $mod, 6, workspace, 6
bind = $mod, 7, workspace, 7
bind = $mod, 8, workspace, 8
bind = $mod, 9, workspace, 9
bind = $mod, 0, workspace, 10
# }}}
# {{{ Send to workspace
# Move active window to a workspace with mod + SHIFT + [0-9]
bind = $mod SHIFT, 1, movetoworkspace, 1
bind = $mod SHIFT, 2, movetoworkspace, 2
bind = $mod SHIFT, 3, movetoworkspace, 3
bind = $mod SHIFT, 4, movetoworkspace, 4
bind = $mod SHIFT, 5, movetoworkspace, 5
bind = $mod SHIFT, 6, movetoworkspace, 6
bind = $mod SHIFT, 7, movetoworkspace, 7
bind = $mod SHIFT, 8, movetoworkspace, 8
bind = $mod SHIFT, 9, movetoworkspace, 9
bind = $mod SHIFT, 0, movetoworkspace, 10
# }}}
# {{{ Resize
bind=SUPER,R,submap,resize
submap=resize
# sets repeatable binds for resizing the active window
binde=,l,resizeactive,10 0
binde=,h,resizeactive,-10 0
binde=,k,resizeactive,0 -10
binde=,j,resizeactive,0 10
bind=,escape,submap,reset
submap=reset
# }}}
# }}}

View file

@ -0,0 +1,23 @@
{ pkgs, config, ... }:
let
base16-wofi = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromSourcehut {
owner = "~knezi";
repo = "base16-wofi";
rev = "2182a5ad36d372e625b3d8e1a20ba7447e77ed22";
sha256 = "0hzn9lgh7rzahmzzdsgxnz4f8vvcpx5diwsnc7gb29gj9nbb1a8f";
};
};
in
{
programs.wofi = {
enable = true;
settings = {
allow_markup = true;
allow_images = true;
};
};
# xdg.configFile."wofi/style.css".source = base16-wofi;
}