diff --git a/98-monitor-hotplug.rules b/98-monitor-hotplug.rules new file mode 100644 index 0000000..8a87581 --- /dev/null +++ b/98-monitor-hotplug.rules @@ -0,0 +1 @@ +KERNEL=="card0", SUBSYSTEM=="drm", ACTION=="change", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/fabian/.Xauthority", RUN+="/bin/bash /usr/local/bin/auto_monitor.sh" diff --git a/auto_monitor.sh b/auto_monitor.sh new file mode 100755 index 0000000..398a42f --- /dev/null +++ b/auto_monitor.sh @@ -0,0 +1,22 @@ +#! /bin/sh +# +# monitors.sh +# Copyright (C) 2017 Fabian Ising +# +# Distributed under terms of the Apache v2.0 license. +# + +# Get out of town if something errors +set -e + +HDMI_STATUS=$( +# Copyright (C) 2016 fabian # # Distributed under terms of the MIT license. # ln -s $PWD/i3config ~/.config/i3/config ln -s $PWD/polybarconfig ~/.config/polybar/config ln -s $PWD/.xinitrc ~/.xinitrc +sudo ln -s $PWD/auto_monitor.sh /usr/local/bin/auto_monitor.sh +sudo ln -s $PWD/switch_monitors.sh /usr/local/bin/switch_monitors.sh +sudo ln -s $PWD/98-monitor-hotplug.rules /etc/udev/rules.d/98-monitor-hotplug.rules diff --git a/polybarconfig b/polybarconfig index fb49e87..d778df2 100644 --- a/polybarconfig +++ b/polybarconfig @@ -8,29 +8,8 @@ ;===================================================== [colors] -color15_i3wmthemer = ${xrdb:color15} -color14_i3wmthemer = ${xrdb:color14} -color13_i3wmthemer = ${xrdb:color13} -color12_i3wmthemer = ${xrdb:color12} -color11_i3wmthemer = ${xrdb:color11} -color10_i3wmthemer = ${xrdb:color10} -color09_i3wmthemer = ${xrdb:color9} -color08_i3wmthemer = ${xrdb:color8} -color07_i3wmthemer = ${xrdb:color7} -color06_i3wmthemer = ${xrdb:color6} -color05_i3wmthemer = ${xrdb:color5} -color04_i3wmthemer = ${xrdb:color4} -color03_i3wmthemer = ${xrdb:color3} -color02_i3wmthemer = ${xrdb:color2} -color01_i3wmthemer = ${xrdb:color1} -color00_i3wmthemer = ${xrdb:color0} -foreground_i3wmthemer = ${xrdb:foreground} -background_i3wmthemer = ${xrdb:background} - -;background = ${xrdb:color0:#222} background = #222 background-alt = #444 -;foreground = ${xrdb:color7:#222} foreground = #dfdfdf foreground-alt = #555 primary = #ffb52a @@ -38,7 +17,8 @@ secondary = #e60053 alert = #bd2c40 [bar/top] -;monitor = ${env:MONITOR:HDMI-1} +monitor = eDP-1 +monitor-fallback = HDMI-1 width = 100% height = 27 ;offset-x = 1% @@ -67,10 +47,13 @@ module-margin-right = 2 font-0 = fixed:pixelsize=10;1 font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 font-2 = MaterialIcons:antialias=false;pixelsize=10;1 +font-3 = PowerlineSymbols:size=10;1 +font-4 = FontAwesome:pixelsize=12 + modules-left = i3 modules-center = date -modules-right = filesystem xkeyboard volume temperature powermenu +modules-right = filesystem xkeyboard volume powermenu ;tray-position = ;tray-padding = 2 @@ -107,6 +90,8 @@ modules-right = filesystem xkeyboard volume temperature powermenu ;time-alt = %H:%M:%S [bar/bottom] +monitor = eDP-1 +monitor-fallback = HDMI-1 width = 100% height = 27 fixed-center = true @@ -121,7 +106,7 @@ line-color = #f00 border-size = 4 border-color = #00000000 -padding-left = 0 +padding-left = 2 padding-right = 2 module-margin-left = 1 @@ -130,11 +115,14 @@ module-margin-right = 2 font-0 = fixed:pixelsize=10;1 font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 font-2 = MaterialIcons:pixelsize=10;1 +font-3 = PowerlineSymbols:pixelsize=12 +font-4 = FontAwesome:pixelsize=12 ;modules-left = bspwm i3 ;modules-right = i3 modules-center = memory cpu -modules-left = battery +modules-right = temperature +modules-left = battery backlight-acpi tray-position = right tray-padding = 2 @@ -248,7 +236,7 @@ type = internal/xbacklight format =