diff --git a/.config/i3/config b/.config/i3/config index 74c666b..bf05547 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -12,6 +12,9 @@ mouse_warping output # exec xfsettingsd # exec xiccd +# Set screen layout +exec ~/bin/scripts/screen-layout + # Most needed keybindigs # reload the configuration file bindsym $mod+Shift+c reload diff --git a/Desktop.org b/Desktop.org index 8d1f9a8..bb08a05 100644 --- a/Desktop.org +++ b/Desktop.org @@ -207,7 +207,14 @@ Xft/Antialias 1 Xft/Hinting 0 Xft/HintStyle "hintnone" #+end_src - +** Screen layout +Set screen layout depending on hostname +#+begin_src sh :tangle ~/bin/scripts/screen-layout +hostname=$(hostname) +if [ "$hostname" = "indigo" ]; then + xrandr --output DisplayPort-0 --off --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-D-0 --mode 1366x768 --pos 1920x312 --rotate normal +fi +#+end_src * i3wm :PROPERTIES: :header-args+: :tangle ./.config/i3/config @@ -243,6 +250,9 @@ mouse_warping output # exec xfsettingsd # exec xiccd +# Set screen layout +exec ~/bin/scripts/screen-layout + # Most needed keybindigs # reload the configuration file bindsym $mod+Shift+c reload @@ -986,7 +996,7 @@ afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_$ status=$(echo ${afk_event} | jq -r '.[0].data.status') afk_time=$(echo "${afk_event}" | jq -r '.[0].duration' | xargs -I ! date -u -d @! +"%H:%M") -uptime=$(datediff "$(uptime | awk '{ print substr($3, 0, length($3) - 1) }' | xargs -I ! date -d ! -Iseconds)" "$(date -Iseconds)" -f '%H:%M' | xargs -I ! date -d ! +"%H:%M") +uptime=$(uptime | awk '{ print substr($3, 0, length($3) - 1) }' | xargs -I ! date -d ! +"%H:%M") res="${afk_time} / ${uptime}" if [[ $status == 'afk' ]]; then echo "%{u<>}%{+u} [AFK] $res %{u-}" diff --git a/bin/polybar/aw_afk.sh b/bin/polybar/aw_afk.sh index 2611e75..db4acb9 100755 --- a/bin/polybar/aw_afk.sh +++ b/bin/polybar/aw_afk.sh @@ -4,7 +4,7 @@ afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_$ status=$(echo ${afk_event} | jq -r '.[0].data.status') afk_time=$(echo "${afk_event}" | jq -r '.[0].duration' | xargs -I ! date -u -d @! +"%H:%M") -uptime=$(datediff "$(uptime | awk '{ print substr($3, 0, length($3) - 1) }' | xargs -I ! date -d ! -Iseconds)" "$(date -Iseconds)" -f '%H:%M' | xargs -I ! date -d ! +"%H:%M") +uptime=$(uptime | awk '{ print substr($3, 0, length($3) - 1) }' | xargs -I ! date -d ! +"%H:%M") res="${afk_time} / ${uptime}" if [[ $status == 'afk' ]]; then echo "%{u#f07178}%{+u} [AFK] $res %{u-}" diff --git a/bin/scripts/screen-layout b/bin/scripts/screen-layout new file mode 100755 index 0000000..9ceb142 --- /dev/null +++ b/bin/scripts/screen-layout @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# [[file:../../Desktop.org::*Screen layout][Screen layout:1]] +hostname=$(hostname) +if [ "$hostname" = "indigo" ]; then + xrandr --output DisplayPort-0 --off --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-D-0 --mode 1366x768 --pos 1920x312 --rotate normal +fi +# Screen layout:1 ends here