aboutsummaryrefslogtreecommitdiff
path: root/init_monitor.sh
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-04-02 15:02:21 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-04-02 15:02:21 +0200
commit0fff22af6d22a60c0fbf982f596b9c103bb1c6d3 (patch)
tree6d49f2265ed0da68546736ebbb98a9f9136f0af6 /init_monitor.sh
parentbe4fdf85c759b8920608ec4ad828a0daefdce767 (diff)
more versatile dual monitor scripts
Diffstat (limited to 'init_monitor.sh')
-rwxr-xr-xinit_monitor.sh23
1 files changed, 21 insertions, 2 deletions
diff --git a/init_monitor.sh b/init_monitor.sh
index e2ed676..c008461 100755
--- a/init_monitor.sh
+++ b/init_monitor.sh
@@ -15,9 +15,28 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+SCR1=$(xrandr -q | grep ' connected' | grep primary | awk '{print $1}')
+
while [ true ]; do
- if [ "$(xrandr -q | grep 'DP2' | awk '{print $2}')" == "connected" ]; then
- bspc monitor 'DP2' -n 2 -d 1 2 3 4 5 6 7 8 9
+ SCR2=$(xrandr -q | grep ' connected' | grep -v primary | awk '{print $1}')
+
+ if [ "$(xrandr -q | grep "${SCR2}" | awk '{print $2}')" == "connected" ]; then
+ xrandr --output "${SCR2}" --auto
+ xrandr --output "${SCR2}" --right-of "${SCR1}"
+
+ sleep 1
+
+ bspc monitor "${SCR2}" -n 2 -d 1 2 3 4 5 6 7 8 9
+
+ MODE=$(readlink ~/.config/polybar | sed 's/\//\n/g' | tail -n 1)
+ if [ "${MODE}" == "normal" ]; then
+ BG="wallpaper"
+ elif [ "${MODE}" == "unsafe" ]; then
+ BG="unsafe_wallpaper"
+ fi
+
+ feh --no-fehbg --bg-fill "${HOME}/.config/bspwm/${BG}"
+
exit 0
fi