Improve configs

This commit is contained in:
Tobias Reisinger 2023-07-06 23:38:19 +02:00
parent fdefb7037b
commit eb3067ff29
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
13 changed files with 67 additions and 20 deletions

View file

@ -96,7 +96,9 @@ _autostart_run_graphical () {
start-audio pipewire start-audio pipewire
wait-for-service "network-online.target" wait-for-service "network-online.target"
if ! pgrep keepassxc >/dev/null # Execute only if not already running
# Don't match keepassxc-proxy
if ! (pgrep -l keepassxc | grep -v prox) >/dev/null
then then
if pass x if pass x
then then

View file

@ -11,7 +11,7 @@ clip_image()
{ {
if [ -n "$WAYLAND_DISPLAY" ] if [ -n "$WAYLAND_DISPLAY" ]
then then
wc-copy -t image/png < "$screenshot_path" wl-copy -t image/png < "$screenshot_path"
else else
xclip -t image/png "$screenshot_path" -selection clipboard xclip -t image/png "$screenshot_path" -selection clipboard
fi fi
@ -56,7 +56,7 @@ main_no_upload()
{ {
if call_screenshot_tool if call_screenshot_tool
then then
clip_image $screenshot_path clip_image
fi fi
} }

View file

@ -1,4 +1,4 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# shellcheck disable=SC2046 # shellcheck disable=SC2046
vim $(find "$@") $EDITOR $(find "$@")

View file

@ -1,4 +1,4 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# shellcheck disable=SC2046 # shellcheck disable=SC2046
vim $(grep "$@") $EDITOR $(grep "$@")

View file

@ -2,7 +2,8 @@
export GOPATH="$XDG_DATA_HOME/go" export GOPATH="$XDG_DATA_HOME/go"
export NIX_PATH="$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/$(whoami)/channels${NIX_PATH:+:$NIX_PATH}" export NIX_PATH="$HOME/.nix-defexpr/channels:$NIX_PATH"
# add my paths # add my paths
export PATH="$HOME/.local/bin:$HOME/.bin:$PATH" export PATH="$HOME/.local/bin:$HOME/.bin:$PATH"

View file

@ -32,6 +32,7 @@
#spotifyd # spotify-daemon #spotifyd # spotify-daemon
(spotifyd.override { withMpris = true; }) # spotify-daemon (spotifyd.override { withMpris = true; }) # spotify-daemon
tokei # project-language statistics tokei # project-language statistics
trash-cli # trash utils
unzip # unzip unzip # unzip
vimHugeX # vim with clipboard support vimHugeX # vim with clipboard support
xdg-user-dirs # tool manage user directories xdg-user-dirs # tool manage user directories

View file

@ -1,8 +1,8 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
home.username = "tobias"; home.username = "serguzim";
home.homeDirectory = "/home/tobias"; home.homeDirectory = "/home/serguzim";
imports = [ imports = [
./common.nix ./common.nix

View file

@ -5,6 +5,7 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
cliphist # clipboard manager (history) cliphist # clipboard manager (history)
grim # needed for screenshots/flameshot grim # needed for screenshots/flameshot
slurp # needed for screenshots
swww # wallpaper daemon swww # wallpaper daemon
wl-clipboard # clipboard manager (tools) wl-clipboard # clipboard manager (tools)
]; ];

View file

@ -22,6 +22,7 @@ input {
numlock_by_default = true numlock_by_default = true
follow_mouse = 1 follow_mouse = 1
mouse_refocus = false
accel_profile = flat accel_profile = flat
touchpad { touchpad {
@ -38,9 +39,10 @@ general {
gaps_out = 6 gaps_out = 6
border_size = 1 border_size = 1
cursor_inactive_timeout = 3
no_cursor_warps = true no_cursor_warps = true
layout = dwindle layout = master
} }
decoration { decoration {
@ -70,12 +72,16 @@ dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this preserve_split = yes # you probably want this
no_gaps_when_only = yes # whether to apply gaps when there is only one window
no_gaps_when_only = yes
} }
master { master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true new_is_master = true
mfact = 0.5
no_gaps_when_only = yes
} }
source = ~/.config/hypr/binds.conf source = ~/.config/hypr/binds.conf

View file

@ -5,18 +5,28 @@ bind = $main_mod, return, exec, $TERMINAL
bind = $main_mod, Q, killactive, bind = $main_mod, Q, killactive,
bind = $main_mod, M, exit, bind = $main_mod, M, exit,
bind = $main_mod, S, togglefloating, bind = $main_mod, S, togglefloating,
bind = $main_mod, F, fullscreen,
bind = $main_mod, D, exec, j4-dmenu-desktop --dmenu="$DMENU" bind = $main_mod, D, exec, j4-dmenu-desktop --dmenu="$DMENU"
bind = $main_mod, P, pseudo, # dwindle bind = $main_mod, P, pseudo, # dwindle
bind = $main_mod, J, togglesplit, # dwindle bind = $main_mod, J, togglesplit, # dwindle
bind = $main_mod, Pause, exec, menu-shutdown bind = $main_mod, Pause, exec, menu-shutdown
bind = $main_mod, Print, exec, screenshot
bind = $main_mod SHIFT, R, exec, autostart-manage run-wayland bind = $main_mod SHIFT, R, exec, autostart-manage run-wayland
# Move focus with mainMod + arrow keys # Move focus with mainMod + hjkl keys
bind = $main_mod, left, movefocus, l bind = $main_mod, h, movefocus, l
bind = $main_mod, right, movefocus, r bind = $main_mod, j, movefocus, d
bind = $main_mod, up, movefocus, u bind = $main_mod, k, movefocus, u
bind = $main_mod, down, movefocus, d bind = $main_mod, l, movefocus, r
# Move window with mainMod + hjkl keys
bind = $main_mod SHIFT, h, movewindow, l
bind = $main_mod SHIFT, j, movewindow, d
bind = $main_mod SHIFT, k, movewindow, u
bind = $main_mod SHIFT, l, movewindow, r
# Move focus between windows
bind = $main_mod, c, layoutmsg, swapwithmaster master
# Switch workspaces with mainMod + [0-9] # Switch workspaces with mainMod + [0-9]
bind = $main_mod, 1, workspace, $ws01 bind = $main_mod, 1, workspace, $ws01

View file

@ -4,10 +4,31 @@
ws_media="[08]" ws_media="[08]"
ws_voip="[09]" ws_voip="[09]"
_handler_check_ws_media_empty() { ws_media_at="[ 0, 0 ]"
has_zero_windows=$(hyprctl workspaces -j | jq ".[] | select(.name == \"$ws_media\") | .windows == 0")
_handler_check_ws_media_empty() {
# split at ">>" and get the second part and take first part of that
win_id=$(echo "$1" | cut -d'>' -f3 | cut -d',' -f1)
media_got_emptied="false"
is_on_media_ws=$(hyprctl clients -j | jq ".[] | select(.address == \"0x$win_id\") | .workspace.name == \"$ws_media\"")
if [ "$is_on_media_ws" == "true" ]; then
media_got_emptied="true"
fi
was_on_media_ws=$(hyprctl clients -j | jq ".[] | select(.address == \"0x$win_id\") | .at == $ws_media_at")
if [ "$was_on_media_ws" == "true" ]; then
media_got_emptied="true"
fi
has_zero_windows=$(hyprctl workspaces -j | jq ".[] | select(.name == \"$ws_media\") | .windows == 0")
if [ "$has_zero_windows" == "true" ]; then if [ "$has_zero_windows" == "true" ]; then
media_got_emptied="true"
fi
if [ "$media_got_emptied" == "true" ]; then
hyprctl dispatch workspace "$ws_voip" hyprctl dispatch workspace "$ws_voip"
fi fi

View file

@ -7,6 +7,7 @@ windowrulev2 = workspace $ws_focus, class:^(jetbrains-)
windowrulev2 = workspace $ws_media, class:(Chromium) windowrulev2 = workspace $ws_media, class:(Chromium)
windowrulev2 = workspace $ws_media, class:(FreeTube) windowrulev2 = workspace $ws_media, class:(FreeTube)
windowrulev2 = workspace $ws_media, class:(qutebrowser-kiosk)
windowrulev2 = workspace $ws_voip silent, class:(discord) windowrulev2 = workspace $ws_voip silent, class:(discord)
windowrulev2 = workspace $ws_voip silent, class:(Element) windowrulev2 = workspace $ws_voip silent, class:(Element)
@ -18,7 +19,10 @@ windowrulev2 = workspace $ws_msg silent, class:(Signal)
### Specific rules ### Specific rules
#windowrulev2 = workspace $ws_steam silent,class:(steam) # Moves menues too :/ #windowrulev2 = workspace $ws_steam silent, class:(steam) # Moves menues too :/
#windowrulev2 = noinitialfocus,class:(steam) # No focus on menues :/ #windowrulev2 = noinitialfocus, class:(steam) # No focus on menues :/
windowrulev2 = move 100%-300 100%-30, class:(steam), title:^(notificationtoasts)
windowrulev2 = nofocus, class:(steam), title:^(notificationtoasts)
windowrulev2 = fullscreen, class:(FreeTube) windowrulev2 = fullscreen, class:(FreeTube)

View file

@ -3,6 +3,7 @@
"position": "bottom", "position": "bottom",
"height": 24, "height": 24,
"spacing": 6, "spacing": 6,
"mode": "dock",
"modules-left": [ "modules-left": [
"wlr/workspaces" "wlr/workspaces"
], ],
@ -79,7 +80,7 @@
"format": " {}", "format": " {}",
"interval": 3600, "interval": 3600,
"exec": "~/.config/waybar/custom/pacman", "exec": "~/.config/waybar/custom/pacman",
"on-click": "alacritty -e 'archlinux-update; pkill -SIGRTMIN+8 waybar'", "on-click": "alacritty -e 'archlinux-update'",
"return-type": "json", "return-type": "json",
"signal": 8 "signal": 8
}, },