mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-02-17 01:42:28 -05:00
test
This commit is contained in:
parent
5cfe09bc6e
commit
3ecfcdf152
3 changed files with 132 additions and 0 deletions
8
home/crow/common/optional/desktops/xorg/default.nix
Normal file
8
home/crow/common/optional/desktops/xorg/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{lib, ...}: {
|
||||||
|
# This file exists to define the options.
|
||||||
|
# The configuration is done via the imported files.
|
||||||
|
imports = [
|
||||||
|
./herbstluftwm.nix
|
||||||
|
./rofi.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
107
home/crow/common/optional/desktops/xorg/herbstluftwm.nix
Normal file
107
home/crow/common/optional/desktops/xorg/herbstluftwm.nix
Normal file
|
|
@ -0,0 +1,107 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
osConfig,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# To set wallpaper
|
||||||
|
hsetroot
|
||||||
|
# For xinput
|
||||||
|
perl
|
||||||
|
gnugrep
|
||||||
|
xorg.xinput
|
||||||
|
];
|
||||||
|
|
||||||
|
xsession.windowManager.herbstluftwm = let
|
||||||
|
mod = "Mod4";
|
||||||
|
in {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
tags = ["1" "2" "3" "4" "5" "6" "7" "8" "9"];
|
||||||
|
|
||||||
|
keybinds = lib.mkMerge [
|
||||||
|
{
|
||||||
|
"${mod}-q" = "close";
|
||||||
|
"${mod}-r" = "remove";
|
||||||
|
"${mod}-Return" = "spawn wezterm";
|
||||||
|
"${mod}-b" = "spawn ${config.programs.firefox.finalPackage}/bin/firefox";
|
||||||
|
"${mod}-d" = "spawn rofi -show drun";
|
||||||
|
"${mod}-Shift-s" = let
|
||||||
|
screenshot = pkgs.writeShellScriptBin "screenshot" ''
|
||||||
|
sleep 0.2
|
||||||
|
exec ${pkgs.maim}/bin/maim -s | ${pkgs.xclip}/bin/xclip -selection clipboard -t image/png
|
||||||
|
'';
|
||||||
|
in "spawn ${screenshot}/bin/screenshot";
|
||||||
|
"${mod}-Shift-Ctrl-l" = let
|
||||||
|
lock = pkgs.writeShellScriptBin "lock" ''
|
||||||
|
exec ${pkgs.xsecurelock}/bin/xsecurelock
|
||||||
|
'';
|
||||||
|
in "spawn ${lock}/bin/lock";
|
||||||
|
# Shift-Ctrl-odiaeresis = Shift+Ctrl+ö
|
||||||
|
"${mod}-Shift-Ctrl-odiaeresis" = "spawn ${pkgs.xsecurelock}/bin/xsecurelock";
|
||||||
|
"XF86Display" = "spawn autorandr -c";
|
||||||
|
"${mod}-Shift-d" = "spawn autorandr -c";
|
||||||
|
"${mod}-l" = "focus right";
|
||||||
|
"${mod}-k" = "focus up";
|
||||||
|
"${mod}-j" = "focus down";
|
||||||
|
"${mod}-h" = "focus left";
|
||||||
|
"${mod}-Shift-l" = "shift right";
|
||||||
|
"${mod}-Shift-k" = "shift up";
|
||||||
|
"${mod}-Shift-j" = "shift down";
|
||||||
|
"${mod}-Shift-h" = "shift left";
|
||||||
|
"${mod}-u" = "split bottom 0.5";
|
||||||
|
"${mod}-o" = "split right 0.5";
|
||||||
|
"${mod}-Ctrl-space" = "split explode";
|
||||||
|
"${mod}-f" = "fullscreen toggle";
|
||||||
|
"${mod}-s" = "floating toggle";
|
||||||
|
"${mod}-p" = "pseudotile toggle";
|
||||||
|
"${mod}-space" = "or , and . compare tags.focus.curframe_wcount = 2 . cycle_layout +1 vertical horizontal max vertical grid , cycle_layout +1";
|
||||||
|
}
|
||||||
|
(lib.mkMerge (lib.lists.imap0
|
||||||
|
# this won't work if tags has more than 9 elements
|
||||||
|
(i: _: let
|
||||||
|
index = builtins.toString i;
|
||||||
|
key = builtins.toString (i + 1);
|
||||||
|
in {
|
||||||
|
"${mod}-${key}" = "use_index ${index}";
|
||||||
|
"${mod}-Shift-${key}" = "move_index ${index}";
|
||||||
|
})
|
||||||
|
config.xsession.windowManager.herbstluftwm.tags))
|
||||||
|
];
|
||||||
|
|
||||||
|
mousebinds = {
|
||||||
|
"${mod}-Button1" = "move";
|
||||||
|
"${mod}-Button2" = "zoom";
|
||||||
|
"${mod}-Button3" = "resize";
|
||||||
|
};
|
||||||
|
|
||||||
|
rules = [
|
||||||
|
"focus=on" # focus new windows by default
|
||||||
|
"windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on"
|
||||||
|
"windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on"
|
||||||
|
"windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off"
|
||||||
|
"class=Spotify focus=off tag=4"
|
||||||
|
"class=Slack focus=off tag=2"
|
||||||
|
"class=zoom focus=off tag=2"
|
||||||
|
"class=firefox tag=1"
|
||||||
|
];
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
frame_border_active_color = "#ed8796";
|
||||||
|
frame_border_normal_color = "#181926";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
autorandr -c
|
||||||
|
|
||||||
|
xsetroot -cursor_name left_ptr &
|
||||||
|
polybar &
|
||||||
|
${config.programs.firefox.finalPackage}/bin/firefox &
|
||||||
|
${lib.optionalString config.modules.social.slack.enable "slack &"}
|
||||||
|
${lib.optionalString config.modules.nifty.media.spotify.enable "spotify &"}
|
||||||
|
${lib.optionalString ((builtins.length osConfig.modules.mouse.settings) > 0) "marimouse &"}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
17
home/crow/common/optional/desktops/xorg/rofi.nix
Normal file
17
home/crow/common/optional/desktops/xorg/rofi.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
programs.rofi = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = {
|
||||||
|
modi = "window,run,drun";
|
||||||
|
lines = 16;
|
||||||
|
padding = 30;
|
||||||
|
width = 45;
|
||||||
|
location = 0;
|
||||||
|
columns = 3;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue