From 120ba475b9a9631afc64d552f4efdb4d13c308b4 Mon Sep 17 00:00:00 2001 From: Buliway Date: Sat, 3 Aug 2024 13:23:01 +0300 Subject: [PATCH] test2 --- README.md | 4 +- flake.nix | 2 +- modules/home-manager/browsers/librewolf.nix | 2 +- modules/home-manager/bundle.nix | 6 +- .../file-managers/ranger/commands.py | 3 +- modules/home-manager/wm/bspwm.nix | 3 - modules/home-manager/wm/bspwm/bspwm.md | 1234 +++++++++++++++++ modules/home-manager/wm/bspwm/bspwm.nix | 7 + modules/home-manager/wm/bspwm/bspwmrc | 91 ++ modules/home-manager/wm/dunst.nix | 366 +++++ modules/home-manager/wm/lockscreen.nix | 80 ++ modules/home-manager/wm/polybar.nix | 4 +- modules/home-manager/wm/rofi.nix | 3 - modules/home-manager/wm/rofi/rofi.nix | 46 + modules/home-manager/wm/sxhkd.nix | 66 +- modules/nixos/network.nix | 3 +- modules/nixos/sound.nix | 3 +- nixos/configuration.nix | 3 +- nixos/filesystems.nix | 9 + nixos/packages.nix | 39 +- 20 files changed, 1945 insertions(+), 29 deletions(-) delete mode 100644 modules/home-manager/wm/bspwm.nix create mode 100644 modules/home-manager/wm/bspwm/bspwm.md create mode 100644 modules/home-manager/wm/bspwm/bspwm.nix create mode 100644 modules/home-manager/wm/bspwm/bspwmrc create mode 100644 modules/home-manager/wm/dunst.nix create mode 100644 modules/home-manager/wm/lockscreen.nix delete mode 100644 modules/home-manager/wm/rofi.nix create mode 100644 modules/home-manager/wm/rofi/rofi.nix create mode 100644 nixos/filesystems.nix diff --git a/README.md b/README.md index 7b9593e..db673e2 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -Это мои приватные дотсы \ No newline at end of file +Это мои приватные дотсы + +Искать иконки для nerd шрифта можно [тут](https://www.nerdfonts.com/cheat-sheet). diff --git a/flake.nix b/flake.nix index e0ec524..8008600 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,7 @@ outputs = { self, nixpkgs, ... }@inputs: # let - # system = "x86_64-linux"; + # system = "x86_64-linux"; # Не понимаю зачем, если это в hardware.nix указывается # pkgs = nixpkgs.legacyPackages.${system}; # in { diff --git a/modules/home-manager/browsers/librewolf.nix b/modules/home-manager/browsers/librewolf.nix index c6b24c1..1c0f65d 100644 --- a/modules/home-manager/browsers/librewolf.nix +++ b/modules/home-manager/browsers/librewolf.nix @@ -9,7 +9,7 @@ # General - # Search (Если надо вернуть гугл поисковик в стоке) + # # Search (Если надо вернуть гугл поисковик в стоке) # "browser.policies.runOncePerModification.extensionsUninstall" = [ # Удалить расширения # "amazondotcom@search.mozilla.org" # "ebay@search.mozilla.org" diff --git a/modules/home-manager/bundle.nix b/modules/home-manager/bundle.nix index d044c0b..875b62e 100644 --- a/modules/home-manager/bundle.nix +++ b/modules/home-manager/bundle.nix @@ -21,9 +21,11 @@ ./terminal/zellij.nix ./terminal/zsh.nix - ./wm/bspwm.nix + ./wm/bspwm/bspwm.nix + ./wm/rofi/rofi.nix + ./wm/dunst.nix + ./wm/lockscreen.nix ./wm/polybar.nix - ./wm/rofi.nix ./wm/sxhkd.nix ./default-apps.nix diff --git a/modules/home-manager/file-managers/ranger/commands.py b/modules/home-manager/file-managers/ranger/commands.py index f618a67..350e45d 100644 --- a/modules/home-manager/file-managers/ranger/commands.py +++ b/modules/home-manager/file-managers/ranger/commands.py @@ -67,7 +67,8 @@ class YankContentWl(Command): self.fm.notify("{} is not a file".format(file.relative_path)) return if file.is_binary or file.image: - subprocess.check_call("wl-copy" + " < " + file.path, shell=True) + # subprocess.check_call("wl-copy" + " < " + file.path, shell=True) # Это было в стоке, не работает с видео + subprocess.check_call(f'for path in "{file.path}"; do echo "file://$path"; done | wl-copy -t text/uri-list', shell=True) else: self.fm.notify("{} is not an image file or a text file".format(file.relative_path)) diff --git a/modules/home-manager/wm/bspwm.nix b/modules/home-manager/wm/bspwm.nix deleted file mode 100644 index 0a81d45..0000000 --- a/modules/home-manager/wm/bspwm.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ # Управление окнами - -} \ No newline at end of file diff --git a/modules/home-manager/wm/bspwm/bspwm.md b/modules/home-manager/wm/bspwm/bspwm.md new file mode 100644 index 0000000..693b2c7 --- /dev/null +++ b/modules/home-manager/wm/bspwm/bspwm.md @@ -0,0 +1,1234 @@ +# bspc + +Copy of `man bspc` + +## Навигация + +- [Узнать имя и класс окна](#узнать-имя-и-класс-окна) +- [Что такое ноды и селекторы](#что-такое-ноды-и-селекторы) +- [SELECTORS](#selectors) + - [Node](#node) + - [Descriptors](#descriptors) + - [Path Jumps](#path-jumps) + - [Modifiers](#modifiers) + - [Desktop](#desktop) + - [Descriptors](#descriptors-1) + - [Modifiers](#modifiers-1) + - [Monitor](#monitor) + - [Descriptors](#descriptors-2) + - [Modifiers](#modifiers-2) +- [WINDOW STATES](#window-states) +- [NODE FLAGS](#node-flags) +- [STACKING LAYERS](#stacking-layers) +- [RECEPTACLES](#receptacles) +- [DOMAINS](#domains) + - [Node](#node-1) + - [Desktop](#desktop-1) + - [Monitor](#monitor-1) + - [Query](#query) + - [Wm](#wm) + - [Rule](#rule) + - [Config](#config) + - [Subscribe](#subscribe) + - [Quit](#quit) +- [EXIT CODES](#exit-codes) +- [SETTINGS](#settings) + - [Global Settings](#global-settings) + - [Monitor and Desktop Settings](#monitor-and-desktop-settings) + - [Desktop Settings](#desktop-settings) + - [Node Settings](#node-settings) +- [POINTER BINDINGS](#pointer-bindings) +- [EVENTS](#events) +- [REPORT FORMAT](#report-format) +- [ENVIRONMENT VARIABLES](#environment-variables) +- [Правила окон (bspc rule)](#правила-окон-bspc-rule) + +## Узнать имя и класс окна + +Чтобы узнать имя окна, пишем в терминал `xprop` и кликаем по нужному окну. Команда xprop выведет много информации о выбранном окне. . Ищите строки, содержащие `WM_CLASS` и `WM_NAME`. Или просто используем grep: +```sh +xprop | grep -E 'WM_CLASS|WM_NAME' +``` + +Будет что-то типо такого: +```sh +WM_CLASS(STRING) = "code", "Code" +WM_NAME(UTF8_STRING) = "bspwm.md - Visual Studio Code" +``` + +У `WM_CLASS` первое значение (code) это `instance_name`, второе значение (Code) это `class_name`. Узнал [тут](https://tronche.com/gui/x/xlib/ICC/client-to-window-manager/wm-class.html). + +В `WM_NAME` написано имя окна + +В `bspc rule` их можно указывать в следующем порядке `class_name:instance_name:name`. Если надо указать правила только по классу, то пишем лишь его. Если хочется по названию окна, то, как я понимаю, надо делать фул путь. Можно указать `*`, чтоб применить изменения ко всем окнам. + +Пример: +```sh +bspc rule --add 'Gimp:myinstance:MyImage' state=floating +``` + +## Что такое ноды и селекторы? + +Своими словами пока не могу объяснить, поэтому прикреплю ответ ChatGPT. + +### Что такое "node" в `bspwm`? + +В `bspwm` "node" — это базовый элемент, который может быть либо оконным элементом, либо контейнером (или рабочим пространством, или монитором). В `bspwm`, все элементы, с которыми вы работаете, рассматриваются как ноды в иерархической структуре. Давайте подробнее рассмотрим это: + +1. **Node**: + - **Окно**: Это может быть отдельное окно приложения, такое как терминал или браузер. + - **Контейнер**: Это контейнер, который может содержать другие ноды (окна или контейнеры). Контейнеры могут быть горизонтальными или вертикальными, и они могут содержать рабочие столы. + - **Рабочий стол**: Это рабочая область, на которой могут располагаться окна и контейнеры. + - **Монитор**: Это физический монитор, на котором отображаются рабочие столы и окна. + +### Как используются селекторы? + +Селекторы в `bspwm` используются для выбора конкретных нод, рабочих столов или мониторов. Вот как это работает: + +1. **Глобальные и относительные селекторы**: + - **Глобальные селекторы**: Назначают уникальное имя или идентификатор для нод, которые могут быть использованы для их выбора в командах. Например, вы можете использовать имя рабочего стола или монитора, чтобы нацелиться на него напрямую. + - **Относительные селекторы**: Используются для выбора нод относительно текущего состояния или фокуса. Например, можно выбрать следующую или предыдущую ноду относительно текущей активной ноды. + +2. **Примеры команд с селекторами**: + - **Выбор ноды по имени**: + ```sh + bspc node -d ^2 + ``` + Это переключит текущую ноду на рабочий стол с именем `2`. + + - **Перемещение ноды**: + ```sh + bspc node -s east + ``` + Это переместит текущую ноду в направлении востока от его текущего положения. + + - **Переключение на рабочий стол**: + ```sh + bspc desktop -f '^3' + ``` + Это переключит фокус на рабочий стол с именем `3`. + +### Как это выглядит в конфигурации? + +В вашем `.config/bspwm/bspwmrc` файле и в командах `bspc`, вы будете использовать селекторы, чтобы указать, какую ноду вы хотите настроить или изменить. Например: + +```sh +bspc monitor -d I II III IV V +``` + +Здесь селекторы `I`, `II`, `III`, `IV`, `V` используются для задания рабочих столов на текущем мониторе. + +### Примеры селекторов + +- **Глобальные селекторы**: + - `^1` — выбирает рабочий стол с именем `1`. + - `^2` — выбирает рабочий стол с именем `2`. + +- **Относительные селекторы**: + - `next` — выбирает следующую ноду в порядке, в котором они расположены. + - `prev` — выбирает предыдущую ноду. + +### Заключение + +В `bspwm`, "node" — это основное понятие, которое представляет собой любой элемент, который может быть оконным или контейнером. Селекторы используются для выбора и управления этими нодами. Понимание того, как использовать селекторы для выбора нод, позволяет более эффективно управлять оконным менеджером и настроить рабочее пространство по вашему вкусу. + +## SELECTORS + +Selectors are used to select a target node, desktop, or monitor. A selector can either describe the target relatively or name it globally. + +Selectors consist of an optional reference, a descriptor and any number of non-conflicting modifiers as follows: + +`[REFERENCE#]DESCRIPTOR(.MODIFIER)*` + +The relative targets are computed in relation to the given reference (the default reference value is focused). + +An exclamation mark can be prepended to any modifier in order to reverse its meaning. + +The following characters cannot be used in monitor or desktop names: #, :, .. + +The special selector % can be used to select a monitor or a desktop with an invalid name. + +### Node + +Select a node. + +``` +NODE_SEL := [NODE_SEL#] + (DIR|CYCLE_DIR|PATH|any|first_ancestor|last|newest| + older|newer|focused|pointed|biggest|smallest|) + [.[!]focused] + [.[!]active] + [.[!]automatic] + [.[!]local] + [.[!]leaf] + [.[!]window] + [.[!]STATE] + [.[!]FLAG] + [.[!]LAYER] + [.[!]SPLIT_TYPE] + [.[!]same_class] + [.[!]descendant_of] + [.[!]ancestor_of] +``` + +- **STATE**: `tiled` | `pseudo_tiled` | `floating` | `fullscreen` +- **FLAG**: `hidden` | `sticky` | `private` | `locked` | `marked` | `urgent` +- **LAYER**: `below` | `normal` | `above` +- **SPLIT_TYPE**: `horizontal` | `vertical` +- **PATH**: `@[DESKTOP_SEL:][[/]JUMP](/JUMP)*` +- **JUMP**: `first` | `1` | `second` | `2` | `brother` | `parent` | `DIR` + +#### Descriptors + +- `DIR` +Selects the window in the given (spacial) direction relative to the reference node. + +- `CYCLE_DIR` +Selects the node in the given (cyclic) direction relative to the reference node within a depth-first in-order traversal of the tree. + +- `PATH` +Selects the node at the given path. + +- `any` +Selects the first node that matches the given selectors. + +- `first_ancestor` +Selects the first ancestor of the reference node that matches the given selectors. + +- `last` +Selects the previously focused node relative to the reference node. + +- `newest` +Selects the newest node in the history of the focused node. + +- `older` +Selects the node older than the reference node in the history. + +- `newer` +Selects the node newer than the reference node in the history. + +- `focused` +Selects the currently focused node. + +- `pointed` +Selects the leaf under the pointer. + +- `biggest` +Selects the biggest leaf. + +- `smallest` +Selects the smallest leaf. + +- `)||) + [.[!]focused] + [.[!]active] + [.[!]occupied] + [.[!]urgent] + [.[!]local] +``` + +#### Descriptors + +- `CYCLE_DIR` +Selects the desktop in the given direction relative to the reference desktop. + +- `any` +Selects the first desktop that matches the given selectors. + +- `last` +Selects the previously focused desktop relative to the reference desktop. + +- `newest` +Selects the newest desktop in the history of the focused desktops. + +- `older` +Selects the desktop older than the reference desktop in the history. + +- `newer` +Selects the desktop newer than the reference desktop in the history. + +- `focused` +Selects the currently focused desktop. + +- `^` +Selects the nth desktop. If MONITOR_SEL is given, selects the nth desktop on the selected monitor. + +- `` +Selects the desktop with the given ID. + +- `` +Selects the desktop with the given name. + +#### Modifiers + +- `[!]focused` +Only consider the focused desktop. + +- `[!]active` +Only consider desktops that are the focused desktop of their monitor. + +- `[!]occupied` +Only consider occupied desktops. + +- `[!]urgent` +Only consider urgent desktops. + +- `[!]local` +Only consider desktops inside the reference monitor. + +### Monitor + +Select a monitor. + +``` +MONITOR_SEL := [MONITOR_SEL#] + (DIR|CYCLE_DIR|any|last|newest|older|newer|focused| + pointed|primary|^||) + [.[!]focused] + [.[!]occupied] +``` + +#### Descriptors + +- `DIR` +Selects the monitor in the given (spacial) direction relative to the reference monitor. + +- `CYCLE_DIR` +Selects the monitor in the given (cyclic) direction relative to the reference monitor. + +- `any` +Selects the first monitor that matches the given selectors. + +- `last` +Selects the previously focused monitor relative to the reference monitor. + +- `newest` +Selects the newest monitor in the history of the focused monitors. + +- `older` +Selects the monitor older than the reference monitor in the history. + +- `newer` +Selects the monitor newer than the reference monitor in the history. + +- `focused` +Selects the currently focused monitor. + +- `pointed` +Selects the monitor under the pointer. + +- `primary` +Selects the primary monitor. + +- `^` +Selects the nth monitor. + +- `` +Selects the monitor with the given ID. + +- `` +Selects the monitor with the given name. + +#### Modifiers + +- `[!]focused` +Only consider the focused monitor. + +- `[!]occupied` +Only consider monitors where the focused desktop is occupied. + +## WINDOW STATES + +- `tiled` +Its size and position are determined by the window tree. + +- `pseudo_tiled` +A tiled window that automatically shrinks but doesn’t stretch beyond its floating size. + +- `floating` +Can be moved/resized freely. Although it doesn’t use any tiling space, it is still part of the window tree. + +- `fullscreen` +Fills its monitor rectangle and has no borders. + +## NODE FLAGS + +- `hidden` +Is hidden and doesn’t occupy any tiling space. + +- `sticky` +Stays in the focused desktop of its monitor. + +- `private` +Tries to keep the same tiling position/size. + +- `locked` +Ignores the node --close message. + +- `marked` +Is marked (useful for deferred actions). A marked node becomes unmarked after being sent on a preselected node. + +- `urgent` +Has its urgency hint set. This flag is set externally. + + +## STACKING LAYERS + +There’s three stacking layers: `BELOW`, `NORMAL` and `ABOVE`. + +In each layer, the window are orderered as follow: tiled & pseudo-tiled < floating < fullscreen. + +## RECEPTACLES + +A leaf node that doesn’t hold any window is called a receptacle. When a node is inserted on a receptacle in automatic mode, it will replace the receptacle. A receptacle can be inserted on a node, preselected and killed. Receptacles can therefore be used to build a tree whose leaves are receptacles. Using the appropriate rules, one can then send windows on the leaves of this tree. This feature is used in examples/receptacles to store and recreate layouts. + +## DOMAINS + +### Node + +#### General Syntax + +`node [NODE_SEL] COMMANDS` + +If `NODE_SEL` is omitted, focused is assumed. + +#### Commands + +- `-f, --focus [NODE_SEL]` +Focus the selected or given node. + +- `-a, --activate [NODE_SEL]` +Activate the selected or given node. + +- `-d, --to-desktop DESKTOP_SEL [--follow]` +Send the selected node to the given desktop. If --follow is passed, the focused node will stay focused. + +- `-m, --to-monitor MONITOR_SEL [--follow]` +Send the selected node to the given monitor. If --follow is passed, the focused node will stay focused. + +- `-n, --to-node NODE_SEL [--follow]` +Send the selected node on the given node. If --follow is passed, the focused node will stay focused. + +- `-s, --swap NODE_SEL [--follow]` +Swap the selected node with the given node. If --follow is passed, the focused node will stay focused. + +- `-p, --presel-dir [~]DIR|cancel` +Preselect the splitting area of the selected node (or cancel the preselection). If ~ is prepended to DIR and the current preselection direction matches DIR, then the argument is interpreted as cancel. A node with a preselected area is said to be in "manual insertion mode". + +- `-o, --presel-ratio RATIO` +Set the splitting ratio of the preselection area. + +- `-v, --move dx dy` +Move the selected window by dx pixels horizontally and dy pixels vertically. + +- `-z, --resize top|left|bottom|right|top_left|top_right|bottom_right|bottom_left dx dy` +Resize the selected window by moving the given handle by dx pixels horizontally and dy pixels vertically. + +- `-r, --ratio RATIO|(+|-)(PIXELS|FRACTION)` +Set the splitting ratio of the selected node (0 < RATIO < 1). + +- `-R, --rotate 90|270|180` +Rotate the tree rooted at the selected node. + +- `-F, --flip horizontal|vertical` +Flip the the tree rooted at selected node. + +- `-E, --equalize` +Reset the split ratios of the tree rooted at the selected node to their default value. + +- `-B, --balance` +Adjust the split ratios of the tree rooted at the selected node so that all windows occupy the same area. + +- `-C, --circulate forward|backward` +Circulate the windows of the tree rooted at the selected node. + +- `-t, --state [~](tiled|pseudo_tiled|floating|fullscreen)` +Set the state of the selected window. If ~ is present and the current state matches the given state, then the argument is interpreted as the last state. + +- `-g, --flag hidden|sticky|private|locked|marked[=on|off]` +Set or toggle the given flag for the selected node. + +- `-l, --layer below|normal|above` +Set the stacking layer of the selected window. + +- `-i, --insert-receptacle` +Insert a receptacle node at the selected node. + +- `-c, --close` +Close the windows rooted at the selected node. + +- `-k, --kill` +Kill the windows rooted at the selected node. + + +### Desktop + +#### General Syntax + +`desktop [DESKTOP_SEL] COMMANDS` + +If `DESKTOP_SEL` is omitted, focused is assumed. + +#### COMMANDS + +- `-f, --focus [DESKTOP_SEL]` +Focus the selected or given desktop. + +- `-a, --activate [DESKTOP_SEL]` +Activate the selected or given desktop. + +- `-m, --to-monitor MONITOR_SEL [--follow]` +Send the selected desktop to the given monitor. If --follow is passed, the focused desktop will stay focused. + +- `-s, --swap DESKTOP_SEL [--follow]` +Swap the selected desktop with the given desktop. If --follow is passed, the focused desktop will stay focused. + +- `-l, --layout CYCLE_DIR|monocle|tiled` +Set or cycle the layout of the selected desktop. + +- `-n, --rename ` +Rename the selected desktop. + +- `-b, --bubble CYCLE_DIR` +Bubble the selected desktop in the given direction. + +- `-r, --remove` +Remove the selected desktop. + +### Monitor + +#### General Syntax + +`monitor [MONITOR_SEL] COMMANDS` + +If `MONITOR_SEL` is omitted, focused is assumed. + +#### Commands + +- `-f, --focus [MONITOR_SEL]` +Focus the selected or given monitor. + +- `-s, --swap MONITOR_SEL` +Swap the selected monitor with the given monitor. + +- `-a, --add-desktops ...` +Create desktops with the given names in the selected monitor. + +- `-o, --reorder-desktops ...` +Reorder the desktops of the selected monitor to match the given order. + +- `-d, --reset-desktops ...` +Rename, add or remove desktops depending on whether the number of given names is equal, superior or inferior to the number of existing desktops. + +- `-g, --rectangle WxH+X+Y` +Set the rectangle of the selected monitor. + +- `-n, --rename ` +Rename the selected monitor. + +- `-r, --remove` +Remove the selected monitor. + + +### Query + +#### General Syntax + +`query COMMANDS [OPTIONS]` + +#### Commands + +The optional selectors are references. + +- `-N, --nodes [NODE_SEL]` +List the IDs of the matching nodes. + +- `-D, --desktops [DESKTOP_SEL]` +List the IDs (or names) of the matching desktops. + +- `-M, --monitors [MONITOR_SEL]` +List the IDs (or names) of the matching monitors. + +- `-T, --tree` +Print a JSON representation of the matching item. + +#### Options + +`-m,--monitor [MONITOR_SEL], -d,--desktop [DESKTOP_SEL], -n, --node [NODE_SEL]` +Constrain matches to the selected monitor, desktop or node. The descriptor can be omitted for -M, -D and -N. + +`--names` +Print names instead of IDs. Can only be used with -M and -D. + + +### Wm + +#### General Syntax + +`wm COMMANDS` + +#### Commands + +- `-d, --dump-state` +Dump the current world state on standard output. + +- `-l, --load-state ` +Load a world state from the given file. The path must be absolute. + +- `-a, --add-monitor WxH+X+Y` +Add a monitor for the given name and rectangle. + +- `-O, --reorder-monitors ...` +Reorder the list of monitors to match the given order. + +- `-o, --adopt-orphans` +Manage all the unmanaged windows remaining from a previous session. + +- `-h, --record-history on|off` +Enable or disable the recording of node focus history. + +- `-g, --get-status` +Print the current status information. + +- `-r, --restart` +Restart the window manager + + +### Rule + +#### General Syntax + +`rule COMMANDS` + +#### Commands + +Create a new rule. +```sh +-a, --add (|*)[:(|*)[:(|*)]] + [-o|--one-shot] + [monitor=MONITOR_SEL|desktop=DESKTOP_SEL|node=NODE_SEL] + [state=STATE] + [layer=LAYER] + [split_dir=DIR] + [split_ratio=RATIO] + [(hidden|sticky|private|locked|marked|center| + follow|manage|focus|border)=(on|off)] + [rectangle=WxH+X+Y] +``` + + +- `-r, --remove ^|head|tail|(|*)[:(|*)[:(|\*)]]...` +Remove the given rules. + +- `-l, --list` +List the rules. + + +### Config + +#### General Syntax + +`config [-m MONITOR_SEL|-d DESKTOP_SEL|-n NODE_SEL] []` + +Get or set the value of . + + +### Subscribe + +#### General Syntax + +`subscribe [OPTIONS] (all|report|monitor|desktop|node|...)*` + +Continuously print events. See the EVENTS section for the description of each event. + +#### Options + +- `-f, --fifo` +Print a path to a FIFO from which events can be read and return. + +- `-c, --count COUNT` +Stop the corresponding bspc process after having received COUNT events. + + +### Quit + +#### General Syntax + +`quit []` + +Quit with an optional exit status. + + +## EXIT CODES + +If the server can’t handle a message, bspc will return with a non-zero exit code. + +## SETTINGS + +Colors are in the form `#RRGGBB`, booleans are `true`, `on`, `false` or `off`. + +All the boolean settings are false by default unless stated otherwise. + +### Global Settings + +- `normal_border_color` +Color of the border of an unfocused window. + +- `active_border_color` +Color of the border of a focused window of an unfocused monitor. + +- `focused_border_color` +Color of the border of a focused window of a focused monitor. + +- `presel_feedback_color` +Color of the `node --presel-{dir,ratio}` message feedback area. + +- `split_ratio` +Default split ratio. + +- `status_prefix` +Prefix prepended to each of the status lines. + +- `external_rules_command` +Absolute path to the command used to retrieve rule consequences. The command will receive the following arguments: `window ID`, `class name`, `instance name`, and `intermediate consequences`. The output of that command must have the following format: `key1=value1 key2=value2` ... (the valid key/value pairs are given in the description of the rule command). + +- `automatic_scheme` +The insertion scheme used when the insertion point is in automatic mode. Accept the following values: `longest_side`, `alternate`, `spiral`. + +- `initial_polarity` +On which child should a new window be attached when adding a window on a single window tree in automatic mode. Accept the following values: `first_child`, `second_child`. + +- `directional_focus_tightness` +The tightness of the algorithm used to decide whether a window is on the DIR side of another window. Accept the following values: `high`, `low`. + +- `removal_adjustment` +Adjust the brother when unlinking a node from the tree in accordance with the automatic insertion scheme. + +- `presel_feedback` +Draw the preselection feedback area. Defaults to `true`. + +- `borderless_monocle` +Remove borders of tiled windows for the `monocle` desktop layout. + +- `gapless_monocle` +Remove gaps of tiled windows for the `monocle` desktop layout. + +`top_monocle_padding, right_monocle_padding, bottom_monocle_padding, - left_monocle_padding` +Padding space added at the sides of the screen for the `monocle` desktop layout. + +- `single_monocle` +Set the desktop layout to `monocle` if there’s only one tiled window in the tree. + +- `pointer_motion_interval` +The minimum interval, in milliseconds, between two motion notify events. + +- `pointer_modifier` +Keyboard modifier used for moving or resizing windows. Accept the following values: `shift`, `control`, `lock`, `mod1`, `mod2`, `mod3`, `mod4`, `mod5`. + +- `pointer_action1, pointer_action2, pointer_action3` +Action performed when pressing `pointer_modifier` + `button`. Accept the following values: `move`, `resize_side`, `resize_corner`, `focus`, `none`. + +- `click_to_focus` +Button used for focusing a window (or a monitor). The possible values are: `button1`, `button2`, `button3`, `any`, `none`. Defaults to `button1`. + +- `swallow_first_click` +Don’t replay the click that makes a window focused if `click_to_focus` isn’t `none`. + +- `focus_follows_pointer` +Focus the window under the pointer. + +- `pointer_follows_focus` +When focusing a window, put the pointer at its center. + +- `pointer_follows_monitor` +When focusing a monitor, put the pointer at its center. + +- `mapping_events_count` +Handle the next mapping_events_count mapping notify events. A negative value implies that every event needs to be handled. + +- `ignore_ewmh_focus` +Ignore EWMH focus requests coming from applications. + +- `ignore_ewmh_fullscreen` +Block the fullscreen state transitions that originate from an EWMH request. The possible values are: `none`, `all`, or a comma separated list of the following values: `enter`, `exit`. + +- `ignore_ewmh_struts` +Ignore strut hinting from clients requesting to reserve space (i.e. task bars). + +- `center_pseudo_tiled` +Center pseudo tiled windows into their tiling rectangles. Defaults to `true`. + +- `honor_size_hints` +Apply ICCCM window size hints. + +- `remove_disabled_monitors` +Consider disabled monitors as disconnected. + +- `remove_unplugged_monitors` +Remove unplugged monitors. + +- `merge_overlapping_monitors` +Merge overlapping monitors (the bigger remains). + +### Monitor and Desktop Settings + +- `top_padding, right_padding, bottom_padding, left_padding` +Padding space added at the sides of the monitor or desktop. + +### Desktop Settings + +- `window_gap` +Size of the gap that separates windows. + +### Node Settings + +- `border_width` +Window border width. + +## POINTER BINDINGS + +- `click_to_focus` +Focus the window (or the monitor) under the pointer if the value isn’t none. + +- `pointer_modifier + button1` +Move the window under the pointer. + +- `pointer_modifier + button2` +Resize the window under the pointer by dragging the nearest side. + +- `pointer_modifier + button3` +Resize the window under the pointer by dragging the nearest corner. + +The behavior of `pointer_modifier` + `button` can be modified through the `pointer_action` setting. + +## EVENTS + +- `report` +See the next section for the description of the format. + +- `monitor_add ` +A monitor is added. + +- `monitor_rename ` +A monitor is renamed. + +- `monitor_remove ` +A monitor is removed. + +- `monitor_swap ` +A monitor is swapped. + +- `monitor_focus ` +A monitor is focused. + +- `monitor_geometry ` +The geometry of a monitor changed. + +- `desktop_add ` +A desktop is added. + +- `desktop_rename ` +A desktop is renamed. + +- `desktop_remove ` +A desktop is removed. + +- `desktop_swap ` +A desktop is swapped. + +- `desktop_transfer ` +A desktop is transferred. + +- `desktop_focus ` +A desktop is focused. + +- `desktop_activate ` +A desktop is activated. + +- `desktop_layout tiled|monocle` +The layout of a desktop changed. + +- `node_add ` +A node is added. + +- `node_remove ` +A node is removed. + +- `node_swap ` +A node is swapped. + +- `node_transfer ` +A node is transferred. + +- `node_focus ` +A node is focused. + +- `node_activate ` +A node is activated. + +- `node_presel (dir DIR|ratio RATIO|cancel)` +A node is preselected. + +- `node_stack below|above ` +A node is stacked below or above another node. + +- `node_geometry ` +The geometry of a window changed. + +- `node_state tiled|pseudo_tiled|floating|fullscreen on|off` +The state of a window changed. + +- `node_flag hidden|sticky|private|locked|marked|urgent on|off` +One of the flags of a node changed. + +- `node_layer below|normal|above` +The layer of a window changed. + +- `pointer_action move|resize_corner|resize_side begin|end` +A pointer action occurred. + +Please note that bspwm initializes monitors before it reads messages on its socket, therefore the initial monitor events can’t be received. + +## REPORT FORMAT + +Each report event message is composed of items separated by colons. + +Each item has the form `` where `` is the first character of the item. + +`M` +Focused monitor. + +`m` +Unfocused monitor. + +`O` +Occupied focused desktop. + +`o` +Occupied unfocused desktop. + +`F` +Free focused desktop. + +`f` +Free unfocused desktop. + +`U` +Urgent focused desktop. + +`u` +Urgent unfocused desktop. + +`L(T|M)` +Layout of the focused desktop of a monitor. + +`T(T|P|F|=|@)` +State of the focused node of a focused desktop. + +`G(S?P?L?M?)` +Active flags of the focused node of a focused desktop. + +## ENVIRONMENT VARIABLES + +- `BSPWM_SOCKET` +The path of the socket used for the communication between bspc and bspwm. If it isn’t defined, then the following path is used: `/tmp/bspwm__-socket.` + + + + + + + + + + + + + + +## Правила окон (bspc rule) + +Все параметры и их описание для [MONITOR_SEL](#monitor), [DESKTOP_SEL](#desktop) и [NODE_SEL](#node) указаны выше + +Текст ниже написан через ChatGPT, потому что разрабы ничего не пишут + +### monitor = MONITOR_SEL +Устанавливает монитор, на котором должно появляться окно. Можно указать конкретный монитор, используя его имя или идентификатор. Если монитор не указан, используется текущий фокусный монитор. +Возможные параметры: +- `monitor1` — Окно будет размещено на монитор1. +- `monitor2` — Окно будет размещено на монитор2. +- `primary` — Окно будет размещено на основной монитор. + +**Пример:** +```sh +bspc rule -a 'firefox' monitor=monitor2 +``` + +### desktop = DESKTOP_SEL +Устанавливает рабочий стол, на котором должно появляться окно. Можно указать конкретный рабочий стол по его имени или номеру. +Возможные параметры: +- `^1` — Окно будет размещено на рабочем столе 1. +- `^2` — Окно будет размещено на рабочем столе 2. +- `^myDesktop` — Окно будет размещено на рабочем столе с именем `myDesktop`. + +**Пример:** +```sh +bspc rule -a 'chrome' desktop='^2' +``` + +### node = NODE_SEL +Определяет, какой узел (окно) следует выбрать. Можно указать узел относительно текущего фокусного окна или по идентификатору узла. +Возможные параметры: +- `focused` — Фокусное окно. +- `newest` — Новейшее окно. +- `@/desktop1` — Узел по пути. + +**Пример:** +```sh +bspc rule -a 'terminal' node=focused +``` + +### state = STATE +Устанавливает состояние окна. +Возможные параметры: +- `tiled` — Плиточный. +- `pseudo_tiled` — Псевдоплиточный. +- `floating` — Плавающий. +- `fullscreen` — На весь экран. + +**Пример:** +```sh +bspc rule -a 'gimp' state=floating +``` + +### layer = LAYER +Устанавливает уровень, на котором окно должно быть отображено. +Возможные параметры: +- `below` — Под окнами. +- `normal` — Нормальный. +- `above` — Над окнами. + +**Пример:** +```sh +bspc rule -a 'polybar' layer=above +``` + +### split_dir = DIR +Определяет направление разделения окна. +Возможные параметры: +- `horizontal` — Горизонтальное. +- `vertical` — Вертикальное. + +**Пример:** +```sh +bspc rule -a 'editor' split_dir=horizontal +``` + +### split_ratio = RATIO +Устанавливает соотношение размеров при разделении окна. Значение от 0 до 1. +Возможные параметры: +- `0.5` — Равное разделение. +- `0.3` — Разделение с доминирующей одной частью. + +**Пример:** +```sh +bspc rule -a 'browser' split_ratio=0.3 +``` + +### hidden = on/off +Устанавливает видимость окна. +Возможные параметры: +- `on` — Скрыть окно. +- `off` — Показать окно. + +**Пример:** +```sh +bspc rule -a 'notifications' hidden=on +``` + +### sticky = on/off +Устанавливает, должно ли окно оставаться видимым на всех рабочих столах. +Возможные параметры: +- `on` — Всегда видимо. +- `off` — Не видимо на всех рабочих столах. + +**Пример:** +```sh +bspc rule -a 'systemtray' sticky=on +``` + +### private = on/off +Устанавливает, является ли окно приватным. Приватные окна не будут отображаться в списках окон. +Возможные параметры: +- `on` — Приватное окно. +- `off` — Обычное окно. + +**Пример:** +```sh +bspc rule -a 'settings' private=on +``` + +### locked = on/off +Устанавливает, будет ли окно заблокировано и не сможет быть перемещено или изменено. +Возможные параметры: +- `on` — Заблокировано. +- `off` — Разблокировано. + +**Пример:** +```sh +bspc rule -a 'video-player' locked=on +``` + +### marked = on/off +Устанавливает, отмечено ли окно. Отмеченные окна могут использоваться для специальных целей, таких как привязка к горячим клавишам. +Возможные параметры: +- `on` — Отмечено. +- `off` — Не отмечено. + +**Пример:** +```sh +bspc rule -a 'browser' marked=on +``` + +### center = on/off +Устанавливает, должно ли окно быть центрировано на рабочем столе. Вроде окно должно быть `floating` для этого. +Возможные параметры: +- `on` — Центрировать окно. +- `off` — Не центрировать окно. + +**Пример:** +```sh +bspc rule -a 'dialog' center=on +``` + +### follow = on/off +Устанавливает, будет ли окно следовать за фокусом. Если включено, окно будет следовать за фокусом текущего окна. +Возможные параметры: +- `on` — Следовать за фокусом. +- `off` — Не следовать за фокусом. + +**Пример:** +```sh +bspc rule -a 'chat' follow=on +``` + +### manage = on/off + +Устанавливает, должно ли окно управляться оконным менеджером. + +Если установлено `off`, то окно будет работать независимо от оконного менеджера. Оно может работать как "надстраница" или "плавающее окно", но независимо от управления его размерами и позицией. + +Пример использования: Screenkey — это инструмент для отображения на экране нажатий клавиш. Его полезно видеть постоянно, чтобы следить за тем, какие клавиши нажимаются, особенно при записи видеоуроков или презентаций. Сделав его "независимым", вы обеспечиваете его постоянное присутствие на экране без влияния bspwm, который может изменить его положение или размер. Таким образом, установка manage=off для Screenkey делает его "особенным" в глазах bspwm, позволяя работать вне стандартного управления окнами и обеспечивая его постоянное отображение без вмешательства оконного менеджера. + +Возможные параметры: +- `on` — Управлять окном. +- `off` — Не управлять окном. + +**Пример:** +```sh +bspc rule -a Screenkey manage=off +``` + +### focus = on/off +Устанавливает, должно ли окно получать фокус при создании. +Возможные параметры: +- `on` — Получить фокус. +- `off` — Не получать фокус. + +**Пример:** +```sh +bspc rule -a 'terminal' focus=on +``` + +### border = on/off +Устанавливает, должен ли у окна быть видимый бордер. +Возможные параметры: +- `on` — Показать бордер. +- `off` — Скрыть бордер. + +**Пример:** +```sh +bspc rule -a 'browser' border=off +``` + +### rectangle = WxH+X+Y +Устанавливает положение и размеры окна в виде прямоугольника. +Возможные параметры: +- `800x600+100+100` — Ширина 800 пикселей, высота 600 пикселей, смещение по X и Y. + +**Пример:** +```sh +bspc rule -a 'editor' rectangle=1024x768+100+50 +``` + +Этот формат описания и примеры помогут вам более четко понять, как использовать различные параметры `bspc rule` для настройки окон в `bspwm`. \ No newline at end of file diff --git a/modules/home-manager/wm/bspwm/bspwm.nix b/modules/home-manager/wm/bspwm/bspwm.nix new file mode 100644 index 0000000..3d69de8 --- /dev/null +++ b/modules/home-manager/wm/bspwm/bspwm.nix @@ -0,0 +1,7 @@ +{ # Управление окнами. В инете примерно ноль нормальной документации с описанием всех параметров. Проклинал + xsession.windowManager.bspwm = { + enable = true; + }; + + home.file.".config/bspwm/bspwmrc".source = "./bspwmrc"; +} diff --git a/modules/home-manager/wm/bspwm/bspwmrc b/modules/home-manager/wm/bspwm/bspwmrc new file mode 100644 index 0000000..2bfa5aa --- /dev/null +++ b/modules/home-manager/wm/bspwm/bspwmrc @@ -0,0 +1,91 @@ +#!/usr/bin/env bash + +# Описание настроек можно найти тут https://manpages.debian.org/testing/bspwm/bspc.1.en.html +# Или через "man bspc" в терминале +# Или в ./bspwm.md + +################ +## Автозапуск ## +################ + +# Это по сути терминал. Пишем то, как запускается прога через терминал и в конце & обязательно + +# # Как я понял, их не надо запускать, ведь они активированы через services..enable = true; +# # Если в nixos что-то включается через services, а не через programs, то nixos сам отвечает за автозапуск сервисов +# pgrep -x sxhkd > /dev/null || sxhkd & # Запускаем sxhkd если он не запущен +# pgrep -x polybar > /dev/null || polybar & # Запускаем polybar если он не запущен +# pgrep -x dunst > /dev/null || dunst & # Запускаем dunst если он не запущен + +# ksnip & +# nekoray & +# obsidian & +# planify & + +######################### +## Настройки мониторов ## +######################### + +# bspc monitor -d I II III IV V VI VII VIII IX X # Это было в стоке + +# Получаем имена активных мониторов +MONITORS=( $(xrandr --listactivemonitors | grep -E '^ [0-9]+:' | cut -d' ' -f6 | sed 's/\n/ /') ) + +# Если переменная MONITOR уже задана, то используется её значение. +# Если она не задана (то есть пуста или не существует), то используется первый элемент из массива MONITORS (то есть, первый активный монитор). +# Это гарантирует, что переменная MONITOR всегда будет содержать значение: либо установленное ранее, либо первый активный монитор по умолчанию. +# ":-" Это оператор в Bash, который используется для установки значения по умолчанию. Если переменная не задана или пуста, используется значение после :- +MONITOR="${MONITOR:-${MONITORS[0]}}" + +# Для запуска приложений на втором мониторе, если он доступен. Если второго монитора нет, используем первый. +MONITOR2="${MONITORS[1]:-${MONITORS[0]}}" + +# # Устанавливаем рабочие столы с именами от 1 до 10 для каждого монитора +# for mon in ${MONITORS[@]}; do +# bspc monitor $mon -d {1,2,3,4,5,6,7,8,9,10} +# done + +# Устанавливаем рабочие столы с именами от 1 до 10 для каждого монитора +bspc monitor -d 1 2 3 4 5 6 7 8 9 10 # Можно заменить на {1,2,3,4,5,6,7,8,9,10} + +# Настройка автоматического удаления настроек для отключённых и отсоединённых мониторов +bspc config remove_disabled_monitors true +bspc config remove_unplugged_monitors true + +##################### +## Настройки bspwm ## +##################### + +# Syntax - bspc config [-m MONITOR_SEL|-d DESKTOP_SEL|-n NODE_SEL] [] + +# Устанавливает ширину границ окон в 2 пикселя. +bspc config border_width 2 + +# Задаёт расстояние между окнами (отступ) в 5 пикселей. +bspc config window_gap 5 + +# Настраивает коэффициент разделения окон при их разделении. Значение 0.52 означает, что при разделении окно будет занимать 52% доступного пространства. +bspc config split_ratio 0.52 + +# В режиме monocle (максимизация окна на весь экран) границы окон будут скрыты. +bspc config borderless_monocle true + +# В режиме monocle будет отсутствовать отступ между окнами. +bspc config gapless_monocle true + +# Eсли вы активируете режим "monocle" на одном мониторе, другие мониторы остаются в обычном режиме +bspc config single_monocle false + +# Фокусировка следует за курсором +bspc config focus_follows_pointer true + +############################### +## Поведение конкретных окон ## +############################### + + +# Yдаляет все существующие правила для всех окон +# bspc rule -r '*' + +bspc rule -a 'polybar' layer=above + +bspc rule -a Screenkey manage=off diff --git a/modules/home-manager/wm/dunst.nix b/modules/home-manager/wm/dunst.nix new file mode 100644 index 0000000..d09b0cc --- /dev/null +++ b/modules/home-manager/wm/dunst.nix @@ -0,0 +1,366 @@ +{ pkgs, ... }: { + # Оповещения. Бинды можно делать через "dunstctl" + # https://wiki.archlinux.org/title/Dunst + # https://dunst-project.org/documentation/ + services.dunst = { + enable = true; + + iconTheme = { + name = "Gruvbox-Plus-Dark"; # Имя каталога в /usr/share/icons/ + package = pkgs.gruvbox-plus-icons; # Пакет иконок + size = "32x32"; + }; + + settings = { + global = { + ############### + ### Monitor ### + ############### + + monitor = 0; # Which monitor should the notifications be displayed on. + follow = "mouse"; # Display notification on focused monitor. Ignore "monitor" option + + ################ + ### Geometry ### + ################ + + width = 300; # Можно задать динамический размер. Например от 0 до 300 "width = (0, 300)" + height = 300; # The maximum height of a single notification, excluding the frame. + origin = "top-right"; # Position the notification in the top right corner + offset = "20x20"; # Offset from the origin + scale = 0; # Scale factor. It is auto-detected if value is 0. + notification_limit = 20; # Maximum number of notification (0 means no limit) + + #################### + ### Progress bar ### + #################### + + # Затестить прогресс бар через терминал: dunstify -h int:value:50 "Загрузка" "Процесс загрузки на 50%" + progress_bar = true; # Turn on the progess bar. It appears when a progress hint is passed with + progress_bar_height = 10; # This includes the frame, so make sure it's at least twice as big as the frame width. + progress_bar_frame_width = 1; # Set the frame width of the progress bar + progress_bar_min_width = 150; # Set the minimum width for the progress bar + progress_bar_max_width = 300; # Set the maximum width for the progress bar + + indicate_hidden = "yes"; # Show how many messages are currently hidden (because of notification_limit). + #transparency = 5; # Прозрачность от 0 до 100%. Требует композитор, например picom. Не вижу смысла его ставить + padding = 6; # Padding between text and separator. + horizontal_padding = 6; # Horizontal padding. + text_icon_padding = 0; # Padding between text and icon. + frame_width = 3; # Defines width in pixels of frame around the notification window. Set to 0 to disable. + frame_color = "#8EC07C"; # Defines color of the frame around the notification window. + sort = "no"; # Sort messages by urgency. + + # Don't remove messages, if the user is idle (no mouse or keyboard input) for longer than idle_threshold seconds. + # Set to 0 to disable. + # A client can set the 'transient' hint to bypass this. See the rules section for how to disable this if necessary + idle_threshold = 0; + + separator_height = 2; # Draw a line of "separator_height" pixel height between two notifications. Set to 0 to disable. + # Define a color for the separator. + # possible values are: + # * auto: dunst tries to find a color fitting to the background; + # * foreground: use the same color as the foreground; + # * frame: use the same color as the frame; + # * anything else will be interpreted as a X color. + separator_color = "frame"; + + ############ + ### Text ### + ############ + + font = "JetBrainsMono Nerd Font 11"; + + # The spacing between lines. + # If the height is smaller than the font height, it will get raised to the font height. + line_height = 3; + + # Possible values are: + # full: Allow a small subset of html markup in notifications: + # bold + # italic + # strikethrough + # underline + # + # For a complete reference see + # . + # + # strip: This setting is provided for compatibility with some broken + # clients that send markup even though it's not enabled on the + # server. Dunst will try to strip the markup but the parsing is + # simplistic so using this option outside of matching rules for + # specific applications *IS GREATLY DISCOURAGED*. + # + # no: Disable markup parsing, incoming notifications will be treated as + # plain text. Dunst will not advertise that it has the body-markup + # capability if this is set as a global setting. + # + # It's important to note that markup inside the format option will be parsed + # regardless of what this is set to. + markup = "full"; + + # The format of the message. Possible variables are: + # %a appname + # %s summary + # %b body + # %i iconname (including its path) + # %I iconname (without its path) + # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters + # %% Literal % + # Markup is allowed + format = "%s\n%b"; + + alignment = "center"; # Alignment of message text. Possible values are "left", "center" and "right". + vertical_alignment = "center"; # Vertical alignment of message text and icon. Possible values are "top", "center" and "bottom". + show_age_threshold = -1; # Show age of message if message is older than show_age_threshold seconds. Set to -1 to disable. + ellipsize = "middle"; # Specify where to make an ellipsis in long lines. Possible values are "start", "middle" and "end". + ignore_newline = "no"; # Ignore newlines '\n' in notifications. + stack_duplicates = true; # Stack together notifications with the same content + hide_duplicate_count = true; # Hide the count of stacked notifications with the same content + show_indicators = "no"; # Display indicators for URLs (U) and actions (A). + word_wrap = "yes"; # Split notifications into multiple lines if they don't fit into geometry. + + ############# + ### Icons ### + ############# + + enable_recursive_icon_lookup = true; # Чтоб не надо было указывать icon_path + icon_position = "off"; # Align icons left/right/off + + # Не знаю надо ли, когда я указал размер иконок в начале файла + #min_icon_size = 80; # Scale small icons up to this size, set to 0 to disable. + #max_icon_size = 80; # Scale larger icons down to this size, set to 0 to disable. + + ############### + ### History ### + ############### + + sticky_history = "yes"; # Should a notification popped up from history be sticky or timeout as if it would normally do. + history_length = 15; # Maximum amount of notifications kept in history + + ##################### + ### Misc/Advanced ### + ##################### + + dmenu = "${pkgs.rofi}/bin/rofi -dmenu -p dunst:"; # dmenu path (через что отображать gui) + browser = "${pkgs.xdg-utils}/bin/xdg-open"; # Browser for opening urls in context menu. + always_run_script = true; # Always run rule-defined scripts, even if the notification is suppressed + title = "Dunst"; # Define the title of the windows spawned by dunst + class = "Dunst"; # Define the class of the windows spawned by dunst + corner_radius = 0; # Скругление окон? + + # Ignore the dbus closeNotification message. + # Useful to enforce the timeout set by dunst configuration. + # Without this parameter, an application may close the notification sent before the user defined timeout. + ignore_dbusclose = false; + + ############## + ### Legacy ### + ############## + + force_xinerama = false; # Use the Xinerama extension instead of RandR for multi-monitor support. + + ############# + ### Mouse ### + ############# + + # Defines list of actions for each mouse event + # Possible values are: + # * none: Don't do anything. + # * do_action: Invoke the action determined by the action_name rule. If there is no + # such action, open the context menu. + # * open_url: If the notification has exactly one url, open it. If there are multiple + # ones, open the context menu. + # * close_current: Close current notification. + # * close_all: Close all notifications. + # * context: Open context menu for the notification. + # * context_all: Open context menu for all notifications. + # These values can be strung together for each mouse event, and + # will be executed in sequence. + mouse_left_click = "close_current"; + mouse_middle_click = "do_action, close_current"; + mouse_right_click = "close_all"; + + ############### + ### Wayland ### + ############### + + # These settings are Wayland-specific. They have no effect when using X11 + + # Uncomment this if you want to let notications appear under fullscreen + # applications (default: overlay) + # layer = top + + # Set this to true to use X11 output on Wayland. + # force_xwayland = false + + }; + + # Experimental features that may or may not work correctly. + # Do not expect them to have a consistent behaviour across releases. + experimental = { + # Calculate the dpi to use on a per-monitor basis. + # If this setting is enabled the Xft.dpi value will be ignored and instead + # dunst will attempt to calculate an appropriate dpi value for each monitor + # using the resolution and physical size. This might be useful in setups + # where there are multiple screens with very different dpi values. + per_monitor_dpi = false; + }; + + urgency_low = { + # IMPORTANT: colors have to be defined in quotation marks. + # Otherwise the "#" and following would be interpreted as a comment. + frame_color = "#3B7C87"; + foreground = "#3B7C87"; + background = "#191311"; + #background = "#2B313C"; + timeout = 4; + # Icon for notifications with low urgency, uncomment to enable + #default_icon = /path/to/icon; + }; + + urgency_normal = { + frame_color = "#5B8234"; + foreground = "#5B8234"; + background = "#191311"; + #background = "#2B313C"; + timeout = 6; + # Icon for notifications with normal urgency, uncomment to enable + #default_icon = /path/to/icon; + }; + + urgency_critical = { + frame_color = "#B7472A"; + foreground = "#B7472A"; + background = "#191311"; + #background = "#2B313C"; + timeout = 8; + # Icon for notifications with critical urgency, uncomment to enable + #default_icon = /path/to/icon; + }; + }; + }; +} + +# Every section that isn't one of the above is interpreted as a rules to +# override settings for certain messages. +# +# Messages can be matched by +# appname: Имя приложения, отправившего уведомление (не рекомендуется использовать, см. desktop_entry). +# body: Тело сообщения уведомления. +# category: Категория уведомления. +# desktop_entry: Имя записи в меню рабочего стола приложения. +# icon: Иконка уведомления. +# match_transient: Сопоставление с временными уведомлениями. +# msg_urgency: Срочность уведомления. +# stack_tag: Тег стека уведомлений. +# summary: Заголовок уведомления. +# +# and you can override the +# background: Цвет фона. +# foreground: Цвет текста. +# format: Форматирование текста. +# frame_color: Цвет рамки. +# fullscreen: Поведение при полноэкранных приложениях. +# new_icon: Новая иконка. +# set_stack_tag: Установка тега стека. +# set_transient: Установка временного уведомления. +# set_category: Установка категории. +# timeout: Время отображения уведомления. +# urgency: Срочность. +# skip_display: Пропуск отображения. +# history_ignore: Игнорирование истории. +# action_name: Имя действия. +# word_wrap: Перенос слов. +# ellipsize: Укорачивание текста. +# alignment: Выравнивание текста. +# +# Shell-like globbing will get expanded. +# +# Instead of the appname filter, it's recommended to use the desktop_entry filter. +# GLib based applications export their desktop-entry name. In comparison to the appname, +# the desktop-entry won't get localized. +# +# SCRIPTING +# You can specify a script that gets run when the rule matches by +# setting the "script" option. +# The script will be called as follows: +# script appname summary body icon urgency +# where urgency can be "LOW", "NORMAL" or "CRITICAL". +# +# NOTE: It might be helpful to run dunst -print in a terminal in order +# to find fitting options for rules. + +# Disable the transient hint so that idle_threshold cannot be bypassed from the +# client +#[transient_disable] +# match_transient = yes +# set_transient = no +# +# Make the handling of transient notifications more strict by making them not +# be placed in history. +#[transient_history_ignore] +# match_transient = yes +# history_ignore = yes + +# fullscreen values +# show: show the notifications, regardless if there is a fullscreen window opened +# delay: displays the new notification, if there is no fullscreen window active +# If the notification is already drawn, it won't get undrawn. +# pushback: same as delay, but when switching into fullscreen, the notification will get +# withdrawn from screen again and will get delayed like a new notification +#[fullscreen_delay_everything] +# fullscreen = delay +#[fullscreen_show_critical] +# msg_urgency = critical +# fullscreen = show + +#[espeak] +# summary = "*" +# script = dunst_espeak.sh + +#[script-test] +# summary = "*script*" +# script = dunst_test.sh + +#[ignore] +# # This notification will not be displayed +# summary = "foobar" +# skip_display = true + +#[history-ignore] +# # This notification will not be saved in history +# summary = "foobar" +# history_ignore = yes + +#[skip-display] +# # This notification will not be displayed, but will be included in the history +# summary = "foobar" +# skip_display = yes + +#[signed_on] +# appname = Pidgin +# summary = "*signed on*" +# urgency = low +# +#[signed_off] +# appname = Pidgin +# summary = *signed off* +# urgency = low +# +#[says] +# appname = Pidgin +# summary = *says* +# urgency = critical +# +#[twitter] +# appname = Pidgin +# summary = *twitter.com* +# urgency = normal +# +#[stack-volumes] +# appname = "some_volume_notifiers" +# set_stack_tag = "volume" +# +# vim: ft=cfg \ No newline at end of file diff --git a/modules/home-manager/wm/lockscreen.nix b/modules/home-manager/wm/lockscreen.nix new file mode 100644 index 0000000..f95eb0b --- /dev/null +++ b/modules/home-manager/wm/lockscreen.nix @@ -0,0 +1,80 @@ +# Есть разные варианты блокировки дисплея. Надо выбрать один +# - i3lock и разные бафы для него (https://i3wm.org/i3lock/) +# В стоке должен нормально работать. Со скриптами на визуал лагает и имеет кд секунды три +# - betterlockscreen (https://github.com/betterlockscreen/betterlockscreen/) +# Бафнутый i3lock без лагов +# - slock (https://tools.suckless.org/slock/) +# Suckless soft. Simple X display locker. Минимализм + +# Есть разные варианты автоматической блокировки дисплея. Требуют блокировщик, сами им не являются +# - xautolock (https://linux.die.net/man/1/xautolock) +# Утилита для автоматической блокировки экрана через определенный промежуток времени бездействия. +# - xidlehook (https://github.com/jD91mZM2/xidlehook) +# Утилита для выполнения команд или скриптов в зависимости от времени бездействия пользователя. + + +############################################ +## Вариант 1. Используем betterlockscreen ## +############################################ + +# Чтоб задать изображение для локскрина, надо написать это: +# betterlockscreen -u путь +# Путь может быть до изображения или каталога. Если каталог, то рандомит картинку +# betterlockscreen --lock (или -l) блокирует экран и применяет указанные фильтры для картинки + +# { +# services.betterlockscreen = { +# enable = true; +# inactiveInterval = 10; # Value used for {option}services.screen-locker.inactiveInterval. +# arguments = [ # List of arguments appended to ./betterlockscreen --lock [args] +# "dimblur" +# ]; +# }; +# } + +################################################################ +## Вариант 2. Используем betterlockscreen через другой сервис ## +################################################################ + +# { pkgs, ... }: { +# services.screen-locker = { +# enable = true; + +# # Inactive time interval in minutes after which session will be locked. +# # The minimum is 1 minute, and the maximum is 1 hour. +# # If {option}xautolock.enable is true, it will use this setting. +# # Otherwise, this will be used with {command}xset to configure the X server's screensaver timeout. +# inactiveInterval = 10; + +# # Команда для запуска локсрина. Тут "-c 000000" это чёрный цвет фона +# lockCmd = "${pkgs.betterlockscreen}/bin/betterlockscreen -l dimblur"; +# }; +# } + +######################################################################## +## Вариант 3. Используем betterlockscreen через продвинутый xidlehook ## +######################################################################## + +# { pkgs, ... }: { +# services.xidlehook = { +# enable = true; +# not-when-audio = true; +# not-when-fullscreen = true; +# timers = [ +# { +# delay = 600; +# command = "${pkgs.betterlockscreen}/bin/betterlockscreen -l dimblur"; +# } +# ]; +# }; +# } + +################################################################################### +## Вариант 4. Просто скачать betterlockscreen. Без автолока. Чтоб с биндом юзать ## +################################################################################### + +{ pkgs, ... }: { + home.packages = with pkgs; [ + betterlockscreen + ]; +} diff --git a/modules/home-manager/wm/polybar.nix b/modules/home-manager/wm/polybar.nix index 7501a8c..e0f160b 100644 --- a/modules/home-manager/wm/polybar.nix +++ b/modules/home-manager/wm/polybar.nix @@ -1,3 +1,5 @@ { # Статус бар внизу - + services.polybar = { + enable = true; + }; } \ No newline at end of file diff --git a/modules/home-manager/wm/rofi.nix b/modules/home-manager/wm/rofi.nix deleted file mode 100644 index 1f9eaa6..0000000 --- a/modules/home-manager/wm/rofi.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ # Запускатор софта и не только - -} \ No newline at end of file diff --git a/modules/home-manager/wm/rofi/rofi.nix b/modules/home-manager/wm/rofi/rofi.nix new file mode 100644 index 0000000..fb42d58 --- /dev/null +++ b/modules/home-manager/wm/rofi/rofi.nix @@ -0,0 +1,46 @@ +# Много готовых дизайнов для rofi https://github.com/adi1090x/rofi +# Там разделены launchers и applets. Я не сразу понял в чём разница +# Launchers просто запускает приложение и ничего больше +# Applets это кнопка, которой задаёшь своё имя и скрипт, который будет выполнен при нажатии +# Через applets можно запускать скрипты, проги от рута или отображать информацию по типу заряда акума +# Описание и генератор стилей https://comfoxx.github.io/rofi-old-generator/old.html +# Полезная инфа https://wiki.archlinux.org/title/Rofi +# Готовые скрипты https://github.com/davatorium/rofi/wiki/User-scripts + +{ pkgs, ... }: { # Запускатор софта и не только + programs.rofi = { # https://github.com/davatorium/rofi + enable = true; + font = "JetBrainsMono Nerd Font 10"; + terminal = "${pkgs.alacritty}/bin/alacritty"; # Path to the terminal which will be used to run console applications + location = "center"; # The location rofi appears on the screen. + # cycle = true; # Whether to cycle through the results list. + + pass = { # https://github.com/carnager/rofi-pass + enable = true; + # stores = []; # Directory roots of your password-stores. + # extraConfig = '' + # https://github.com/carnager/rofi-pass/blob/master/config.example + # ''; + }; + + plugins = with pkgs; [ + rofi-calc # https://github.com/svenstaro/rofi-calc + rofi-power-menu # https://github.com/jluttine/rofi-power-menu + # rofi-bluetooth # https://github.com/nickclyde/rofi-bluetooth + ]; + + extraConfig = { + + }; + }; + + # Заменил на greenclip, который включается как сервис в packages.nix + # services.clipmenu = { # https://github.com/cdown/clipmenu + # enable = true; + # launcher = "rofi"; + # }; + + # home.file = { + # ".config/rofi".source = "config.rasi"; + # }; +} diff --git a/modules/home-manager/wm/sxhkd.nix b/modules/home-manager/wm/sxhkd.nix index d88b0f4..e1ec57b 100644 --- a/modules/home-manager/wm/sxhkd.nix +++ b/modules/home-manager/wm/sxhkd.nix @@ -1,3 +1,65 @@ -{ # Бинды системы +{ pkgs, ... }: let + mainTerminal = "${pkgs.alacritty}/bin/alacritty"; + secondTerminal = "${pkgs.kitty}/bin/kitty"; +in { + services.sxhkd = { # Бинды системы + enable = true; -} \ No newline at end of file + keybindings = { + # bspwm + "super + q" = "oa"; + + # rofi + + # applications + + # terminal + "super + t" = mainTerminal; + "super ctrl + t" = secondTerminal; + # "super + shift + t" = mainTerminal; # Floating в центре экрана треть на треть или пиксели задать + # "super + shift + ctrl + t" = secondTerminal; # Floating в центре экрана треть на треть или пиксели задать + }; + }; +} + +# | Бинд | Описание | +# | ------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +# | `Print` | Выделить область | +# | `Print + Alt` | Все мониторы целиком | +# | `Print + Ctrl` | Активный монитор | +# | `Print + Shift` | Активное окно | +# | `Win + A` | Applications. Запускатор приложений. Rofi | +# | `Win + B` | Browser LibreWolf. Основа | +# | `Win + Shift + B` | Browser Firefox. Паблик активность | +# | `Win + Shift + Ctrl + B` | Browser Chromium. Пусть будет | +# | `Win + C` | Calculator имбовый. Можно даже написать `5600 USD to BTC` или `500 + 25%`. Через rofi | +# | `Win + Shift + C` | Color picker. Получить hex в буфер обмена | +# | `Win + Ctrl + C` | Color picker. Получить rgb в буфер обмена | +# | `Win + ЛКМ` | Переместить окно | +# | `Win + ПКМ` | Ресайзить окно | +# | `Win + scroll` | Скролишь колесо вверх = -1 воркспейс. Если вниз, то +1 | +# | `Win + 0-9/F1-F12` | Переключать воркспейсы с 1 по 22 | +# | `Win + Shift + 0-9/F1-F12` | Перекинуть активное окно на воркспейс с 1 по 22. Желательно silent, чтоб меня не перекидывало к проге | +# | `Win + arrow` | Менять фокус приложения через вин + стрелки | +# | `Win + Ctrl + left/right` | Переключает активные воркспейсы на мониторе. На левом 1 и 3, на правом 2 и 4. С 1 он делает +1 не на 2, а на 3 | +# | `Win + Ctrl + Down` | Переключиться на первый пустой воркспейс | +# | `Win + Shift + arrows` | Resize windows на 30 пикселей | +# | `Win + Shift + Ctrl + arrows` | Перемещает активное окно в указанном направлении | +# | `Win + Ctrl + Alt + left/right` | Как без альта, но не просто переключает, а перекидывает туда активное окно | +# | `Win + Enter` | Fullscreen toggle. Думал на F сделать, но не с моей раскладкой. Мб Alt + Enter | +# | `Win + Esc` | Прошлый воркспейс | +# | `Win + L` (мб с шифтом) | Lock screen | +# | `Win + P` | Passwords. Для утилиты pass всплывающее меню через rofi | +# | `Win + Q` | Quit. Офнуть приложение. Хз надо ли Alt + F4 добавлять | +# | `Win + V` | История буферa обмена (rofi) | +# | `Win + Alt + T` | Timer. Думаю через rofi сделать и утилиту timer | +# | `Win + I` | `I`DE? text `E`ditor? `N`ixVim? | +# | `Win + E` | `F`ile manager? `E`xplorer? | +# | `Win + F` | Toggle `f`loating. На f? сука не удобно на моей клаве | +# | Win + хз | Меняет позиционирование с горизонтального на вертикальный и обратно. Сейчас на `J`. Мб на `S`, от слова toggle split | +# | `Win + N` | `O`bsidian? `N`ote taking app? | +# | Win + хз | `T`odo. `T`ask tracker. Сука всё на Т, но не вариант. Либо с шифтом, либо придумать что-то типо `Z`адачи :D | +# | `Win + Backspace` | Launch logout menu. Через rofi | +# | `Ctrl + Shift + Esc` | Launch system monitor (btop) | +# | `Win + Tab` | Window switcher (rofi). Выбирать окно, а на нужный воркспейс само перекинет. Мб сделать alt+tab? | +# | `CapsLock` | Switch keyboard layout | diff --git a/modules/nixos/network.nix b/modules/nixos/network.nix index 19e98d9..273c27f 100644 --- a/modules/nixos/network.nix +++ b/modules/nixos/network.nix @@ -10,10 +10,11 @@ }; networking = { + # enableIPv6 = false; networkmanager.enable = true; hostName = "nixos"; # wireless.enable = true; # Enables wireless support via wpa_supplicant. }; - services.blueman.enable = true; + services.blueman.enable = true; # Tray for bluetooth } \ No newline at end of file diff --git a/modules/nixos/sound.nix b/modules/nixos/sound.nix index 6284a00..5f165b1 100644 --- a/modules/nixos/sound.nix +++ b/modules/nixos/sound.nix @@ -14,7 +14,8 @@ extraConfig.pipewire = { "10-clock-rate" = { context.properties = { - default.clock.rate = 48000; # Ниже измени под свой пк. У меня цап поддерживает всё это + default.clock.rate = 48000; + # Ниже измени под свой пк. У меня цап поддерживает всё это. Можешь оставить только 48000, если не знаешь что ставить default.clock.allowed-rates = [ 44100 48000 88200 96000 176400 192000 352800 384000 705600 768000 ]; }; }; diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 4ef2e3f..85578c9 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -12,6 +12,7 @@ in { inputs.home-manager.nixosModules.default ../modules/nixos/bundle.nix ./packages.nix + # ./filesystems.nix ]; boot.loader = { @@ -30,7 +31,7 @@ in { users.${username} = { isNormalUser = true; description = username; - extraGroups = [ "networkmanager" "wheel" "input" "libvirtd" ]; + extraGroups = [ "networkmanager" "wheel" "input" "libvirtd" "storage" "docker" ]; packages = with pkgs; []; }; }; diff --git a/nixos/filesystems.nix b/nixos/filesystems.nix new file mode 100644 index 0000000..1dbb44b --- /dev/null +++ b/nixos/filesystems.nix @@ -0,0 +1,9 @@ +{ + fileSystems = { + "/mnt/backups" = { + device = "/dev/disk/by-uuid/55287544-ce9f-4c93-a2f6-a63b69623fe1"; + fsType = "ext4"; + options = [ "defaults" "noatime" ]; #"uid=1000" "gid=1000" "dmask=007" "fmask=117" ]; + }; + }; +} \ No newline at end of file diff --git a/nixos/packages.nix b/nixos/packages.nix index 7b30f57..d6a7a78 100644 --- a/nixos/packages.nix +++ b/nixos/packages.nix @@ -5,6 +5,7 @@ services = { gvfs.enable = true; # Mount, trash, and other functionalities for Thunar file manager tumbler.enable = true; # Thumbnail support for Thunar file manager + greenclip.enable = true; # Clipboard manager. https://github.com/erebe/greenclip openssh.enable = true; # Потом удали. Это ставится на виртуалку, чтоб к ней конект по ssh работал. spice-vdagentd.enable = true; # Общий буфер обмена с виртуалкой #fstrim.enable = true; # Чистит ssd для норм производительности. Пока не пользуюсь @@ -34,7 +35,15 @@ go rustup - # Надо + # Архивы + zip # Архивировать + unzip # Разархивировать + unrar # Разархивировать + gnutar # Для .tar? + _7zz # Это пакет для 7z? + bzip2 # .bz2 архивы + + # Разное для терминала wget curl git @@ -42,29 +51,30 @@ xclip # Для работы буфера обмена ffmpeg_7 # Обработка видео. Нужен всегда и везде imagemagick # Обработка изображений. Мб тоже нужен всегда - - # Архивы - zip # Архивировать - unzip # Разархивировать - unrar # Разархивировать - gnutar # Для .tar? - _7zz # Это пакет для 7z? - - # Разное для терминала tree # Структура файлов в терминале gnugrep # Поиск в терминале gawk # Обработка и анализ текста в терминале rsync # Синхронизация файлов bat # A cat(1) clone with syntax highlighting and Git integration. + xorg.xwininfo # Для команды xprop? + xorg.xrandr # Для команды xrandr + xdg-utils # Set of command line tools that assist applications with a variety of desktop integration tasks + feh # Смотреть изображения. Вроде нужен в большом количестве софта как зависимость + playerctl # Command-line utility and library for controlling media players that implement MPRIS + xdotool # Fake keyboard/mouse input, window management, and more. Автоматизация + pass # Менеджер паролей в терминале btop # Монитор ресурсов в терминале yt-dlp # Скачивать и смотреть медиа с разных сайтов tasktimer # TUI task timer. Можно несколько таймеров с описанием запустить timer # A "sleep" with progress. Таймер на пельмени "timer 5m" - + libqalculate # Advanced calculator library fastfetch # Пишешь в теримнал и кидаешь всем со словами I use nixos btw + alacritty # Минималистичный терминал. Основной у меня + kitty # Самый быстрый протокол отображения медиа, но ssh через жопу работает + # GUI nekoray # VPN # TODO: Настройки надо сделать декларативными ksnip # Скрины. Аналоги - Flameshot # TODO: Настройки надо сделать декларативными @@ -72,6 +82,13 @@ qbittorrent # Торренты качать thunderbird # Почтовый клиент для своей почты opentabletdriver # Дрова на графический планшет # TODO: Настройки надо сделать декларативными? + screenkey # A screencast tool to display your keys + pavucontrol # PulseAudio Volume Control + # pwvucontrol # Pipewire Volume Control (Не знаю может ли полностью заменить pavucontrol) + networkmanagerapplet # Tray for network manager + brightnessctl # Brightness control for laptop + gcolor3 # GUI color picker + xcolor # CLI color picker https://github.com/Soft/xcolor # Browsers librewolf