Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View DennisLfromGA's full-sized avatar
🏠
Working from home

DennisL DennisLfromGA

🏠
Working from home
  • SOHO
  • GA
  • 23:37 (UTC -12:00)
View GitHub Profile
@DennisLfromGA
DennisLfromGA / crv
Created March 20, 2014 00:14
A shell script to display the 'crouton' version in the host and optionally update it. If a local version of 'crouton' cannot be found it downloads & installs one. Also, optionally displays the croutonversion and architecture ([-s option]) and other info. ([-v option]) about all [default] or given chroots.
#!/bin/sh
###
### Set Variables
APPLICATION="${0##*/}"
CHECK_IT=''
CHROOT_LOC=/usr/local/chroots
[ -d /var/crouton/chroots ] && CHROOT_LOC='/var/crouton/chroots'
[ ! -d "$CHROOT_LOC" ] && CHROOT_LOC=''
CHROOT_NAME=''
@DennisLfromGA
DennisLfromGA / crl
Last active August 29, 2015 14:04
A shell script to list the chroot location and chroot name(s) and optionally show the chroot's 'architecture' or complete 'croutonversion' info.
#!/bin/sh -e
# Copyright (c) 2014 The crouton Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
APPLICATION="${0##*/}"
CHROOT_LOC='/usr/local/chroots'
[ -d /var/crouton/chroots ] && CHROOT_LOC='/var/crouton/chroots'
[ ! -d "$CHROOT_LOC" ] && CHROOT_LOC=''
CHROOT_NAME=''
@DennisLfromGA
DennisLfromGA / tpon.sh
Created August 20, 2014 20:26
A shell script to turn on the Chromebook's Touchpad
### Script to turn ON the Trackpad device
#DEBUG=''
[[ -n "$DEBUG" ]] && set -x
TP=''
#VERBOSE=''
## Get Trackpad ID number from Crosh
#+ Write a custom crosh script to get the trackpad id number
echo "crosh <<ENDCROSH
inputcontrol --names
@DennisLfromGA
DennisLfromGA / tpoff.sh
Created August 20, 2014 20:27
A shell script to turn off the Chromebook's touchpad
### Script to turn OFF the Trackpad device
#DEBUG=''
[[ -n "$DEBUG" ]] && set -x
TP=''
#VERBOSE=''
## Get Trackpad ID number from Crosh
#+ Write a custom crosh script to get the trackpad id number
echo "crosh <<ENDCROSH
inputcontrol --names
@DennisLfromGA
DennisLfromGA / tpstat.sh
Created August 20, 2014 20:29
A shell script to get the Chromebook's touchpad status
### Script to get the status of the Trackpad device
#DEBUG=''
[[ -n "$DEBUG" ]] && set -x
TP=''
TPSTATE=''
TPSTATUS=''
#VERBOSE=''
## Get Trackpad ID number from Crosh
#+ Write a custom crosh script to get the trackpad id number
@DennisLfromGA
DennisLfromGA / tp.bash
Created August 20, 2014 20:36
Shell (.bashrc, etc.) excerpt to turn off the Chromebook's touchpad
# Turnoff the Chromebook Touchpad - always -
# NOTE: 'tpstat.sh' & 'tpoff.sh' should be in your PATH
## Get state of Touchpad - 1=on, 0=off
TP_STATE="`tpstat.sh`"
#
# Turn off Touchpad
if [ "$TP_STATE" = 0 ]; # TOUCHPAD IS OFF
then echo "'touchpad' already off"
else echo "Turning Touchpad off to ignore inadvertent touching..." ; tpoff.sh
fi
@DennisLfromGA
DennisLfromGA / cb-repart.sh
Created December 21, 2015 06:04
Chrome OS script to add or delete ChrUbuntu partitions.
#!/bin/bash
set -e
BNAME=$(basename $0)
USAGE="
Usage: sudo bash $0 [ChrUbuntu size in GB]
$BNAME will resize the Chromebook to add or delete ChrUbuntu partitons.
$BNAME should be run from VT2 when NOT logged in.
@DennisLfromGA
DennisLfromGA / startcr
Last active December 22, 2015 04:38
A crouton tool to search and prompt for a Desktop Environment (I.E.) gnome, xbmc, xfce4, etc. in a specified chroot based upon the contents of the '(chroot)/etc/crouton/targets' file. Also allows checking the 'crouton' version and optionally updating all targets in a chroot.
#!/bin/sh
echo_e='/bin/echo -e'
#######################
## Declare Variables ##
#######################
APPLICATION="${0##*/}"
Chroot_loc=/usr/local/chroots
[ -d /var/crouton/chroots ] && Chroot_loc='/var/crouton/chroots'
[ ! -d "$Chroot_loc" ] && Chroot_loc=''
Chroot_par="$(dirname "${Chroot_loc}")"
@DennisLfromGA
DennisLfromGA / vts
Created November 25, 2013 21:14
Lookup current & active vt's (graphical chroots) in a Chromebook / Crouton environment.
curtty="`cat /sys/class/tty/tty0/active`"
echo "tty's on vt's are:"
ps -CX -CXorg -otname= | sort | nl | sed "s/$curtty/$curtty <--/"
@DennisLfromGA
DennisLfromGA / screenfetch.sh
Last active December 30, 2015 12:29
A bash script to fetch system and theme settings for screenshots in most mainstream Linux distributions with some slight, preliminary changes to include ChromeOS.
#!/usr/bin/env bash
# screenFetch
# Script to fetch system and theme settings for screenshots in most mainstream
# Linux distributions.
# Copyright (c) 2010-2012 Brett Bohnenkamper < kittykatt AT archlinux DOT us >
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software