Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jay Ta'ala
jt-config-repo
Commits
64ea7539
Commit
64ea7539
authored
Oct 13, 2019
by
Jay Ta'ala
Browse files
Merge branch 'development'
parents
e4bc0db2
1fb8f8a5
Changes
1
Show whitespace changes
Inline
Side-by-side
scripts/addresolution
View file @
64ea7539
...
...
@@ -13,7 +13,26 @@ addRes() {
}
switchRes
()
{
xrandr
--output
"
$DEVICE
"
--mode
"
$WIDTH
"
x
"
$HEIGHT
"
_
"
$REFRESH
"
.00
while
true
;
do
read
-p
"
$1
"
yn
case
$yn
in
[
Yy]
*
)
xrandr
--output
"
$DEVICE
"
--mode
"
$WIDTH
"
x
"
$HEIGHT
"
_
"
$REFRESH
"
.00
||
{
echo
-e
"
\n
ERROR switching resolution with
\"
xrandr
\"\n
"
return
1
}
;
break
;;
[
Nn]
*
)
break
;;
*
)
echo
"Please type
\"
y
\"
or
\"
n
\"
"
;;
esac
done
}
switchResAnyway
()
{
switchRes
"Adding resolution failed. Try to switch to this resolution anyway? (y/n) "
}
switchResNow
()
{
switchRes
"Switch to this resolution now? (y/n) "
}
# check arguments
...
...
@@ -49,25 +68,15 @@ REFRESH=$4
createRes
||
{
echo
-e
"
\n
ERROR creating resolution with
\"
cvt
\"\n
"
switchResAnyway
exit
1
}
addRes
||
{
echo
-e
"
\n
ERROR adding resolution with
\"
xrandr
\"\n
"
switchResAnyway
exit
1
}
echo
-e
"
\n
"
while
true
;
do
read
-p
"Do you want to switch to this resolution now? (y/n) "
yn
case
$yn
in
[
Yy]
*
)
switchRes
||
{
echo
-e
"
\n
ERROR switching resolution with
\"
xrandr
\"\n
"
return
1
}
;
break
;;
[
Nn]
*
)
break
;;
*
)
echo
"Please type
\"
y
\"
or
\"
n
\"
"
;;
esac
done
switchResNow
exit
0
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment