Skip to content

Commit

Permalink
fix: grep check if HDMI disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
teddywaweru committed Aug 1, 2024
1 parent 6528d2a commit f50f523
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .scripts/config_monitor.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/sh

set -e

extern=HDMI-1
primary=eDP-1
if xrandr | grep "$extern"; then
if ! xrandr | grep "$extern disconnected"; then
echo "HDMI connected"
line=$( xrandr | grep "$extern" -n | cut -d : -f 1 )
extern_resolution_line=$(($line+1))
extern_resolution=$(xrandr| sed -n "$extern_resolution_line p" | awk -F " " '{print $1}' )
Expand Down

0 comments on commit f50f523

Please sign in to comment.