master
Dmitry Razumov 2 years ago
parent 502ef24053
commit b5a80f2f17
Signed by: asmeron
GPG Key ID: 50BC1DB583B79706

@ -269,7 +269,7 @@ create_module(){
. /usr/lib/ublinux/default
. /etc/ublinux/config 2>/dev/null
. /etc/ublinux/system 2>/dev/null
echo " $@ " | egrep -q ' -comp | -noD ' && MKSQFS_OPTS=
echo " $@ " | grep -Eq ' -comp | -noD ' && MKSQFS_OPTS=
mksquashfs "$1" "$2" $MKSQFS_OPTS $3 $4 $5 $6 $7 $8 $9 -noappend >/dev/null || return 1
chmod 444 "$2"
}
@ -278,14 +278,14 @@ create_module(){
# $1 = value name, case sensitive, for example 'debug'
cmdline_parameter(){
. /etc/ublinux/config 2>/dev/null || . etc/ublinux/config 2>/dev/null
echo -n " $CMDLINE " | cat /proc/cmdline - 2>/dev/null | tr "[:cntrl:]" " " | egrep -m1 -o "(^|[[:space:]])$1([[:space:]]|\$)" | head -1 | tr -d " "
echo -n " $CMDLINE " | cat /proc/cmdline - 2>/dev/null | tr "[:cntrl:]" " " | grep -Em1 -o "(^|[[:space:]])$1([[:space:]]|\$)" | head -1 | tr -d " "
}
# look into cmdline and echo value of $1 option
# $1 = value name, case sensitive, for example 'changes'
cmdline_value(){
. /etc/ublinux/config 2>/dev/null || . etc/ublinux/config 2>/dev/null
echo -n " $CMDLINE " | cat /proc/cmdline - 2>/dev/null | tr "[:cntrl:]" " " | egrep -m1 -o "(^|[[:space:]])$1=[^[:space:]]+" | head -1 | cut -d "=" -f 2-
echo -n " $CMDLINE " | cat /proc/cmdline - 2>/dev/null | tr "[:cntrl:]" " " | grep -Em1 -o "(^|[[:space:]])$1=[^[:space:]]+" | head -1 | cut -d "=" -f 2-
}
# Find and run all scripts from the given module
@ -308,7 +308,7 @@ find_n_run_scripts(){
RUNSCRIPTS="$MOD$RCPATH|$MOD/usr/lib/ublinux/rc.local|$MOD/usr/lib/ublinux/rc.post"
echo $@ | grep -q start || RUNSCRIPTS="$MOD$RCPATH"
find "$MOD" | egrep "$RUNSCRIPTS" | cut -b "${#MOD}"- | cut -b 2- | xargs -n 1 -r readlink -f | sort -u | \
find "$MOD" | grep -E "$RUNSCRIPTS" | cut -b "${#MOD}"- | cut -b 2- | xargs -n 1 -r readlink -f | sort -u | \
while read SCRIPT; do
if [ "$SCRIPT" != "" -a -x "$SCRIPT" -a ! -d "$SCRIPT" ]; then
# call the script by real path, not from the module
@ -370,7 +370,7 @@ xss_heartbeat(){
. /usr/lib/ublinux/default
. /etc/ublinux/config 2>/dev/null
SSAVERBLOCKAPPS="$(echo "$SSAVERBLOCKAPPS"| tr ',; ' '|' )"
bash -c "while true ;do top -bn1 -u $(id -un) | awk '{ print \$7 FS \$NF }' | grep ^[1-9] | egrep -q \"$SSAVERBLOCKAPPS\" && xscreensaver-command -deactivate >/dev/null ; sleep 20s ; done " &
bash -c "while true ;do top -bn1 -u $(id -un) | awk '{ print \$7 FS \$NF }' | grep ^[1-9] | grep -Eq \"$SSAVERBLOCKAPPS\" && xscreensaver-command -deactivate >/dev/null ; sleep 20s ; done " &
}

@ -23,7 +23,7 @@ DE=$(detectDE)
[ "$XSSDEIGNORE" = "all" ] && exit 0
echo " $XSSDEIGNORE " | tr ',;' ' ' | grep -q " $DE " && exit 0
XSSEXIT="$(echo "$XSSEXIT" | tr ',; ' '|' )"
ps -U $(id -un) -o comm | egrep -q "$XSSEXIT" && exit 0
ps -U $(id -un) -o comm | grep -Eq "$XSSEXIT" && exit 0
xscreensaver -no-splash &
sleep 1s
@ -31,7 +31,7 @@ sleep 1s
while true ;do
XSSBLRUNED="$(echo "$XSSBLRUNED" | tr ',; ' '|' )"
XSSBLLOADED="$(echo "$XSSBLLOADED" | tr ',; ' '|' )"
ps -U $(id -un) -o comm | egrep -q "$XSSBLRUNED" && xscreensaver-command -deactivate >/dev/null 2>&1
top -bn1 -u $(id -un) | awk '{ print $7 FS $NF }' | grep ^[1-9] | egrep -q "$XSSBLLOADED" && xscreensaver-command -deactivate >/dev/null 2>&1
ps -U $(id -un) -o comm | grep -Eq "$XSSBLRUNED" && xscreensaver-command -deactivate >/dev/null 2>&1
top -bn1 -u $(id -un) | awk '{ print $7 FS $NF }' | grep ^[1-9] | grep -Eq "$XSSBLLOADED" && xscreensaver-command -deactivate >/dev/null 2>&1
sleep $XSSHBTM
done

@ -9,7 +9,7 @@ ENABLED=yes
sleep 5
if pidof -qx xfce4-screensaver; then
if ! lspci -k | egrep -i -A 3 'VGA|3D' | grep -q 'Kernel driver in use:'; then
if ! lspci -k | grep -Ei -A 3 'VGA|3D' | grep -q 'Kernel driver in use:'; then
BLOBPS=$(ps -u $(id -u) -o pid= | xargs -I{} cat /proc/{}/environ 2>/dev/null | tr '\0' '\n')
DISPLAY=$(grep -m1 '^DISPLAY=' <<< "${BLOBPS}")
# XAUTHORITY=$(grep -m1 '^XAUTHORITY=' <<< "${BLOBPS}")

@ -70,7 +70,7 @@ EOF
FILE_X11VNC_SERVICE="/usr/lib/systemd/system/x11vnc-ublinux-${X11VNC_NEW}.service"
OPTION_LOG="-o /var/log/x11vnc-ublinux-${X11VNC_NEW}.log"
OPTION_PORT="-autoport 5900"
if NUM_TTY=$(egrep --only-matching -- "-rawfb vt[0-9]{1,2}" <<< ${X11VNC[${X11VNC_NEW}]} | head -1 | sed "s/-rawfb vt//") && [[ -n ${NUM_TTY} ]]; then
if NUM_TTY=$(grep -E --only-matching -- "-rawfb vt[0-9]{1,2}" <<< ${X11VNC[${X11VNC_NEW}]} | head -1 | sed "s/-rawfb vt//") && [[ -n ${NUM_TTY} ]]; then
systemctl start getty@tty${NUM_TTY}.service
fi
if grep --quiet -- "-display" <<< ${X11VNC[${X11VNC_NEW}]}; then

@ -13,7 +13,7 @@ debug_mode "$0" "$@"
[ -f /etc/sysctl.d/ublinux.conf ] && sysctl -p /etc/sysctl.d/ublinux.conf
# If Linux installed on n[t]fs we have to omit killing rootfilesystem mounter when system halt
ps -A | egrep 'ntfsmount|rpciod|nfsiod|httpfs|curlftpfs' | awk '{ print $1 }' >> /var/run/sendsigs.omit
ps -A | grep -E 'ntfsmount|rpciod|nfsiod|httpfs|curlftpfs' | awk '{ print $1 }' >> /var/run/sendsigs.omit
# Creating /etc/mtab
#rm -f /etc/mtab

@ -141,7 +141,7 @@ get_max_resolution() {
if [[ -n "${MONITOR[@]}" ]]; then
for VIDEO_PORT in "${!MONITOR[@]}"; do
while read VIDEO_PORT_PARAM; do
if egrep -iq "^[0-9]*x[0-9]*$|^[0-9]*x[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
if grep -Eiq "^[0-9]*x[0-9]*$|^[0-9]*x[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
RESOLUTION="$(sed 's/\([0-9]*\*[0-9]*\) .*/\1/' <<< ${VIDEO_PORT_PARAM//x/*})"
# fix 1440x900 > 1280x1024
[[ "${RESOLUTION}" == "1440*900" ]] && pixel_line_mode=$(bc <<< "${RESOLUTION}+14721") || pixel_line_mode=$(bc <<< ${RESOLUTION})

@ -28,7 +28,7 @@ SOURCE=${SYSCONF}/keyboard; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
while read KERNEL_MODULE; do
[[ ${KERNEL_MODULE} != "nouveau" ]] && modprobe ${KERNEL_MODULE} 2>/dev/null && break
done < <(lspci -ks ${LSPCI_DEVICE%% *} | grep 'Kernel modules:' | cut -d: -f2 | tr ',' '\n' | tac)
done < <(lspci | egrep -i 'vga|3d')
done < <(lspci | grep -Ei 'vga|3d')
if lsmod | grep nvidia &>/dev/null; then
#[[ -f /usr/bin/nvidia-xconfig ]] && nvidia-xconfig -s --no-logo --no-composite --no-dynamic-twinview --force-generate --output-xconfig=/etc/X11/xorg.conf
[[ -e /etc/X11/xorg.conf.d/20-nvidia-ubconfig.conf ]] || ln -sf /usr/lib/ublinux/xorg.conf.d/20-nvidia-ubconfig.conf /etc/X11/xorg.conf.d/
@ -53,7 +53,7 @@ SOURCE=${SYSCONF}/keyboard; [[ -f ${SOURCE} ]] && . ${SOURCE} 2>/dev/null
if [[ -n ${XORG_EXT} ]]; then
while read I_EXT; do
XORG_FILE_EXT="/etc/X11/xorg.conf.d/110-${I_EXT}-ubconfig.conf"
if egrep -iq "^nodpms$" <<< "${I_EXT}"; then
if grep -Eiq "^nodpms$" <<< "${I_EXT}"; then
cat > ${XORG_FILE_EXT} <<EOF
Section "Extensions"
Option "DPMS" "Disable"
@ -66,7 +66,7 @@ Section "ServerFlags"
Option "BlankTime" "0"
EndSection
EOF
elif egrep -iq "^dpms$" <<< "${I_EXT}"; then
elif grep -Eiq "^dpms$" <<< "${I_EXT}"; then
cat > ${XORG_FILE_EXT} <<EOF
Section "Extensions"
Option "DPMS" "Enable"
@ -89,46 +89,46 @@ EOF
PREFERRED_MODE=
XORG_STR_MONITOR=
while read VIDEO_PORT_PARAM; do
if egrep -iq "^[0-9]*x[0-9]*$|^[0-9]*x[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
if grep -Eiq "^[0-9]*x[0-9]*$|^[0-9]*x[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
if [[ -n ${SOFT_MODELINE_R} ]]; then
XORG_STR_MONITOR+="$(cvt -r $(sed 's/\([0-9]* [0-9]*\) .*/\1/' <<< ${VIDEO_PORT_PARAM//x/ }))\n"
SOFT_MODELINE_R=
elif [[ ${SOFT_MODELINE} == "cvt" ]]; then
XORG_STR_MONITOR+="$(cvt ${VIDEO_PORT_PARAM//x/ })\n"
else
if egrep -iq "^[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
if grep -Eiq "^[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+="$(gtf ${VIDEO_PORT_PARAM//x/ } 60 | grep -v '^\s*$')\n"
else
XORG_STR_MONITOR+="$(gtf ${VIDEO_PORT_PARAM//x/ } | grep -v '^\s*$')\n"
fi
fi
elif egrep -iq "^cvt$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^cvt$" <<< "${VIDEO_PORT_PARAM}"; then
SOFT_MODELINE="cvt"
elif egrep -iq "^gtf$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^gtf$" <<< "${VIDEO_PORT_PARAM}"; then
SOFT_MODELINE="gtf"
elif egrep -iq "^reduced|r$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^reduced|r$" <<< "${VIDEO_PORT_PARAM}"; then
SOFT_MODELINE_R="reduced"
elif egrep -iq "^nodpms$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^nodpms$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "DPMS" "false"\n'
elif egrep -iq "^dpms$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^dpms$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "DPMS" "true"\n'
elif egrep -iq "^enable$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^enable$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "Enable" "true"\n'
elif egrep -iq "^disable$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^disable$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "Enable" "false"\n'
elif egrep -iq "^ignore$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^ignore$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "Ignore" "true"\n'
elif egrep -iq "^primary$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^primary$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=' Option "Primary" "true"\n'
elif egrep -iq "^lo:[A-z0-9]*$|^LeftOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^lo:[A-z0-9]*$|^LeftOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"LeftOf\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif egrep -iq "^ro:[A-z0-9]*$|^RightOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^ro:[A-z0-9]*$|^RightOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"RightOf\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif egrep -iq "^ab:[A-z0-9]*$|^Above:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^ab:[A-z0-9]*$|^Above:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"Above\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif egrep -iq "^be:[A-z0-9]*$|^Below:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^be:[A-z0-9]*$|^Below:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"Below\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
elif egrep -iq "^rotate:[A-z]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^rotate:[A-z]*$" <<< "${VIDEO_PORT_PARAM}"; then
XORG_STR_MONITOR+=" Option \"Rotate\" \"$(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})\"\n"
fi
[[ -z ${PREFERRED_MODE} ]] && PREFERRED_MODE=$(grep Modeline <<< "${XORG_STR_MONITOR}" | cut -d'"' -f2)

@ -17,7 +17,7 @@ debug_mode "$0" "$@"
[[ -z ${NETDEV} ]] && NETDEV=$(ls /sys/class/net/e*/address | awk -F/ '{print $5}' | head -1)
#[ -z "$NETDEV" ] || sed -i s/DEVICE=.*/DEVICE=$NETDEV/ /etc/ublinux/network-scripts/ifcfg-eth0
# if egrep -q " nfs |httpfs|ftpfs|sshfs| cifs " /proc/mounts ;then
# if grep -Eq " nfs |httpfs|ftpfs|sshfs| cifs " /proc/mounts ;then
# sed -i s/ONBOOT=.*/ONBOOT=no/ /etc/ublinux/network-scripts/ifcfg-eth0
# sed -i s/NM_CONTROLLED=.*/NM_CONTROLLED=no/ /etc/ublinux/network-scripts/ifcfg-eth0
# fi

@ -99,7 +99,7 @@ fi
if [ "$THEMEPLASMACOLORS" != "" -a -f "/usr/share/color-schemes/$THEMEPLASMACOLORS.colors" -a -f /etc/xdg/kdeglobals ] ;then
cp -pf /usr/share/ublinux/plasma/kdeglobals /etc/xdg/kdeglobals
sed -i s/^ColorScheme=.*/"ColorScheme=$THEMEPLASMACOLORS"/ /etc/xdg/kdeglobals
egrep -v "^\[General\]|^Name=|^\[KDE\]|^colorScheme=|^contrast=|^shadeSortColumn=" "/usr/share/color-schemes/$THEMEPLASMACOLORS.colors" >> /etc/xdg/kdeglobals
grep -Ev "^\[General\]|^Name=|^\[KDE\]|^colorScheme=|^contrast=|^shadeSortColumn=" "/usr/share/color-schemes/$THEMEPLASMACOLORS.colors" >> /etc/xdg/kdeglobals
fi
if [ "$THEMEPLASMA" != "" -a -d "/usr/share/plasma/look-and-feel/$THEMEPLASMA" -a -f /etc/xdg/kdeglobals ] ;then
sed -i s/^LookAndFeelPackage=.*/"LookAndFeelPackage=$THEMEPLASMA"/ /etc/xdg/kdeglobals

@ -14,7 +14,7 @@ SOURCE=${SYSCONF}/config; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
echo -n > /etc/modprobe.d/blacklist-ublinux-dkms.conf
LC_ALL=C lspci -k | grep "Kernel modules: " | grep ", " | sed s/.*"Kernel modules: "// | sed s/", "/"\n"/g > /tmp/kernel_mods_lspci
find /var/lib/dkms-binary -type f | egrep -v "nvidia|virtualbox|vbox" | egrep .ko$"|".ko.xz | gawk -F/ '{print $NF}' | sed s/[.]ko.*// | sort -u | grep -f /tmp/kernel_mods_lspci | while read a ;do
find /var/lib/dkms-binary -type f | grep -Ev "nvidia|virtualbox|vbox" | egrep .ko$"|".ko.xz | gawk -F/ '{print $NF}' | sed s/[.]ko.*// | sort -u | grep -f /tmp/kernel_mods_lspci | while read a ;do
lspci -nn | grep -q -f /usr/share/ublinux/hwdata/dkms/$a 2>/dev/null && continue
echo "$WHITELISTMODULES" | grep -q "$a" && continue
modprobe -r "$a" 2>/dev/null

@ -74,7 +74,7 @@ grep -q "tmpfs /media tmpfs" etc/fstab || echo "tmpfs /media tmpfs size=1M 0 0 #
if [ "$PARTITIONSAUTOMOUNT" = "yes" ] ;then
sed -i /PARTITIONSAUTOMOUNT/d etc/fstab
blkid | egrep -v "loop|/dev/ram" | grep /dev/ | awk -F: '{ print $1 }' | while read a ; do
blkid | grep -Ev "loop|/dev/ram" | grep /dev/ | awk -F: '{ print $1 }' | while read a ; do
grep -q "^$a " etc/fstab && continue
if grep -q "^$a " /proc/mounts ;then
grep -m1 "^$a " /proc/mounts | grep /memory | sed s/$/" #PARTITIONSAUTOMOUNT=yes"/ >> etc/fstab

@ -228,7 +228,7 @@ if [ -f $XFILE -a "$VGABUSID" ] ;then
fi
#preloading kernel module to help xorg (all nvidia* modules are using one name 'nvidia')
if echo "$XDRIVER" | egrep -q 'nvidia|nouveau' ;then
if echo "$XDRIVER" | grep -Eq 'nvidia|nouveau' ;then
sed -i /^nvidia/d etc/modprobe.preload
sed -i /^nouveau/d etc/modprobe.preload
echo "$XDRIVER" >> etc/modprobe.preload

@ -22,46 +22,46 @@ SOURCE=${SYSCONF}/desktop; [ -f ${SOURCE} ] && . ${SOURCE} 2>/dev/null
SOFT_MODELINE_R=
while read VIDEO_PORT_PARAM; do
MODELINE=
if egrep -iq "^[0-9]*x[0-9]*$|^[0-9]*x[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
if grep -Eiq "^[0-9]*x[0-9]*$|^[0-9]*x[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
if [[ -n ${SOFT_MODELINE_R} ]]; then
MODELINE=$(cvt -r $(sed 's/\([0-9]* [0-9]*\) .*/\1/' <<< ${VIDEO_PORT_PARAM//x/ }) | sed '/^\s*$/d ; /^\s*#/d ; s/\s*Modeline //')
SOFT_MODELINE_R=
elif [[ ${SOFT_MODELINE} == "cvt" ]]; then
MODELINE=$(cvt ${VIDEO_PORT_PARAM//x/ } | sed '/^\s*$/d ; /^\s*#/d ; s/\s*Modeline //')
else
if egrep -iq "^[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
if grep -Eiq "^[0-9]*x[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
MODELINE=$(gtf ${VIDEO_PORT_PARAM//x/ } 60 | sed '/^\s*$/d ; /^\s*#/d ; s/\s*Modeline //')
else
MODELINE=$(gtf ${VIDEO_PORT_PARAM//x/ } | sed '/^\s*$/d ; /^\s*#/d ; s/\s*Modeline //')
fi
fi
elif egrep -iq "^cvt$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^cvt$" <<< "${VIDEO_PORT_PARAM}"; then
SOFT_MODELINE="cvt"
elif egrep -iq "^gtf$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^gtf$" <<< "${VIDEO_PORT_PARAM}"; then
SOFT_MODELINE="gtf"
elif egrep -iq "^reduced|r$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^reduced|r$" <<< "${VIDEO_PORT_PARAM}"; then
SOFT_MODELINE_R="reduced"
elif egrep -iq "^auto$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^auto$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --auto
elif egrep -iq "^preferred$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^preferred$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --preferred
elif egrep -iq "^off$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^off$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --off
elif egrep -iq "^primary$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^primary$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --primary
elif egrep -iq "^mode:[0-9x_]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^mode:[0-9x_]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --mode $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM})
elif egrep -iq "^mode:[0-9x_]*:[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^mode:[0-9x_]*:[0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --mode $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM}) --rate $(cut -d: -f3 <<< ${VIDEO_PORT_PARAM})
elif egrep -iq "^lo:[A-z0-9]*$|^LeftOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^lo:[A-z0-9]*$|^LeftOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --left-of $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})
elif egrep -iq "^ro:[A-z0-9]*$|^RightOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^ro:[A-z0-9]*$|^RightOf:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --right-of $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})
elif egrep -iq "^ab:[A-z0-9]*$|^Above:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^ab:[A-z0-9]*$|^Above:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --above $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})
elif egrep -iq "^be:[A-z0-9]*$|^Below:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^be:[A-z0-9]*$|^Below:[A-z0-9]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --below $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})
elif egrep -iq "^Rotate:[A-z]*$" <<< "${VIDEO_PORT_PARAM}"; then
elif grep -Eiq "^Rotate:[A-z]*$" <<< "${VIDEO_PORT_PARAM}"; then
xrandr --output ${VIDEO_PORT^^} --rotate $(cut -d: -f2 <<< ${VIDEO_PORT_PARAM^^})
fi
if [[ -n ${MODELINE} ]]; then

Loading…
Cancel
Save