Migrate to snowfall lib
This commit is contained in:
314
modules/home/xorg/bspwm/config.nix
Executable file
314
modules/home/xorg/bspwm/config.nix
Executable file
@ -0,0 +1,314 @@
|
||||
{ lib, config, ... }: {
|
||||
config = lib.mkIf (config.homecfg.wm == "X11") {
|
||||
xsession.windowManager.bspwm.extraConfig = ''
|
||||
#! /bin/bash
|
||||
|
||||
xrandr > /dev/shm/xrandr_output
|
||||
sxhkd &
|
||||
/nix/store/$(ls -la /nix/store | grep 'polkit-gnome' | grep '4096' | awk '{print $9}' | sed -n '$p')/libexec/polkit-gnome-authentication-agent-1 &
|
||||
|
||||
(xss-lock -- ~/.config/lock.sh || echo "AutoLock Hook Unavailable") &
|
||||
|
||||
wmname LG3D
|
||||
|
||||
export _IDISP=$(xrandr --query | grep " connected" | cut -d" " -f1 | grep "eDP" )
|
||||
|
||||
if [[ $(hostname) == 'Iriy' ]]; then
|
||||
xrandr --output DP-0 --scale 1
|
||||
xrandr --output DVI-I-0 --off --output DVI-I-1 --off --output HDMI-0 --off --output DP-0 --mode 3840x2160 --pos 1920x254 --rotate normal --scale 0.75 --primary --output DP-1 --off --output DP-2 --mode 1920x1080 --pos 0x0 --rotate normal --output DP-3 --off --output DP-4 --mode 1920x1080 --pos 4800x0 --rotate normal --output DP-5 --off
|
||||
bspc monitor DP-4 -d 1
|
||||
bspc monitor DP-2 -d 2 3
|
||||
bspc monitor DP-0 -d 0 4 5 6 7 8 9
|
||||
elif [[ $(hostname) == 'valinor' ]]; then
|
||||
bspc monitor $_IDISP -d 1 2 3 4 5 6 7 8 9
|
||||
else
|
||||
bspc monitor $_IDISP -d 1 2 3 4 5 6 7 8 9
|
||||
fi
|
||||
|
||||
bspc config remove_unplugged_monitors true
|
||||
bspc config remove_disabled_monitors true
|
||||
|
||||
bspc config border_width 2
|
||||
bspc config window_gap 6
|
||||
bspc config split_ratio 0.52
|
||||
bspc config borderless_monocle false
|
||||
bspc config gapless_monocle false
|
||||
|
||||
|
||||
bspc rule -a Screenkey manage=off
|
||||
|
||||
#bspc config super mod4
|
||||
bspc config pointer_action1 move
|
||||
bspc config pointer_action2 none
|
||||
bspc config pointer_action3 resize_corner
|
||||
#bspc config click_to_focus true
|
||||
#bspc config focus_follows_pointer true
|
||||
|
||||
xsetroot -cursor_name left_ptr
|
||||
|
||||
feh --bg-fill ~/cloud/dark.jpg
|
||||
|
||||
xrdb ~/.Xressources
|
||||
|
||||
dunst &
|
||||
eww open bar &
|
||||
|
||||
|
||||
## Tab Global - Floating/Global Rules
|
||||
bspc rule -a URxvt:yakuaki sticky=on state=floating hidden=on rectangle=$(($(xrandr --current | grep ' connected ' | uniq | awk '{print $4}' | cut -d 'x' -f1 | head -n1)-16))x600+$(($(xrandr --current | grep ' connected' | uniq | awk '{print $4}' | cut -d "+" -f2 | head -n1)+8))+$(($(xrandr --current | grep ' connected' | uniq | awk '{print $4}' | cut -d "+" -f3 | head -n1)+36))
|
||||
urxvt -name yakuaki -e ~/.config/script/yakuaki &
|
||||
kitty
|
||||
|
||||
bspc rule -a feh state=floating
|
||||
bspc rule -a Confirm state=floating
|
||||
bspc rule -a Preferences state=floating
|
||||
bspc rule -a dialog state=floating
|
||||
bspc rule -a menu state=floating
|
||||
bspc rule -a task_dialog state=floating
|
||||
bspc rule -a bubble state=floating
|
||||
|
||||
|
||||
## Tab 8 - Various & Utility
|
||||
bspc rule -a KeePassXC --one-shot desktop=8
|
||||
bspc rule -a Nextcloud desktop=8
|
||||
bspc rule -a Tk:tk desktop=8
|
||||
|
||||
## Tab 4 - Dev
|
||||
bspc rule -a VSCodium desktop=4
|
||||
|
||||
## Tab 3 - Games & Movies
|
||||
# ...
|
||||
# ...
|
||||
|
||||
## Tab 2 - Coms Main
|
||||
bspc rule -a TelegramDesktop desktop=2
|
||||
bspc rule -a Instagram desktop=2
|
||||
bspc rule -a lightcord desktop=2
|
||||
bspc rule -a discord desktop=2
|
||||
|
||||
|
||||
## Tab 1 - Internet
|
||||
bspc rule -a Firefox --one-shot desktop=1
|
||||
bspc rule -a firefox --one-shot desktop=1
|
||||
bspc rule -a Google-chrome desktop=1
|
||||
bspc rule -a Chromium=1
|
||||
|
||||
|
||||
sh ~/.config/startup.sh
|
||||
'';
|
||||
|
||||
xdg.configFile."startup.sh".text = ''
|
||||
#!/bin/sh
|
||||
|
||||
bspc desktop -f 0
|
||||
|
||||
keepassxc --keyfile ~/.config/hcl.ico ~/cloud/kek.kdbx --pw-stdin <<< $(rofi -dmenu -password -i -no-fixed-num-lines -p "Password:" -theme themes/pass) &
|
||||
|
||||
sleep 2
|
||||
bspc desktop -f 0
|
||||
|
||||
telegram-desktop &
|
||||
nextcloud &
|
||||
jellyfin-mpv-shim &
|
||||
flameshot &
|
||||
|
||||
sleep 2
|
||||
|
||||
firefox &
|
||||
|
||||
ibus-daemon -drx
|
||||
|
||||
easyeffects --gapplication-service &
|
||||
bspc desktop -f 0
|
||||
'';
|
||||
|
||||
services.sxhkd.extraConfig = ''
|
||||
super + Return
|
||||
urxvt
|
||||
|
||||
# terminal floating
|
||||
super + shift + Return
|
||||
~/.config/script/toggle_yakuaki
|
||||
|
||||
# program launcher
|
||||
super + d
|
||||
rofi -modi "drun" -show drun
|
||||
|
||||
super + shift + d
|
||||
rofi -show run
|
||||
|
||||
super + Tab
|
||||
rofi -show window
|
||||
|
||||
super + Escape
|
||||
pkill -USR1 -x sxhkd; \
|
||||
notify-send "sxhkd config reloaded"
|
||||
|
||||
#
|
||||
# bspwm hotkeys
|
||||
#
|
||||
|
||||
# quit bspwm normally
|
||||
super + alt + Escape
|
||||
bspc quit
|
||||
|
||||
# close and kill
|
||||
super + {_,shift + }w
|
||||
bspc node -{c,k}
|
||||
|
||||
# alternate between the tiled and monocle layout
|
||||
super + m
|
||||
bspc desktop -l next
|
||||
|
||||
# if the current node is automatic, send it to the last manual, otherwise pull the last leaf
|
||||
super + y
|
||||
bspc query -N -n focused.automatic && bspc node -n last.!automatic || bspc node last.leaf -n focused
|
||||
|
||||
# swap the current node and the biggest node
|
||||
super + g
|
||||
bspc node -s biggest
|
||||
|
||||
#
|
||||
# state/flags
|
||||
#
|
||||
|
||||
# set the window state
|
||||
super + {t,shift + t,s,f}
|
||||
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
|
||||
|
||||
# set the node flags
|
||||
super + ctrl + {x,y,z}
|
||||
bspc node -g {locked,sticky,private}
|
||||
|
||||
#
|
||||
# focus/swap
|
||||
#
|
||||
|
||||
# focus the node in the given direction
|
||||
super + shift + {_,ctrl + }{h,j,k,l}
|
||||
bspc node -{f,s} {west,south,north,east}
|
||||
|
||||
# focus the node for the given path jump
|
||||
# super + {p,b,comma,period}
|
||||
# bspc node -f @{parent,brother,first,second}
|
||||
|
||||
# focus the next/previous node
|
||||
super + {_,shift + }c
|
||||
bspc node -f {next,prev}
|
||||
|
||||
# focus the next/previous desktop
|
||||
super + bracket{left,right}
|
||||
bspc desktop -f {prev,next}
|
||||
|
||||
# focus the last node/desktop
|
||||
super + {grave,Tab}
|
||||
bspc {node,desktop} -f last
|
||||
|
||||
# focus the older or newer node in the focus history
|
||||
super + {o,i}
|
||||
bspc wm -h off; \
|
||||
bspc node {older,newer} -f; \
|
||||
bspc wm -h on
|
||||
|
||||
# focus or send to the given desktop
|
||||
super + {_,shift + }{1-9,0}
|
||||
bspc {desktop -f,node -d} {1-9,0}
|
||||
|
||||
# focus the next/previous node in the same window
|
||||
super + {comma,period}
|
||||
bspc node -f {next,prev}.local
|
||||
|
||||
#
|
||||
# preselect
|
||||
#
|
||||
|
||||
# preselect the direction
|
||||
super + ctrl + {h,j,k,l}
|
||||
bspc node -p {west,south,north,east}
|
||||
|
||||
# preselect the ratio
|
||||
super + ctrl + {1-9}
|
||||
bspc node -o 0.{1-9}
|
||||
|
||||
# cancel the preselection for the focused node
|
||||
super + ctrl + space
|
||||
bspc node -p cancel
|
||||
|
||||
# cancel the preselection for the focused desktop
|
||||
super + ctrl + shift + space
|
||||
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
|
||||
|
||||
#
|
||||
# move/resize
|
||||
#
|
||||
|
||||
# expand a window by moving one of its side outward
|
||||
super + alt + {h,j,k,l}
|
||||
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
|
||||
|
||||
# contract a window by moving one of its side inward
|
||||
super + alt + shift + {h,j,k,l}
|
||||
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
|
||||
|
||||
# move a floating window
|
||||
super + {Left,Down,Up,Right}
|
||||
bspc node -v {-20 0,0 20,0 -20,20 0}
|
||||
|
||||
super + {equal,minus}
|
||||
bspc config window_gap $(( $(bspc config window_gap) {+,-} 5 ))
|
||||
|
||||
super + ctrl + {Left,Right,Up,Down}
|
||||
bspc node @focused:/ --rotate {270,90,180,180}
|
||||
|
||||
super + shift + {Left,Right,Up,Down}
|
||||
bspc node -f @parent; bspc node -R 90
|
||||
|
||||
# Screenshots
|
||||
Print
|
||||
flameshot gui
|
||||
|
||||
# Lock Desktop
|
||||
super + l
|
||||
~/.config/script/lock.sh
|
||||
|
||||
# Lock Alternative
|
||||
super + k
|
||||
xtrlock
|
||||
|
||||
# VOLUME
|
||||
|
||||
XF86AudioMute
|
||||
pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
|
||||
XF86AudioRaiseVolume
|
||||
pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||
|
||||
XF86AudioLowerVolume
|
||||
pactl set-sink-volume @DEFAULT_SINK@ -5%
|
||||
|
||||
# BRIGHTNESS
|
||||
|
||||
# Brightness goes up
|
||||
#/home/gamehelp16/Documents/brightness -u
|
||||
XF86MonBrightnessUp
|
||||
brightnessctl set +16
|
||||
|
||||
# Brightness goes down
|
||||
XF86MonBrightnessDown
|
||||
brightnessctl set 16-
|
||||
|
||||
super + F1
|
||||
pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||
|
||||
XF86AudioMicMute
|
||||
pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||
|
||||
super + F7
|
||||
~/.config/script/screens.sh
|
||||
|
||||
XF86Display
|
||||
~/.config/script/screens.sh
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
11
modules/home/xorg/bspwm/default.nix
Executable file
11
modules/home/xorg/bspwm/default.nix
Executable file
@ -0,0 +1,11 @@
|
||||
{ lib, pkgs, config, ... }: {
|
||||
|
||||
imports = [ ./config.nix ./script.nix ./xressources.nix ];
|
||||
|
||||
config = lib.mkIf (config.homecfg.wm == "X11") {
|
||||
xsession.windowManager.bspwm = { enable = true; };
|
||||
services.sxhkd = { enable = true; };
|
||||
home.packages = with pkgs; [ xrandr arandr flameshot xtrlock i3lock ];
|
||||
|
||||
};
|
||||
}
|
89
modules/home/xorg/bspwm/script.nix
Executable file
89
modules/home/xorg/bspwm/script.nix
Executable file
@ -0,0 +1,89 @@
|
||||
{ lib, config, ... }: {
|
||||
config = lib.mkIf (config.homecfg.wm == "X11") {
|
||||
xdg.configFile."script/lock.sh".text = ''
|
||||
#!/bin/bash
|
||||
TMPBG=/tmp/screen.png
|
||||
RES=$(xrandr | grep 'current' | sed -E 's/.*current\s([0-9]+)\sx\s([0-9]+).*/\1x\2/')
|
||||
|
||||
ffmpeg -f x11grab -video_size $RES -y -i $DISPLAY -filter_complex "boxblur=10:1" -vframes 1 $TMPBG
|
||||
|
||||
pkill -xu $EUID -USR1 dunst
|
||||
i3lock -i $TMPBG &
|
||||
wait
|
||||
pkill -xu $EUID -USR1 dunst
|
||||
|
||||
rm $TMPBG
|
||||
'';
|
||||
|
||||
xdg.configFile."script/screens.sh".text = ''
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $(hostname) == 'Iriy' ]]; then
|
||||
MENU="$(rofi -sep "|" -dmenu -i -p 'Display Mode' -theme-str 'entry { placeholder: ""; } inputbar { children: [prompt, textbox-prompt-colon, entry];}' -location 2 -xoffset 0 -yoffset 34 -width 8 -hide-scrollbar -line-padding 4 -padding 10 -lines 6 <<< "None | S")"
|
||||
case "$MENU" in
|
||||
*None)
|
||||
xrandr --output DP-0 --scale 1
|
||||
xrandr --output DVI-I-0 --off --output DVI-I-1 --off --output HDMI-0 --off --output DP-0 --mode 3840x2160 --pos 1920x254 --rotate normal --scale 0.75 --primary --output DP-1 --off --output DP-2 --mode 1920x1080 --pos 0x0 --rotate normal --output DP-3 --off --output DP-4 --mode 1920x1080 --pos 4800x0 --rotate normal --output DP-5 --off
|
||||
bspc monitor DP-4 -d 1
|
||||
bspc monitor DP-2 -d 2 3
|
||||
bspc monitor DP-0 -d 0 4 5 6 7 8 9
|
||||
;;
|
||||
*S)
|
||||
xrandr --output DP-0 --scale 1
|
||||
xrandr --output DVI-I-0 --off --output DVI-I-1 --off --output HDMI-0 --off --output DP-0 --mode 3840x2160 --pos 1920x254 --rotate normal --scale 0.75 --primary --output DP-1 --off --output DP-2 --off --output DP-3 --off --output DP-4 --off --output DP-5 --off
|
||||
bspc monitor DP-0 -d 0 1 2 3 4 5 6 7 8 9
|
||||
;;
|
||||
*WIP) echo "WIP"
|
||||
esac
|
||||
elif [[ $(hostname) == 'valinor' ]]; then
|
||||
MENU="$(rofi -sep "|" -dmenu -i -p 'Display Mode' -theme-str 'entry { placeholder: ""; } inputbar { children: [prompt, textbox-prompt-colon, entry];}' -location 2 -xoffset 0 -yoffset 34 -width 8 -hide-scrollbar -line-padding 4 -padding 10 -lines 6 <<< "None|P0|P1")"
|
||||
case "$MENU" in
|
||||
*None)
|
||||
xrandr --output HDMI-1 --off --output DisplayPort-0 --off --output DisplayPort-1 --off --output eDP-1 --auto
|
||||
bspc monitor eDP -d 1 2 3 4 5 6 7 8 9
|
||||
;;
|
||||
*P0)
|
||||
xrandr --output HDMI-1 --auto --output eDP-1 --auto --below HDMI-1
|
||||
bspc monitor HDMI-1 --swap eDP-1
|
||||
bspc monitor HDMI-1 -d 0
|
||||
bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9
|
||||
;;
|
||||
*P1)
|
||||
xrandr --output eDP-1 --primary --mode 1920x1080 --pos 1200x1200 --rotate normal --output HDMI-1 --mode 1920x1200 --pos 1200x0 --rotate normal --output DisplayPort-1 --mode 1920x1200 --pos 0x210 --rotate left
|
||||
bspc monitor HDMI-1 --swap eDP-1
|
||||
bspc monitor HDMI-1 -d 0
|
||||
bspc monitor eDP -d 1 2 3 4 5 6 7 8 9
|
||||
;;
|
||||
*WIP) echo "WIP"
|
||||
esac
|
||||
fi
|
||||
feh --bg-fill ~/cloud/dark.jpg
|
||||
'';
|
||||
|
||||
xdg.configFile."script/yakuaki.sh".text = ''
|
||||
#!/bin/bash
|
||||
bspc query -N -n any.floating.hidden > /tmp/yakuakid
|
||||
~/.config/script/toggle_yakuaki
|
||||
$SHELL
|
||||
clear
|
||||
'';
|
||||
|
||||
xdg.configFile."script/toggle_yakuaki.sh".text = ''
|
||||
#!/bin/bash
|
||||
if [[ -e /tmp/yakuakid ]]
|
||||
then
|
||||
id=$(cat /tmp/yakuakid)
|
||||
exists=$(bspc query -N $id -n)
|
||||
if [[ $exists = $id ]]
|
||||
then
|
||||
bspc node $id --flag hidden;bspc node -f $id
|
||||
else
|
||||
rm /tmp/yakuakid
|
||||
urxvt -name yakuaki -e ~/.config/script/yakuaki &
|
||||
fi
|
||||
else
|
||||
~/.config/script/yakuaki
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
101
modules/home/xorg/bspwm/xressources.nix
Executable file
101
modules/home/xorg/bspwm/xressources.nix
Executable file
@ -0,0 +1,101 @@
|
||||
{ lib, config, ... }: {
|
||||
config = lib.mkIf (config.homecfg.wm == "X11") {
|
||||
xresources.extraConfig = ''
|
||||
|
||||
#define white #ffffff
|
||||
#define black #000000
|
||||
#define cFG #${config.colorScheme.colors.base07}
|
||||
#define cBG #${config.colorScheme.colors.base00}
|
||||
#define cP #${config.colorScheme.colors.base07}
|
||||
#define cH #${config.colorScheme.colors.base0C}
|
||||
#define c0 #${config.colorScheme.colors.base00}
|
||||
#define c1 #${config.colorScheme.colors.base01}
|
||||
#define c2 #${config.colorScheme.colors.base02}
|
||||
#define c3 #${config.colorScheme.colors.base03}
|
||||
#define c4 #${config.colorScheme.colors.base04}
|
||||
#define c5 #${config.colorScheme.colors.base05}
|
||||
#define c6 #${config.colorScheme.colors.base06}
|
||||
#define c7 #${config.colorScheme.colors.base07}
|
||||
#define c8 #${config.colorScheme.colors.base08}
|
||||
#define c9 #${config.colorScheme.colors.base09}
|
||||
#define cA #${config.colorScheme.colors.base0A}
|
||||
#define cB #${config.colorScheme.colors.base0B}
|
||||
#define cC #${config.colorScheme.colors.base0C}
|
||||
#define cD #${config.colorScheme.colors.base0D}
|
||||
#define cE #${config.colorScheme.colors.base0E}
|
||||
#define cF #${config.colorScheme.colors.base0F}
|
||||
|
||||
Xft.dpi: 96
|
||||
|
||||
URxvt.perl-ext-common: default,matcher,tabbed
|
||||
URxvt.url-launcher: firefox
|
||||
URxvt.matcher.button: 1
|
||||
URxvt.url-select.launcher: firefox
|
||||
URxvt.url-select.underline: true
|
||||
|
||||
!URxvt*loginShell: true
|
||||
!URxvt*borderless: true
|
||||
URxvt*dynamicColors: on
|
||||
|
||||
URxvt*foreground: cFG
|
||||
URxvt*background: cBG
|
||||
|
||||
URxvt*saveLines: 8192
|
||||
URxvt*mapAlert: true
|
||||
!URxvt*visualBell: true
|
||||
URxvt*pastableTabs: false
|
||||
|
||||
URxvt*transparent: True
|
||||
URxvt*shading: 25
|
||||
|
||||
URxvt*cursorColor: cP
|
||||
URxvt*throughColor: cF
|
||||
!URxvt*highlightColor: cH
|
||||
|
||||
URxvt*font: xft:IBMPlexMono:style=Regular:size=10, xft:OpenMoji:size=11, xft:MaterialDesignIcons:size=11
|
||||
URxvt*boldFont: xft:IBMPlexMono:style=Bold:size=10
|
||||
URxvt*italicFont: xft:IBMPlexMono:style=Oblique:size=10
|
||||
|
||||
URxvt.iso14755: False
|
||||
URxvt.scrollBar: False
|
||||
URxvt.scrollBar_right: False
|
||||
URxvt.scrollBar_floating: False
|
||||
URxvt.scrollstyle: rxvt
|
||||
|
||||
URxvt.tabbed.tabbar-fg: 7
|
||||
URxvt.tabbed.tabbar-bg: 0
|
||||
URxvt.tabbed.tab-fg: 7
|
||||
URxvt.tabbed.tab-bg: 1
|
||||
|
||||
URxvt.letterSpace: true
|
||||
|
||||
Xft.antialias: True
|
||||
Xft.autohint: False
|
||||
Xft.hinting: True
|
||||
|
||||
!*.foreground: cFG
|
||||
!*.background: cBF
|
||||
!*.cursorColor: cP
|
||||
|
||||
!*fading:35
|
||||
!*faceColor:c1
|
||||
|
||||
*.color0: c0
|
||||
*.color1: c1
|
||||
*.color2: c2
|
||||
*.color3: c3
|
||||
*.color4: c4
|
||||
*.color5: c5
|
||||
*.color6: c6
|
||||
*.color7: c7
|
||||
*.color8: c8
|
||||
*.color9: c9
|
||||
*.color10: cA
|
||||
*.color11: cB
|
||||
*.color12: cC
|
||||
*.color13: cD
|
||||
*.color14: cE
|
||||
*.color15: cF
|
||||
'';
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user