diff --git a/bin/altaria/1080p-beeg-game b/bin/altaria/1080p-beeg-game new file mode 100755 index 0000000..3a560a5 --- /dev/null +++ b/bin/altaria/1080p-beeg-game @@ -0,0 +1,10 @@ +#!/bin/zsh +source ${0:a:h}/xorg.zsh + +XRANDR_SET \ + --compositing disable \ + --screen-blank disable \ + --background link-vs-gdizz.jpg \ + --sound-effect gamedock \ + ${XRANDR_ARGS__livingroom__1080p[@]} --pos 0x0 --primary \ + ; diff --git a/bin/altaria/1080p-office-game b/bin/altaria/1080p-office-game new file mode 100755 index 0000000..0c16735 --- /dev/null +++ b/bin/altaria/1080p-office-game @@ -0,0 +1,10 @@ +#!/bin/zsh +source ${0:a:h}/xorg.zsh + +XRANDR_SET \ + --compositing disable \ + --screen-blank disable \ + --background altaria.jpg \ + --sound-effect gamedock \ + ${XRANDR_ARGS__office__1080p[@]} --pos 0x0 --primary \ + ; diff --git a/bin/altaria/4k-beeg-game b/bin/altaria/4k-beeg-game new file mode 100755 index 0000000..7d2b87c --- /dev/null +++ b/bin/altaria/4k-beeg-game @@ -0,0 +1,10 @@ +#!/bin/zsh +source ${0:a:h}/xorg.zsh + +XRANDR_SET \ + --compositing disable \ + --screen-blank disable \ + --background vegeta.jpg \ + --sound-effect gamedock \ + ${XRANDR_ARGS__livingroom__2k[@]} --pos 0x0 --primary \ + ; diff --git a/bin/altaria/beeg-game b/bin/altaria/beeg-game index d1c2b40..a5fba3d 100755 --- a/bin/altaria/beeg-game +++ b/bin/altaria/beeg-game @@ -1,22 +1,10 @@ #!/bin/zsh source ${0:a:h}/xorg.zsh -OUTPUT=DP-2 - -: \ - && scwrypts desktop/xrandr/disconnect-all \ - && xrandr \ - --output $OUTPUT \ - --mode 2560x1440 --rate 119.88 \ - --rotate normal \ - --pos 0x0 \ - && sleep 4 \ - && xrandr --output $OUTPUT --primary \ +XRANDR_SET \ + --compositing disable \ + --screen-blank disable \ + --background roy-art.jpg \ + --sound-effect gamedock \ + ${XRANDR_ARGS__livingroom__2k[@]} --pos 0x0 --primary \ ; - -pkill compton -scwrypts desktop/pulse-audio/set-default-sink -- hdmi --id 0 --profile output:hdmi-surround71-extra2 - -scwrypts desktop/screen-blank -- disable -scwrypts desktop/i3/set-background -- roy-art.jpg -scwrypts desktop/play-sound -- gamedock diff --git a/bin/altaria/default b/bin/altaria/default deleted file mode 120000 index 38364f1..0000000 --- a/bin/altaria/default +++ /dev/null @@ -1 +0,0 @@ -homedock \ No newline at end of file diff --git a/bin/altaria/default b/bin/altaria/default new file mode 100755 index 0000000..c1fdbfa --- /dev/null +++ b/bin/altaria/default @@ -0,0 +1,8 @@ +#!/bin/zsh +source ${0:a:h}/xorg.zsh + +XRANDR_SET \ + --screen-blank disable \ + ${XRANDR_ARGS__office__4k[@]} --pos 0x0 --primary \ + ${XRANDR_ARGS__livingroom__4k[@]} --pos 0x0 \ + ; diff --git a/bin/altaria/dual-screen-game b/bin/altaria/dual-screen-game deleted file mode 100755 index a3f4d7f..0000000 --- a/bin/altaria/dual-screen-game +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/zsh -source ${0:a:h}/xorg.zsh - -OUTPUT_PRIMARY=DP-2 -OUTPUT_SECONDARY=HDMI-0 - -: \ - && scwrypts desktop/xrandr/disconnect-all \ - && xrandr \ - --output $OUTPUT_PRIMARY \ - --mode 2560x1440 --rate 119.88 \ - --rotate normal \ - --pos 0x0 \ - --output $OUTPUT_SECONDARY \ - --mode 2560x1440 --rate 119.88 \ - --rotate normal \ - --pos 2560x1440\ - && sleep 4 \ - && xrandr --output $OUTPUT_PRIMARY --primary \ - ; - -pkill compton -scwrypts desktop/pulse-audio/set-default-sink -- hdmi --id 0 --profile output:hdmi-surround71-extra2 - -scwrypts desktop/screen-blank -- disable -scwrypts desktop/i3/set-background -- roy-art.jpg -scwrypts desktop/play-sound -- gamedock diff --git a/bin/altaria/homedock b/bin/altaria/homedock deleted file mode 100755 index 71a7314..0000000 --- a/bin/altaria/homedock +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/zsh -source ${0:a:h}/xorg.zsh - -: \ - && scwrypts desktop/xrandr/disconnect-all \ - && xrandr \ - --output DP-0 \ - --primary \ - --mode 3840x2160 \ - --rotate normal \ - --pos 0x0 \ - && xrandr \ - --output HDMI-0 \ - --mode 3840x2160 \ - --rate 60.00 \ - --rotate normal \ - --pos 0x0 \ - --output DP-2 \ - --mode 3840x2160 \ - --rate 60.00 \ - --rotate normal \ - --pos 0x0 \ - ; - -(pkill compton; sleep 1; compton;) & -scwrypts desktop/pulse-audio/set-default-sink -- Komplete - -scwrypts desktop/screen-blank -- disable -scwrypts desktop/i3/set-background -- purple.jpg -scwrypts desktop/play-sound -- login diff --git a/bin/altaria/office-game b/bin/altaria/office-game index 7b19313..222919a 100755 --- a/bin/altaria/office-game +++ b/bin/altaria/office-game @@ -1,22 +1,10 @@ #!/bin/zsh source ${0:a:h}/xorg.zsh -OUTPUT=DP-0 - -: \ - && scwrypts desktop/xrandr/disconnect-all \ - && xrandr \ - --output $OUTPUT \ - --mode 3840x2160 \ - --rotate normal \ - --pos 0x0 \ - && sleep 4 \ - && xrandr --output $OUTPUT --primary \ +XRANDR_SET \ + --compositing disable \ + --screen-blank disable \ + --background captain-falcon.jpg \ + --sound-effect gamedock \ + ${XRANDR_ARGS__office__4k[@]} --pos 0x0 --primary \ ; - -pkill compton -scwrypts desktop/pulse-audio/set-default-sink -- Komplete - -scwrypts desktop/screen-blank -- disable -scwrypts desktop/i3/set-background -- roy-art.jpg -scwrypts desktop/play-sound -- gamedock diff --git a/bin/altaria/smol-game b/bin/altaria/smol-game deleted file mode 100755 index a3169ea..0000000 --- a/bin/altaria/smol-game +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/zsh -source ${0:a:h}/xorg.zsh - -OUTPUT=HDMI-0 - -: \ - && scwrypts desktop/xrandr/disconnect-all \ - && xrandr \ - --output $OUTPUT \ - --mode 2560x1440 --rate 119.88 \ - --rotate normal \ - --pos 0x0 \ - && sleep 4 \ - && xrandr --output $OUTPUT --primary \ - ; - -pkill compton - -scwrypts desktop/pulse-audio/set-default-sink -- hdmi --id 0 --profile output:hdmi-surround-extra1 - -scwrypts desktop/screen-blank -- disable -scwrypts desktop/i3/set-background -- roy-art.jpg -scwrypts desktop/play-sound -- gamedock diff --git a/bin/altaria/xorg.zsh b/bin/altaria/xorg.zsh index c9b1c55..db0c177 100644 --- a/bin/altaria/xorg.zsh +++ b/bin/altaria/xorg.zsh @@ -1,3 +1,73 @@ #!/bin/zsh source $HOME/.config/wryn/env.zsh + export DISPLAY=:0 + +##################################################################### + +XRANDR_RESOLUTION__4k='3840x2160' +XRANDR_RESOLUTION__2k='2560x1440' +XRANDR_RESOLUTION__1080p='1920x1080' + +XRANDR_OUTPUT__office='DP-0' +XRANDR_OUTPUT__livingroom='HDMI-0' + +XRANDR_ARGS__office__4k=(--output $XRANDR_OUTPUT__office --mode $XRANDR_RESOLUTION__4k) +#XRANDR_ARGS__office__2k=() # not available on office monitor +XRANDR_ARGS__office__1080p=(--output $XRANDR_OUTPUT__office --mode $XRANDR_RESOLUTION__1080p) + +XRANDR_ARGS__livingroom__4k=(--output $XRANDR_OUTPUT__livingroom --mode $XRANDR_RESOLUTION__4k --rate 119.88) +XRANDR_ARGS__livingroom__2k=(--output $XRANDR_OUTPUT__livingroom --mode $XRANDR_RESOLUTION__2k) +XRANDR_ARGS__livingroom__1080p=(--output $XRANDR_OUTPUT__livingroom --mode $XRANDR_RESOLUTION__1080p) + +##################################################################### + +XRANDR_SET() { + local ERRORS=0 + + local COMPOSITING=enable + local SCREEN_BLANK=enable + local BACKGROUND=purple.jpg + local SOUND_EFFECT=login + local XRANDR_ARGS=() + + while [[ $# -gt 0 ]] + do + case $1 in + --compositing ) COMPOSITING="$2" ; shift 1 ;; + --screen-blank ) SCREEN_BLANK="$2" ; shift 1 ;; + --background ) BACKGROUND="$2" ; shift 1 ;; + --sound-effect ) SOUND_EFFECT="$2" ; shift 1 ;; + + * ) XRANDR_ARGS+=($1) ; + esac + shift 1 + done + + case $COMPOSITING in + enable ) (pkill compton; sleep 1; compton;) & ;; + disable ) pkill compton ;; + * ) + echo "ERROR : invalid setting '$COMPOSITING' for compositing" >&2 + return 1 + esac + + case $SCREEN_BLANK in + enable | disable ) ;; + * ) + echo "ERROR : invalid setting '$SCREEN_BLANK' for screen blank" >&2 + return 1 + esac + + ########################################## + + scwrypts desktop/xrandr/disconnect-all + + xrandr ${XRANDR_ARGS[@]} + + sleep 1 + + scwrypts desktop/screen-blank -- $SCREEN_BLANK + scwrypts desktop/i3/set-background -- $BACKGROUND + scwrypts desktop/play-sound -- $SOUND_EFFECT +}