OSDN Git Service

comment programs better
authorpaperbenni <paperbenni@gmail.com>
Wed, 29 Jul 2020 09:18:49 +0000 (11:18 +0200)
committerpaperbenni <paperbenni@gmail.com>
Wed, 29 Jul 2020 09:18:49 +0000 (11:18 +0200)
programs/instantslop
programs/instantstartmenu
programs/instantsudo
programs/instantupdate
programs/ipicom
programs/killwm
programs/sll
programs/xnest
setup/defaultapps

index b8a4fa6..7fd8de9 100755 (executable)
@@ -1,4 +1,6 @@
 #!/usr/bin/dash
+# slop wrapper that puts out a format readable by instantwm
+# looks different if you have compositing
 
 if pgrep picom; then
     slop --highlight -f x%xx%yx%wx%hx -b 3 -c 0.3203125,0.875,0.40234375,0.1
index 0d36eb2..64d03ef 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+# basic menu activated from the top left
+
 CHOICE="$(echo ':b Applications
 :b Settings
 :b Terminal
index 6e40887..d77ca31 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/dash
 
 # replacement for gksudo using instantmenu
+
 SUDO_ASKPASS="$(which instantpassword)"
 export SUDO_ASKPASS
 export PASSPROMPT="sudo password for $USER"
index 93f6658..fd82ddb 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+# update wrapper that applies changes to sudo hooks
+
 if ! checkinternet; then
     echo "internet is required to upgrade instantOS"
     exit 1
index 094c560..20f52fe 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 # picom launcher that adapts to the environment
+
 if [ -e /opt/instantos/potato ] || iconf -i potato; then
     echo "no compositing for you, your pc is a potato"
     exit
index 326c95d..d6bb911 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+# restart instantWM from cli
+
 if ! [ -e /tmp/wmpid ]; then
     if pgrep instantwm; then
         pkill instantwm
index 99f77ee..9161f32 100755 (executable)
@@ -1,9 +1,10 @@
 #!/bin/bash
 
 # very subtle easter egg, turn up the volume and wear headphones to experience it
+
 if ! [ -e ~/instantos/thomas.mp3 ]; then
     pushd .
-    cd ~/instantos/
+    cd ~/instantos/ || exit 1
     wget -q thomasthetankengine.surge.sh/thomas.mp3
     popd
 fi
index 79908dd..bdb9c21 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+# quickyl nest an x server
 
 Xephyr -br -ac -noreset -screen 800x600 :1 &
 sleep 3
index 7d24f09..a99fd9d 100644 (file)
@@ -1,12 +1,13 @@
 #!/bin/bash
 
-# symlink default applications
+# this program reads a list of default applications from iconf
+# and then symlinks them to the home config dir to be executed from there
 
 [ -e ~/.config/instantos/default ] || mkdir -p ~/.config/instantos/default
 cd ~/.config/instantos/default || exit
 
 XDGBROWSER="$(xdg-settings get default-web-browser)"
-BROWSERLOCATION="$(grep -m 1 Exec </usr/share/applications/$XDGBROWSER | sed 's/Exec=*//g' | sed 's/[ ][^ ]*//')"
+BROWSERLOCATION="$(grep -m 1 Exec </usr/share/applications/"$XDGBROWSER" | sed 's/Exec=*//g' | sed 's/[ ][^ ]*//')"
 
 # symlink browser
 if [ -e "$BROWSERLOCATION" ]; then
@@ -15,14 +16,16 @@ if [ -e "$BROWSERLOCATION" ]; then
     ln -s "$BROWSERLOCATION" ./browser
 fi
 
+# apply the default setting for an application type, fallback to $2
 setprogram() {
     [ -e "$1" ] && rm "$1"
-    TEMPSETTING=$(iconf $1:$2)
+    TEMPSETTING=$(iconf "$1:$2")
     echo "setting $1 to $TEMPSETTING"
-    ln -s "$(which $TEMPSETTING)" ./$1
+    ln -s "$(which "$TEMPSETTING")" ./"$1"
 }
 
 setprogram terminal st
+setprogram browser firefox
 setprogram filemanager nautilus
 setprogram systemmonitor mate-system-monitor
 setprogram appmenu appmenu