# run userinstall to determine device properties
if ! iconf -i userinstall; then
/usr/share/instantutils/userinstall.sh
+ iconf -i userinstall 1
fi
# architecture detection
echo "installing ranger plugins"
mkdir -p ~/.config/ranger/plugins
cp -r /usr/share/rangerplugins/* ~/.config/ranger/plugins/
-
+ iconf -i rangerplugins 1
fi
# find out if it's a live session
echo "live session detected"
fi
-# fix small graphical glitch on status bar startup
-NMON=$(iconf names | wc -l)
-for i in $(eval "echo {1..$NMON}"); do
- echo "found monitor $i"
- xdotool key super+comma
- if iconf -i nobar; then
- xdotool key super+b
+if iconf -i islaptop; then
+ export ISLAPTOP="true"
+ echo "laptop detected"
+else
+ echo "not a laptop"
+fi
+
+islive() {
+ if [ -n "$ISLIVE" ]; then
+ return 0
+ else
+ return 1
fi
-done &
+}
+
+# optionally disable status bar
+if iconf -i nobar; then
+ NMON=$(iconf names | wc -l)
+ for i in $(eval "echo {1..$NMON}"); do
+ echo "found monitor $i"
+ xdotool key super+comma
+ xdotool key super+b
+ done &
+fi
if [ -n "$ISRASPI" ]; then
# enable double drawing for moving floating windows
fi
fi
-if iconf -i islaptop; then
- export ISLAPTOP="true"
- echo "laptop detected"
-else
- echo "not a laptop"
-fi
-
if ! iconf -i notheming; then
instantthemes a
xrdb ~/.Xresources
}
# set up oh-my-zsh config if not existing already
-instantshell &
-if ! [ iconf -i userinstall ]; then
- bash /usr/share/instantutils/userinstall.sh
-fi
+iconf -i nozsh || instantshell &
# fix resolution on virtual machine
if ! iconf -i novmfix && cat /proc/cpuinfo | grep -q hypervisor; then
fi
fi
-if [ -z "$ISLIVE" ]; then
+if ! islive; then
echo "not a live session"
if [ -e /opt/instantos/installtrigger ]; then
zenity --info --text "finishing installation in background" &
fi &
# prompt to fix configuration if installed from the AUR
-if ! iconf -i norootinstall && [ -z "$ISLIVE" ]; then
+if ! iconf -i norootinstall && ! islive; then
if ! command -v imenu || ! command -v instantmenu; then
notify-send "please install instantmenu and imenu"
else
#!/bin/bash
# installs dependencies for instantOS
+# this is deprecated
export LINK="https://raw.githubusercontent.com/instantos/instantos/master"
#!/bin/bash
+
# central installer script for instantOS
+# this is deprecated
export PAPERSILENT="True"
echo "root: installing tools"
/usr/share/instantutils/rootinstall.sh
-
instantthemes f
#!/bin/bash
+# wrapper for calamares
sudo /usr/share/instantutils/install.sh
#!/bin/bash
+
+# wrapper script for other installation scripts
+
USAGE="usage: instantutils install
instantutils root
instantutils user
#!/bin/bash
+#####################################################
+# This script detects and saves screen resolutions ##
+# It resizes the wallpaper if things change ##
+#####################################################
+
command -v xrandr &>/dev/null ||
(echo "please install xrandr" && exit 1)
+
cd
mkdir -p ~/instantos/monitor &>/dev/null
POSITIONS="$(xrandr | grep '[^s]connected' | grep -o '[0-9]*x[0-9]*+[0-9]*' | grep -o '[0-9]*$')"
AMOUNT=$(wc -l <<<"$POSITIONS")
-# get monitor with highest resolution
RESOLUTIONS=$(xrandr | grep '[^s]connected' | grep -Eo '[0-9]{1,}x[0-9]{1,}\+[0-9]{1,}\+[0-9]{1,}' |
grep -o '[0-9]*x[0-9]*' | sed 's/ /\n/g')
-if OLDRES="$(iconf resolutions)"; then
+# check if resolutions are already configured
+# exit if no changes
+if iconf resolutions; then
+ OLDRES="$(iconf resolutions)"
# see if resolution has changed
if ! [ "$RESOLUTIONS" = "$OLDRES" ]; then
iconf resolutions "$RESOLUTIONS"
CHANGERES="True"
echo "Resolution change detected"
+ else
+ echo "no resolution change"
+ [ "$1" = "-f" ] || exit
fi
+else
+ iconf resolutions "$RESOLUTIONS"
fi
if [ $(echo "$RESOLUTIONS" | sort -u | wc -l) = "1" ]; then
echo "resolutions identical"
- iconf -i max $(head -1 <<<"$RESOLUTIONS")
+ iconf max $(head -1 <<<"$RESOLUTIONS")
else
+ # get monitor with highest resolution
let PIXELS1="$(head -1 <<<$RESOLUTIONS | grep -o '^[0-9]*') * $(head -1 <<<$RESOLUTIONS | grep -o '[0-9]*$')"
let PIXELS2="$(tail -1 <<<$RESOLUTIONS | grep -o '^[0-9]*') * $(tail -1 <<<$RESOLUTIONS | grep -o '[0-9]*$')"
if [ "$PIXELS1" -gt "$PIXELS2" ]; then
- iconf -i max "$(head -1 <<<$RESOLUTIONS)"
+ iconf max "$(head -1 <<<$RESOLUTIONS)"
else
- iconf -i max "$(tail -1 <<<$RESOLUTIONS)"
+ iconf max "$(tail -1 <<<$RESOLUTIONS)"
fi
fi
# rebuild wallpaper after resolution change
changetrigger() {
- if [ -z "$CHANGERES" ]; then
- echo "no resolution change"
- else
- if [ -e ~/instantos/wallpapers ] && command -v instantwallpaper; then
- rm -rf ~/instantos/wallpapers
- instantwallpaper w
- fi
+ if iconf -i setwallpaper; then
+ rm -rf ~/instantos/wallpapers
+ instantwallpaper resolution
fi
}
exit
else
if [ "$AMOUNT" -gt 2 ]; then
- echo "only 2 monitors are supported"
+ echo "only 2 monitors are testes"
exit
fi
echo "$AMOUNT monitors found"
MONITOR1=$(head -1 <<<"$POSITIONS")
MONITOR2=$(tail -1 <<<"$POSITIONS")
+# legacy leftover
+# in case some program ever needs it
if [ "$MONITOR1" -gt "$MONITOR2" ]; then
echo "Monitor 1 is ${MONITOR1}px on the right"
- iconf -i right "$MONITOR2"
+ iconf right "$MONITOR2"
else
echo "Monitor 2 is ${MONITOR2}px on the right"
- iconf -i right "$MONITOR2"
+ iconf right "$MONITOR2"
fi
+
changetrigger
#!/bin/bash
+###############################################################################
+## add repo containing instantOS programs and required prebuilt aur programs ##
+###############################################################################
+
echo "adding instantOS repo"
if ! uname -m | grep -q '^i'; then
#!/bin/bash
-######################################################
-## installs all system wide programs for instantOS ##
-######################################################
+####################################################
+## installs all system wide tweaks for instantOS ##
+####################################################
if ! [ $(whoami) = "root" ]; then
echo "please run this as root"