Migrate to snowfall lib
This commit is contained in:
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
|
||||
'';
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user