dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 0e029354715fea0855f35289628a95113e791670
parent 2bf3869f5e323ed802651eae985fd1930a1a1033
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Thu, 12 Nov 2020 15:49:21 -0500

Fix screen.carbon

Diffstat:
Dbin/my-screen.carbon | 38--------------------------------------
Abin/screen.carbon | 34++++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 38 deletions(-)

diff --git a/bin/my-screen.carbon b/bin/my-screen.carbon @@ -1,38 +0,0 @@ -#!/bin/sh - -expected="eDP-1 DP-1-3" - -for mon in $expected -do - if xrandr -q | grep $mon | grep ' connected' >/dev/null 2>&1 - then - connected="$connected $mon" - else - disconnected="$disconnected $mon" - fi -done - -cmd="xrandr --dpi eDP-1" - -for mon in $connected -do - if [ "$mon" = "eDP-1" ] - then - cmd="$cmd --output eDP-1 --auto --primary" - elif [ "$mon" = "DP-1-3" ] - then - cmd="$cmd --output DP-1-3 --auto --right-of eDP-1 --scale 2x2" - fi -done - -for mon in $disconnected -do - cmd="$cmd --output $mon --off" -done - -echo "my-screen.local: Running cmd $cmd" >> "$HOME/var/log/my" -$cmd -if [ "$1" != "rio" ] -then - my wallpaper -fi diff --git a/bin/screen.carbon b/bin/screen.carbon @@ -0,0 +1,34 @@ +#!/bin/sh + +expected="eDP-1 DP-1-3" + +for mon in $expected +do + if xrandr -q | grep $mon | grep ' connected' >/dev/null 2>&1 + then + connected="$connected $mon" + else + disconnected="$disconnected $mon" + fi +done + +cmd="xrandr --dpi eDP-1" + +for mon in $connected +do + if [ "$mon" = "eDP-1" ] + then + cmd="$cmd --output eDP-1 --auto --primary" + elif [ "$mon" = "DP-1-3" ] + then + cmd="$cmd --output DP-1-3 --auto --right-of eDP-1 --scale 2x2" + fi +done + +for mon in $disconnected +do + cmd="$cmd --output $mon --off" +done + +echo "my-screen.local: Running cmd $cmd" >> "$HOME/var/log/my" +$cmd