All scripts in one repository
This commit is contained in:
parent
a0a86492ee
commit
9f9304d6aa
61 changed files with 6668 additions and 681 deletions
17
android-studio-hidpi/LICENSE
Normal file
17
android-studio-hidpi/LICENSE
Normal file
|
@ -0,0 +1,17 @@
|
|||
COPYRIGHT (c) 2015 mmk2410
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
75
android-studio-hidpi/android-studio-hidpi.sh
Executable file
75
android-studio-hidpi/android-studio-hidpi.sh
Executable file
|
@ -0,0 +1,75 @@
|
|||
#!/bin/bash
|
||||
# This is a small script for enabling and disabling HiDPI support in Android Stuido on every Linux distribution where Android Stuido is installed in /opt/android-studio. If the installation is somewhere else you have to change the variable STUDIO_PATH.
|
||||
# Marcel Michael Kapfer
|
||||
# 27 May 2015
|
||||
# GNU GPL v3.0 -> Feel free to re-distribute or fork it
|
||||
|
||||
## Android Stuido path
|
||||
STUDIO_PATH="/opt/android-studio/bin"
|
||||
|
||||
## Enable HiDPI
|
||||
function enable_hidpi {
|
||||
sudo echo "-Dhidpi=true" >> $STUDIO_PATH/stuido.vmoptions
|
||||
sudo echo "-Dhidpi=true" >> $STUDIO_PATH/studio64.vmoptions
|
||||
echo "HiDPI enabled"
|
||||
exit
|
||||
}
|
||||
|
||||
## Disable HiDPI
|
||||
function disable_hidpi {
|
||||
idea=$(sed '/-Dhidpi=true/d' $STUDIO_PATH/studio.vmoptions)
|
||||
idea64=$(sed '/-Dhidpi=true/d' $STUDIO_PATH/studio64.vmoptions)
|
||||
sudo echo "$idea" > $STUDIO_PATH/studio.vmoptions
|
||||
sudo echo "$idea64" > $STUDIO_PATH/studio64.vmoptions
|
||||
echo "HiDPI disabled"
|
||||
exit
|
||||
}
|
||||
|
||||
## Usage
|
||||
usage=$(
|
||||
cat <<EOF
|
||||
Usage:
|
||||
|
||||
Enable HiDPI support:
|
||||
--enable
|
||||
or
|
||||
-e
|
||||
|
||||
Disabling HiDPI support:
|
||||
--disable
|
||||
or
|
||||
-d
|
||||
|
||||
Help (prints this)
|
||||
--help
|
||||
or
|
||||
-h
|
||||
|
||||
EOF
|
||||
)
|
||||
|
||||
## Options
|
||||
### Runns if no argument is given
|
||||
if [[ -z "$1" ]]
|
||||
then
|
||||
echo
|
||||
echo "$usage"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
### Runs if an argument is given
|
||||
until [[ $1 == -- ]]; do
|
||||
case $1 in
|
||||
-e | --enable)
|
||||
enable_hidpi
|
||||
;;
|
||||
-d | --disable)
|
||||
disable_hidpi
|
||||
;;
|
||||
-h | --help)
|
||||
echo "$usage"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue