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
15259420
Commit
15259420
authored
Sep 25, 2019
by
Jay Ta'ala
Browse files
Added scripts folder for several utility scripts I've authored.
parent
91d536fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
scripts/addresolution
0 → 100755
View file @
15259420
#!/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 @
15259420
#!/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