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
9a741e41
Commit
9a741e41
authored
Sep 25, 2019
by
Jay Ta'ala
Browse files
Merge branch 'development'
parents
4caf5684
15259420
Changes
2
Show whitespace changes
Inline
Side-by-side
scripts/addresolution
0 → 100755
View file @
9a741e41
#!/bin/bash
showExample
()
{
echo
-e
"
\n
e.g.
\"
"
$(
basename
--
"
$0
"
)
" 1920 1080 60
\"\n
"
}
createRes
()
{
cvt
"
$WIDTH
"
"
$HEIGHT
"
"
$REFRESH
"
|
grep
Modeline |
sed
"s/Modeline//"
| xargs xrandr
--newmode
}
addRes
()
{
xrandr
--addmode
eDP1
"
$WIDTH
"
x
"
$HEIGHT
"
_
"
$REFRESH
"
.00
}
# check arguments
if
[
-z
"
$1
"
]
;
then
echo
"Please provide a screen width as the first argument"
showExample
exit
128
fi
if
[
-z
"
$2
"
]
;
then
echo
"Please provide a screen height as the second argument"
showExample
exit
128
fi
if
[
-z
"
$3
"
]
;
then
echo
"Please provide a refresh rate as the third argument"
showExample
exit
128
fi
#init
WIDTH
=
$1
HEIGHT
=
$2
REFRESH
=
$3
createRes
||
{
echo
-e
"
\n
ERROR creating resolution with
\"
cvt
\"\n
"
exit
1
}
addRes
||
{
echo
-e
"
\n
ERROR adding resolution with
\"
xrandr
\"\n
"
exit
1
}
exit
0
scripts/switchworkspace
0 → 100755
View file @
9a741e41
#!/bin/bash
# check have a delta argument
if
[
-z
"
$1
"
]
;
then
echo
"Please provide a number of seconds to switch desktops as first argument"
exit
128
fi
if
[
"
$1
"
-lt
3
]
;
then
echo
"Please provide a number of seconds >= 3"
exit
128
fi
# init
numDesktops
=
2
desktop
=
$(
xdotool get_desktop
)
;
echo
"Press Crtl+C or kill this script to stop the switching"
echo
"Fist switch will occur in
$1
seconds..."
while
true
do
sleep
$1
# change desktop
desktop
=
$((
desktop
+
1
))
desktop
=
$((
desktop
%
numDesktops
))
xdotool set_desktop
$desktop
done
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