Permalink
Browse files

overlay partial procedure working; test overlay setup

  • Loading branch information...
1 parent 71a2c61 commit c8471f7da1af48c4990175f86fdbc40dcd760f43 @altercation committed Aug 30, 2011
Showing with 972 additions and 24 deletions.
  1. 0 README.md
  2. 0 TODO.md
  3. 0 filesystems/TODO
  4. 0 peripherals/TODO
  5. 0 procedures/automatic
  6. 0 procedures/partial-conform-system
  7. 0 procedures/partial-conform-user
  8. 0 procedures/partial-package-diff
  9. +78 −23 procedures/partial-update-overlay
  10. 0 profiles/es-laptop
  11. +3 −0 systems/lenovo/x220/overlay/etc/X11/xinit/Xmodmap
  12. +31 −0 systems/lenovo/x220/overlay/etc/X11/xinit/xbindkeysrc
  13. +39 −0 systems/lenovo/x220/overlay/etc/X11/xinit/xinitrc
  14. +4 −0 systems/lenovo/x220/overlay/etc/X11/xorg.conf.d/90-monitor.conf
  15. +233 −0 systems/lenovo/x220/overlay/etc/acpi/handler.sh
  16. +7 −0 systems/lenovo/x220/overlay/etc/drirc
  17. +4 −0 systems/lenovo/x220/overlay/etc/network.d/ethernet-dhcp
  18. +30 −0 systems/lenovo/x220/overlay/etc/pm/power.d/cpu
  19. +63 −0 systems/lenovo/x220/overlay/etc/pm/power.d/display
  20. +21 −0 systems/lenovo/x220/overlay/etc/pm/power.d/network
  21. +5 −0 systems/lenovo/x220/overlay/etc/pm/power.d/save-state
  22. +21 −0 systems/lenovo/x220/overlay/etc/pm/power.d/sound
  23. +26 −0 systems/lenovo/x220/overlay/etc/pm/sleep.d/11netcfg
  24. +13 −0 systems/lenovo/x220/overlay/etc/pm/sleep.d/90alsa
  25. +8 −0 systems/lenovo/x220/overlay/etc/thinkfan.conf
  26. +1 −0 systems/lenovo/x220/overlay/etc/udev/rules.d/95-keymap.rules
  27. +3 −0 systems/lenovo/x220/overlay/etc/wpa_supplicant.conf
  28. +4 −0 systems/lenovo/x220/overlay/lib/udev/keymaps/lenovo-thinkpad_x220_tablet
  29. +109 −0 systems/lenovo/x220/overlay/usr/local/bin/rotate-screen
  30. +268 −0 systems/lenovo/x220/overlay/var/lib/alsa/asound.state
  31. +1 −1 systems/lenovo/x220/profile
View
0 README.md 100644 → 100755
No changes.
View
0 TODO.md 100644 → 100755
No changes.
View
0 filesystems/TODO 100644 → 100755
No changes.
View
0 peripherals/TODO 100644 → 100755
No changes.
View
0 procedures/automatic 100644 → 100755
No changes.
View
No changes.
View
No changes.
View
No changes.
View
@@ -19,7 +19,7 @@ var_AIF_PROCEDURE_PATH="$procedure"; [[ "$module" == "http" ]] && var_AIF_PROCED
var_MODULE_PATHS=("${var_AIF_PROCEDURE_PATH%$var_PROCEDURE_SUBPATH*}" "/usr/lib/aif/user/figtree")
var_FORCE_OVERWRITE=
var_NO_BACKUPS=
-var_OPTS_STRING="c:fn"
+var_OPTS_STRING="c:fnwDR"
# ----------------------------------------------------------------------
# PHASE WORKER CUSTOMIZATIONS
@@ -39,13 +39,22 @@ phase_system=(write_overlay) # module specific custom workers (see below)
# aif.sh related functions
# ----------------------------------------------------------------------
+var_WIPE_OVERLAY=
+var_FORCE_OVERWRITE=
+var_NO_BACKUPS=
+var_DIFFS=
+var_RECURSIVE=
+
process_args ()
{
dfunc
case $1 in
+ -w) var_WIPE_OVERLAY=1 ;;
-f) var_FORCE_OVERWRITE=1 ;;
-n) var_NO_BACKUPS=1 ;;
- -c) [[ -n "$2" ]] && var_AUTOMATIC_PROFILE=$2 || die_error "You must specify an aif config profile when using the -c flag." ;;
+ -D) var_DIFFS=1 ;;
+ -R) var_RECURSIVE=1 ;;
+ -c) [[ -n "$2" ]] && var_PARTIAL_PROFILE=$2 || die_error "You must specify an aif config profile when using the -c flag." ;;
*) usage && exit 5 ;;
esac
}
@@ -107,55 +116,100 @@ Options:
require local write access, this is not usable for
this partial procedure)
+-w Wipe overwrite directory (DANGER!)
+ Completely removes existing overlay directory
+ prior to copying new overlay files over. Will
+ operate recursively if the -r parameter is also
+ present. Be careful! Use version control.
+
-f Force overwrite mode (DANGER!)
Does not prompt for action when scanning files;
simply overwrites all overlay files in the target
profile subdirectory. Overwritten files will be
backed up unless the -n command line parameter is
also specified.
+-F Force clean overlay mode (DOUBLE DANGER!)
+ Completely erases the existing overlay directory!
+ Danger danger danger! All existing overlay data
+ will be removed. No prompts will be given.
+
-n No backup file. When writing an overlay file, any
existing overlay file in that directory with the
same name will normally be backed up first. Use of
the '-n' parameter will stop backups from being
written; use with caution or with version control!
+-D Report file diff before prompting for (or forcing)
+ file overwrite.
+
+-R Recursive. All profiles referenced by master
+ profiles will be processed by the procedure. Note
+ that the full figtree procedures such as automatic
+ are always recursive. This partial procedure
+ normally operates on a single profile but can be
+ forced into recursive mode using this parameter.
+
------------------------------------------------------------------------
EOF
# ----------------------------------------------------------------------
# procedure workers
# ----------------------------------------------------------------------
-worker_preconfigure ()
-{
- var_UI_TYPE=${arg_ui_type:-cli}
- ui_init
-}
-
worker_intro ()
{
local procname="$var_MODULE_NAME $(basename $var_AIF_PROCEDURE_PATH)"
+ local default=yes
+ if [[ -n "$var_WIPE_OVERLAY" ]]; then
+ intro+="\n -w Wipe overlay directory is ON. Overlay directory will be COMPLETELY REMOVED Prior to write."
+ local default=no
+ else
+ intro+="\n(-w) Wipe overlay directory is off. Overlay directory will remain intact prior to write."
+ fi
+ if [[ -n "$var_FORCE_OVERWRITE" ]]; then
+ intro+="\n -f Force overwrite is ON. NO PROMPTS Will be given and all OVERWRITES WILL BE MADE."
+ local default=no
+ else
+ intro+="\n(-f) Force overwrite is off. Prompts will be given prior to any change."
+ fi
if [[ -n "$var_NO_BACKUPS" ]]
then
- local backup_warning="Backups are OFF! No backup files will be created when overwriting overlay files."
+ intro+="\n -b No-backups mode is ON. NO BACKUP FILES Will be created during overwrites."
+ local default=no
else
- local backup_warning="Backups are ON. Original overlay files will be renamed and saved with a backup suffix during overwrite procedures."
+ intro+="\n(-b) No-backup mode is off. Backups will be created during any overwrite."
fi
- if [[ -n "$var_FORCE_OVERWRITE" ]]
+ if [[ -n "$var_RECURSIVE" ]]
then
- inform "\nRUNNING THE $(toupper "$procname") PROCEDURE IN FORCE-OVERWRITE MODE."
- notify "Overlay files in the profile directory will be *COMPLETELY AND AUTOMATICALLY OVERWRITTEN WITH THE CURRENT, LIVE VERSION OF THE OVERLAY FILE!"
- inform "$backup_warning"
- ask_yesno "Do you want to continue?" no || exit
+ intro+="\n -R Recursive mode is ON. ALL LINKED PROFILES Will be processed."
+ recursive_note=" and all recursively linked profiles"
+ local default=no
+ else
+ intro+="\n(-R) Recursive mode is off. No linked profiles will be processed."
+ recursive_note=
+ fi
+ if [[ -n "$var_DIFFS" ]]; then
+ intro+="\n -d Diff mode is ON. Diffs will be displayed prior to file overwrite."
else
- inform "\nRUNNING THE $(toupper "$procname") PROCEDURE IN QUERY MODE (NORMAL)."
- inform "Overlay files will be scanned and you will be presented with a series of choices regarding each based on the current state of the profile overlay."
- inform "$backup_warning"
- ask_yesno "Do you want to continue?" yes || exit
+ intro+="\n(-d) Diff mode is off. No diff information will be shown."
fi
+ inform "\nRUNNING THE $(toupper "$procname") PROCEDURE"
+ inform "\nSourcing profile ${var_PARTIAL_PROFILE}${recursive_note}"
+ inform "${intro}\n"
+ ask_yesno "Do you want to continue?" $default || exit
}
+worker_configure ()
+{
+ # LOAD PROFILE
+ [[ -z "$var_PARTIAL_PROFILE" ]] && \
+ die_error "You must specify a config file (-c profile/path) to use this procedure. Run this procedure again with -h for more details."
+ load_profile $var_PARTIAL_PROFILE || \
+ die_error "Failed to load profile $var_PARTIAL_PROFILE from paths $var_MODULE_PATHS"
+}
+
+
worker_write_overlay()
{
inform "Overlay write started..."
@@ -164,11 +218,12 @@ worker_write_overlay()
# i could also make the system_misc function or worker process an array of commands; here we use installs permissions arg
dfunc
local overlay_file=
- for overlay_file in $var_OVERLAY_FILES
+ for overlay_file in $var_OVERLAY_FILES; do write_overlay_file "$overlay_file"; done
+ for module_root in ${var_MODULE_PATHS[@]}
do
- write_overlay_file "$overlay_file"
+ chmod --recursive --reference=$module_root $(dirname $module_root)
+ chown --recursive --reference=$module_root $(dirname $module_root)
done
- chmod and chown en mass
}
write_overlay_file()
@@ -186,7 +241,7 @@ write_overlay_file()
show_warning "NO OVERLAY FILE SOURCE" "Profile overlay requests non-existant source file: \"$from_path\""; return 1
elif [[ ! -f "$to_path" ]]; then
ask_yesno "No overlay file present. Copy current $from_path to $to_path" yes || return 0
- elif [[ -n "$var_NO_BACKUP" ]]; then
+ elif [[ -n "$var_NO_BACKUPS" ]]; then
ask_yesno "Overlay file present. Copy current $from_path to $to_path? NO BACKUP WILL BE CREATED." no || return 0
else
ask_yesno "Overlay file present. Copy current $from_path to $to_path? Backup will be created." yes || return 0
View
0 profiles/es-laptop 100644 → 100755
No changes.
@@ -0,0 +1,3 @@
+keycode 162 = XF86RotateWindows
+keycode 161 = XF86RotationPB
+keycode 248 = XF86AudioRecord
@@ -0,0 +1,31 @@
+# xbindkeys configuration
+
+# Mute
+"amixer set Master toggle"
+m:0x0 + c:121
+XF86AudioMute
+
+# Mic Mute (see news.spinics.net/lists/linux-input/msg15394.html as
+# this may end up working in future kernels)
+# see also www.spinics.net/lists/platform-driver-x86/msg02012.html
+# regarding micmute led
+"amixer set Capture toggle"
+m:0x0 + c:248
+XF86AudioRecord
+
+# Volume down
+"amixer set Master playback 5-"
+m:0x0 + c:122
+XF86AudioLowerVolume
+
+# Volume up
+"amixer set Master playback 5+"
+m:0x0 + c:123
+XF86AudioRaiseVolume
+
+# Rotate screen orientation
+"rotate-screen"
+m:0x0 + c:161
+XF86RotationPB
+
+# End of xbindkeys configuration
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+sysresources=/etc/X11/xinit/Xresources
+sysmodmap=/etc/X11/xinit/Xmodmap
+sysxbindkeys=/etc/X11/xinit/xbindkeysrc
+userresources=$HOME/.Xresources
+usermodmap=$HOME/.Xmodmap
+userxbindkeys=$HOME/.xbindkeysrc
+
+# merge in defaults and keymaps
+if [ -f $sysresources ]; then
+ xrdb -merge $sysresources
+fi
+if [ -f $sysmodmap ]; then
+ xmodmap $sysmodmap
+fi
+if [ -f "$userresources" ]; then
+ xrdb -merge "$userresources"
+fi
+if [ -f "$usermodmap" ]; then
+ xmodmap "$usermodmap"
+fi
+if [ -f $userxbindkeys ]; then
+ xbindkeys
+else
+ xbindkeys -f $sysxbindkeys
+fi
+
+# set background color
+hsetroot -solid "#000000"
+
+# turn off touchpad buttons
+# (x100e makes these easy to depress while working on lap)
+#xinput set-button-map 'SynPS/2 Synaptics TouchPad' 0 0 0 4 5 6 7 8 9 1 2 3
+#xinput set-int-prop 'SynPS/2 Synaptics TouchPad' 'Device Enabled' 8 0
+
+# start xmonad
+echo $USER > /tmp/xuser
+exec xmonad
@@ -0,0 +1,4 @@
+Section "Monitor"
+ Identifier "<default monitor>"
+ DisplaySize 275 155
+EndSection
Oops, something went wrong.

0 comments on commit c8471f7

Please sign in to comment.