├── banner.png ├── icons ├── arduino.png └── dosbox.png ├── tmux.conf ├── modules ├── gitconfig ├── rc.local ├── README.md ├── pocketchip.kmap ├── install.sh ├── config.json ├── vimrc ├── motd.sh ├── battery └── dosbox-0.74.conf /banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/totor59/pocketchip/HEAD/banner.png -------------------------------------------------------------------------------- /icons/arduino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/totor59/pocketchip/HEAD/icons/arduino.png -------------------------------------------------------------------------------- /icons/dosbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/totor59/pocketchip/HEAD/icons/dosbox.png -------------------------------------------------------------------------------- /tmux.conf: -------------------------------------------------------------------------------- 1 | set -g status-right "#(/usr/bin/battery) | %H:%M | %d-%b" 2 | set -g status-interval 10 3 | -------------------------------------------------------------------------------- /modules: -------------------------------------------------------------------------------- 1 | # /etc/modules: kernel modules to load at boot time. 2 | # 3 | # This file contains the names of kernel modules that should be loaded 4 | # at boot time, one per line. Lines beginning with "#" are ignored. 5 | 6 | rt2800usb 7 | -------------------------------------------------------------------------------- /gitconfig: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------ 2 | # MINIMAL GITCONFIG 3 | # ------------------------------------------------------------------ 4 | [user] 5 | name = totor59 6 | email = victormarechal59@gmail.com 7 | [core] 8 | editor = vim 9 | [alias] 10 | log = log --graph 11 | [color] 12 | ui = auto 13 | [merge] 14 | tool = vimdiff 15 | -------------------------------------------------------------------------------- /rc.local: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # 3 | # rc.local 4 | # 5 | # This script is executed at the end of each multiuser runlevel. 6 | # Make sure that the script will "exit 0" on success or any other 7 | # value on error. 8 | # 9 | # In order to enable or disable this script just change the execution 10 | # bits. 11 | # 12 | # By default this script does nothing. 13 | 14 | # Keyboard 15 | /usr/bin/loadkeys /home/chip/.config/pocketchip.kmap 16 | # Ralink wifi chipsets 17 | echo "148f 5370" > /sys/bus/usb/drivers/rt2800usb/new_id 18 | exit 0 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![banner](banner.png) 2 | 3 | ## POCKETCHIP CONFIGURATION FOR TEXTMODE 4 | 5 | 6 | *** 7 | 8 | 9 | > My very own configuration for PocketChip microcomputer. Be free to use, share or fork it 10 | 11 | 12 | ### Includes 13 | 14 | * Full keyboard support with Fn key combinations working 15 | * Support for rt2800usb based wifi adapters 16 | * Battery level in tmux status line 17 | * Python development axed vimrc 18 | * Custom MOTD 19 | * And more ... :) 20 | 21 | 22 | ### Installation 23 | 24 | 1. Flash your C.H.I.P. with the latest headless image from NTC at 25 | 26 | 2. Install Git 27 | 28 | ` sudo apt-get install git-core ` 29 | 30 | 3. Clone the repo 31 | 32 | ` git clone https://github.com/totor59/pocketchip.git ` 33 | 34 | 4. Go inside pocketchip/ 35 | 36 | ` cd pocketchip ` 37 | 38 | 5. Login as root 39 | 40 | ` su ` 41 | 42 | 6. Make install.sh executable and run it 43 | 44 | ` chmod +x install.sh && ./install.sh ` 45 | 46 | 7. Reboot and enjoy ! 47 | 48 | ### Todo 49 | 50 | * bashrc chip & root 51 | * mutt config 52 | -------------------------------------------------------------------------------- /pocketchip.kmap: -------------------------------------------------------------------------------- 1 | ####################################################################### 2 | # PocketChip keymap 3 | # totor59 4 | # 5 | # To make it permanent place the following in /etc/rc.local 6 | # /usr/bin/loadkeys path/to/pocketchip.kmap 7 | # 8 | ####################################################################### 9 | 10 | keymaps 0-2,4-5,8,12 11 | keycode 100 = AltGr 12 | altgr keycode 2 = F1 13 | altgr keycode 3 = F2 14 | altgr keycode 4 = F3 15 | altgr keycode 5 = F4 16 | altgr keycode 6 = F5 17 | altgr keycode 7 = F6 18 | altgr keycode 8 = F7 19 | altgr keycode 9 = F8 20 | altgr keycode 10 = F9 21 | altgr keycode 11 = F10 22 | altgr keycode 74 = F11 23 | shift keycode 74 = underscore 24 | altgr keycode 13 = F12 25 | altgr keycode 21 = braceleft 26 | altgr keycode 22 = braceright 27 | altgr keycode 23 = bracketleft 28 | altgr keycode 24 = bracketright 29 | altgr keycode 25 = bar 30 | altgr keycode 35 = less 31 | altgr keycode 36 = greater 32 | altgr keycode 37 = apostrophe 33 | altgr keycode 38 = quotedbl 34 | altgr keycode 48 = grave 35 | altgr keycode 49 = asciitilde 36 | altgr keycode 50 = colon 37 | altgr keycode 52 = semicolon 38 | shift keycode 52 = comma 39 | altgr keycode 53 = backslash 40 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################### 3 | # POCKETCHIP CONFIGURATION 4 | # 2017 totor59 5 | # You have to run as root 6 | ############################################################################### 7 | 8 | 9 | # GENERAL 10 | apt-get -y update 11 | apt-get -y upgrade 12 | apt-get -y dist-upgrade 13 | apt-get -y install vim-nox tmux python-pip python-flake8 mutt tree bash-completion dosbox firmware-ralink gcc make libx11-dev libxft-dev libxext-dev 14 | 15 | # POCKETCHIP SETTINGS 16 | # Includes keymap for pocketchip and support for module rt2800usb 17 | mv pocketchip.kmap /home/chip/.config/ 18 | rm /etc/rc.local 19 | cp rc.local /etc/ 20 | rm /etc/modules 21 | cp modules /etc/modules 22 | cp battery /usr/bin/battery 23 | chmod 755 battery 24 | 25 | # LIGHTWEIGHT TERMINAL 26 | git clone git://git.suckless.org/st 27 | cd st 28 | make clean install 29 | cd .. 30 | 31 | # GIT 32 | mv gitconfig /home/chip/.gitconfig 33 | 34 | # TMUX 35 | cp tmux.conf /home/chip/.tmux.conf 36 | 37 | # DOSBOX 38 | mkdir /home/chip/dos 39 | mv dosbox-0.74.conf ~/home/chip/.dosbox-0.74.conf 40 | 41 | # DESKTOP 42 | mv icons/* /usr/share/pocket-home/appIcons/ 43 | 44 | # VIM 45 | chmod -R 777 /etc/vim 46 | mkdir bundle 47 | rm /etc/vim/vimrc 48 | mv vimrc /etc/vim/ 49 | mkdir /etc/vim/bundle 50 | source /etc/vim/vimrc 51 | git clone https://github.com/VundleVim/Vundle.vim.git /etc/vim/bundle/Vundle.vim 52 | vim +PluginInstall +qall 53 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultPage" : "Apps", 3 | "pages": [ 4 | { 5 | "name": "Apps", 6 | "items": [ 7 | { 8 | "name": "Terminal", 9 | "icon": "appIcons/terminal.png", 10 | "shell": "st" 11 | }, 12 | { 13 | "name": "Play PICO-8", 14 | "icon": "appIcons/pico8.png", 15 | "shell": "pico8" 16 | }, 17 | { 18 | "name": "Sunvox", 19 | "icon": "appIcons/musicsequencer.png", 20 | "shell": "sunvox" 21 | }, 22 | { 23 | "name": "Dosbox", 24 | "icon": "appIcons/dosbox.png", 25 | "shell": "dosbox" 26 | }, 27 | { 28 | "name": "Write", 29 | "icon": "appIcons/texteditor.png", 30 | "shell": "leafpad" 31 | }, 32 | { 33 | "name": "Files", 34 | "icon": "appIcons/filebrowser.png", 35 | "shell": "pcmanfm" 36 | }, 37 | ], 38 | "cornerButtons": [ 39 | { 40 | "location": "TopLeft", 41 | "name": "Battery", 42 | "icon": "battery_0.png" 43 | }, 44 | { 45 | "location": "TopRight", 46 | "name": "WiFi", 47 | "icon": "wifiOff.png" 48 | }, 49 | 50 | { 51 | "location": "BottomLeft", 52 | "name": "Power", 53 | "icon": "powerIcon.png" 54 | }, 55 | { 56 | "location": "BottomRight", 57 | "name": "Settings", 58 | "icon": "settingsIcon.png" 59 | } 60 | ] 61 | }, 62 | { 63 | "name": "Settings" 64 | }, 65 | { 66 | "name": "Power" 67 | }, 68 | { 69 | "name": "WiFi" 70 | }, 71 | { 72 | "name": "Battery" 73 | } 74 | ] 75 | } 76 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 | " => MINIMAL VIMRC 3 | " => @totorsystem 4 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 5 | 6 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 7 | " => PLUGINS 8 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 9 | set nocompatible " be iMproved, required 10 | filetype off " required 11 | 12 | " set the runtime path to include Vundle and initialize 13 | set rtp+=/etc/vim/bundle/Vundle.vim 14 | "call vundle#begin() 15 | " alternatively, pass a path where Vundle should install plugins 16 | call vundle#begin('/etc/vim/bundle') 17 | 18 | " let Vundle manage Vundle, required 19 | Plugin 'VundleVim/Vundle.vim' 20 | 21 | " The following are examples of different formats supported. 22 | " Keep Plugin commands between vundle#begin/end. 23 | " Plugins 24 | Plugin 'mattn/emmet-vim' 25 | Plugin 'othree/html5.vim' 26 | Plugin 'tpope/vim-markdown' 27 | Plugin 'scrooloose/nerdtree' 28 | Plugin 'vim-syntastic/syntastic' 29 | Plugin 'vim-airline/vim-airline' 30 | Plugin 'vim-flake8' 31 | 32 | "Colorschemes 33 | Plugin 'vim-scripts/wombat256.vim' 34 | Plugin 'vim-airline/vim-airline-themes' 35 | Plugin 'tomasr/molokai' 36 | 37 | 38 | 39 | " All of your Plugins must be added before the following line 40 | call vundle#end() " required 41 | filetype on " required 42 | filetype plugin on " required 43 | filetype indent on " required 44 | " To ignore plugin indent changes, instead use: 45 | "filetype plugin on 46 | " 47 | " Brief help 48 | " :PluginList - lists configured plugins 49 | " :PluginInstall - installs plugins; append `!` to update or just 50 | " :PluginUpdate 51 | " :PluginSearch foo - searches for foo; append `!` to refresh local cache 52 | " :PluginClean - confirms removal of unused plugins; append `!` to 53 | " auto-approve removal 54 | " 55 | " see :h vundle for more details or wiki for FAQ 56 | " Put your non-Plugin stuff after this line 57 | 58 | 59 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 60 | " => GENERAL 61 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 62 | set backspace=2 " backspace in insert mode works like normal editor 63 | syntax on " syntax highlighting 64 | filetype indent on " activates indenting for files 65 | set autoindent " auto indenting 66 | set number " line numbers 67 | set showmatch " match brackets 68 | 69 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 70 | " => Python 71 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 72 | au BufNewFile,BufRead *.py 73 | \ set tabstop=4 | 74 | \ set softtabstop=4 | 75 | \ set shiftwidth=4 | 76 | \ set textwidth=79 | 77 | \ set expandtab | 78 | \ set autoindent | 79 | \ set fileformat=unix 80 | 81 | 82 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 83 | " => Colors and Fonts 84 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 85 | " Enable syntax highlighting 86 | syntax enable 87 | 88 | " Set utf8 as standard encoding and en_US as the standard language 89 | set encoding=utf8 90 | 91 | " Colorscheme 92 | colorscheme molokai 93 | 94 | " Vim Airline 95 | set laststatus=2 96 | let g:airline_theme='wombat' 97 | 98 | 99 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 100 | " => Files, backups and undo 101 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 102 | " Turn backup off, since most stuff is in SVN, git et.c anyway... 103 | set nobackup 104 | set nowb 105 | set noswapfile 106 | -------------------------------------------------------------------------------- /motd.sh: -------------------------------------------------------------------------------- 1 | ### PLACE THAT FILE IN /etc/profile.d/ ### 2 | 3 | 4 | #!/bin/bash 5 | 6 | clear 7 | 8 | function color (){ 9 | echo "\e[$1m$2\e[0m" 10 | } 11 | 12 | function extend (){ 13 | local str="$1" 14 | let spaces=60-${#1} 15 | while [ $spaces -gt 0 ]; do 16 | str="$str " 17 | let spaces=spaces-1 18 | done 19 | echo "$str" 20 | } 21 | 22 | function center (){ 23 | local str="$1" 24 | let spacesLeft=(78-${#1})/2 25 | let spacesRight=78-spacesLeft-${#1} 26 | while [ $spacesLeft -gt 0 ]; do 27 | str=" $str" 28 | let spacesLeft=spacesLeft-1 29 | done 30 | 31 | while [ $spacesRight -gt 0 ]; do 32 | str="$str " 33 | let spacesRight=spacesRight-1 34 | done 35 | 36 | echo "$str" 37 | } 38 | 39 | function sec2time (){ 40 | local input=$1 41 | 42 | if [ $input -lt 60 ]; then 43 | echo "$input seconds" 44 | else 45 | ((days=input/86400)) 46 | ((input=input%86400)) 47 | ((hours=input/3600)) 48 | ((input=input%3600)) 49 | ((mins=input/60)) 50 | 51 | local daysPlural="s" 52 | local hoursPlural="s" 53 | local minsPlural="s" 54 | 55 | if [ $days -eq 1 ]; then 56 | daysPlural="" 57 | fi 58 | 59 | if [ $hours -eq 1 ]; then 60 | hoursPlural="" 61 | fi 62 | 63 | if [ $mins -eq 1 ]; then 64 | minsPlural="" 65 | fi 66 | 67 | echo "$days day$daysPlural, $hours hour$hoursPlural, $mins minute$minsPlural" 68 | fi 69 | } 70 | 71 | borderColor=35 72 | headerLeafColor=32 73 | headerRaspberryColor=31 74 | greetingsColor=36 75 | statsLabelColor=33 76 | 77 | borderLine="━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 78 | borderTopLine=$(color $borderColor "┏$borderLine┓") 79 | borderBottomLine=$(color $borderColor "┗$borderLine┛") 80 | borderBar=$(color $borderColor "┃") 81 | borderEmptyLine="$borderBar $borderBar" 82 | 83 | # Header 84 | 85 | 86 | me=$(whoami) 87 | 88 | # Greetings 89 | greetings="$(color $greetingsColor "$(center "Welcome back, $me!")")\n" 90 | greetings="$greetings$(color $greetingsColor "$(center "$(date +"%A, %d %B %Y, %T")")")" 91 | 92 | 93 | uptime="$(sec2time $(cut -d "." -f 1 /proc/uptime))" 94 | uptime="$uptime ($(date -d "@"$(grep btime /proc/stat | cut -d " " -f 2) +"%d-%m-%Y %H:%M:%S"))" 95 | 96 | label2="$(extend "$uptime")" 97 | label2="$(color $statsLabelColor "Uptime........:") $label2" 98 | 99 | label3="$(extend "$(free -m | awk 'NR==2 { printf "Total: %sMB, Used: %sMB, Free: %sMB",$2,$3,$4; }')")" 100 | label3="$(color $statsLabelColor "Memory........:") $label3" 101 | 102 | label4="$(extend "$(df -h ~ | awk 'NR==2 { printf "Total: %sB, Used: %sB, Free: %sB",$2,$3,$4; }')")" 103 | label4="$(color $statsLabelColor "Home space....:") $label4" 104 | 105 | 106 | stats="$label2\n$label3\n$label4\n" 107 | 108 | # Print motd 109 | cat << "EOF" 110 | +90N-+-----+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+ 111 | | . _..::__: ,-"-"._ |7 , _,.__ | 112 | | _.___ _ _<_>`!(._`.`-. / _._ `_ ,_/ ' '-._.---.-.__| 113 | |.{ " " `-==,',._\{ \ / {) / _ ">_,-' ` mt-2_| 114 | + \_.:--. `._ )`^-. "' , [_/( __,/-' + 115 | |'"' \ " _L oD_,--' ) /. (| | 116 | | | ,' _)_.\\._<> 6 _,' / ' | 117 | | `. / [_/_'` `"( <'} ) | 118 | +30N \\ .-. ) / `-'"..' `:._ _) ' + 119 | | ` \ ( `( / `:\ > \ ,-^. /' ' | 120 | | `._, "" | \`' \| ?_) {\ | 121 | | `=.---. `._._ ,' "` |' ,- '. | 122 | +000 | `-._ | / `:`<_|h--._ + 123 | | ( > . | , `=.__.`-'\ | 124 | | `. / | |{| ,-.,\ .| 125 | | | ,' \ / `' ," \ | 126 | +30S | / |_' | __ / + 127 | | | | '-' `-' \.| 128 | | |/ " / | 129 | | \. ' | 130 | +60S-+-----+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+ 131 | EOF 132 | 133 | 134 | echo -e "$greetings\n$stats" 135 | -------------------------------------------------------------------------------- /battery: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This program gets the battery info from PMU 3 | # Voltage and current charging/discharging 4 | # 5 | # Nota : temperature can be more than real because of self heating 6 | ####################################################################### 7 | # Copyright (c) 2014 by RzBo, Bellesserre, France 8 | # 9 | # Permission is granted to use the source code within this 10 | # file in whole or in part for any use, personal or commercial, 11 | # without restriction or limitation. 12 | # 13 | # No warranties, either explicit or implied, are made as to the 14 | # suitability of this code for any purpose. Use at your own risk. 15 | ####################################################################### 16 | # 17 | # Installation: 18 | # Place in /usr/bin/battery 19 | # chmod 755 /usr/bin/battery 20 | ####################################################################### 21 | 22 | # force ADC enable for battery voltage and current 23 | /usr/sbin/i2cset -y -f 0 0x34 0x82 0xC3 24 | 25 | ################################ 26 | #read Power status register @00h 27 | POWER_STATUS=$(/usr/sbin/i2cget -y -f 0 0x34 0x00) 28 | #echo $POWER_STATUS 29 | 30 | BAT_STATUS=$(($(($POWER_STATUS&0x02))/2)) # divide by 2 is like shifting rigth 1 times 31 | #echo $(($POWER_STATUS&0x02)) 32 | #echo "BAT_STATUS="$BAT_STATUS 33 | # echo $BAT_STATUS 34 | 35 | ################################ 36 | #read Power OPERATING MODE register @01h 37 | POWER_OP_MODE=$(/usr/sbin/i2cget -y -f 0 0x34 0x01) 38 | #echo $POWER_OP_MODE 39 | 40 | CHARG_IND=$(($(($POWER_OP_MODE&0x40))/64)) # divide by 64 is like shifting rigth 6 times 41 | #echo $(($POWER_OP_MODE&0x40)) 42 | #echo "CHARG_IND="$CHARG_IND 43 | # echo $CHARG_IND 44 | 45 | BAT_EXIST=$(($(($POWER_OP_MODE&0x20))/32)) # divide by 32 is like shifting rigth 5 times 46 | #echo $(($POWER_OP_MODE&0x20)) 47 | #echo "BAT_EXIST="$BAT_EXIST 48 | # echo $BAT_EXIST 49 | 50 | ################################ 51 | #read Charge control register @33h 52 | CHARGE_CTL=$(/usr/sbin/i2cget -y -f 0 0x34 0x33) 53 | #echo "CHARGE_CTL="$CHARGE_CTL 54 | # echo $CHARGE_CTL 55 | 56 | 57 | ################################ 58 | #read Charge control register @34h 59 | CHARGE_CTL2=$(/usr/sbin/i2cget -y -f 0 0x34 0x34) 60 | #echo "CHARGE_CTL2="$CHARGE_CTL2 61 | # echo $CHARGE_CTL2 62 | 63 | 64 | ################################ 65 | #read battery voltage 79h, 78h 0 mV -> 000h, 1.1 mV/bit FFFh -> 4.5045 V 66 | BAT_VOLT_MSB=$(/usr/sbin/i2cget -y -f 0 0x34 0x78) 67 | BAT_VOLT_LSB=$(/usr/sbin/i2cget -y -f 0 0x34 0x79) 68 | 69 | #echo $BAT_VOLT_MSB $BAT_VOLT_LSB 70 | # bash math -- converts hex to decimal so `bc` won't complain later... 71 | # MSB is 8 bits, LSB is lower 4 bits 72 | BAT_BIN=$(( $(($BAT_VOLT_MSB << 4)) | $(($(($BAT_VOLT_LSB & 0x0F)) )) )) 73 | 74 | BAT_VOLT=$(echo "($BAT_BIN*1.1)"|bc) 75 | #echo "Battery voltage = "$BAT_VOLT"mV" 76 | 77 | ################### 78 | #read Battery Discharge Current 7Ch, 7Dh 0 mV -> 000h, 0.5 mA/bit 1FFFh -> 1800 mA 79 | #AXP209 datasheet is wrong, discharge current is in registers 7Ch 7Dh 80 | #13 bits 81 | BAT_IDISCHG_MSB=$(/usr/sbin/i2cget -y -f 0 0x34 0x7C) 82 | BAT_IDISCHG_LSB=$(/usr/sbin/i2cget -y -f 0 0x34 0x7D) 83 | 84 | #echo $BAT_IDISCHG_MSB $BAT_IDISCHG_LSB 85 | 86 | BAT_IDISCHG_BIN=$(( $(($BAT_IDISCHG_MSB << 5)) | $(($(($BAT_IDISCHG_LSB & 0x1F)) )) )) 87 | 88 | BAT_IDISCHG=$(echo "($BAT_IDISCHG_BIN*0.5)"|bc) 89 | #echo "Battery discharge current = "$BAT_IDISCHG"mA" 90 | 91 | ################### 92 | #read Battery Charge Current 7Ah, 7Bh 0 mV -> 000h, 0.5 mA/bit FFFh -> 1800 mA 93 | #AXP209 datasheet is wrong, charge current is in registers 7Ah 7Bh 94 | #(12 bits) 95 | BAT_ICHG_MSB=$(/usr/sbin/i2cget -y -f 0 0x34 0x7A) 96 | BAT_ICHG_LSB=$(/usr/sbin/i2cget -y -f 0 0x34 0x7B) 97 | 98 | #echo $BAT_ICHG_MSB $BAT_ICHG_LSB 99 | 100 | BAT_ICHG_BIN=$(( $(($BAT_ICHG_MSB << 4)) | $(($(($BAT_ICHG_LSB & 0x0F)) )) )) 101 | 102 | BAT_ICHG=$(echo "($BAT_ICHG_BIN*0.5)"|bc) 103 | #echo "Battery charge current = "$BAT_ICHG"mA" 104 | 105 | ################### 106 | #read internal temperature 5eh, 5fh -144.7c -> 000h, 0.1c/bit FFFh -> 264.8c 107 | TEMP_MSB=$(/usr/sbin/i2cget -y -f 0 0x34 0x5e) 108 | TEMP_LSB=$(/usr/sbin/i2cget -y -f 0 0x34 0x5f) 109 | 110 | # bash math -- converts hex to decimal so `bc` won't complain later... 111 | # MSB is 8 bits, LSB is lower 4 bits 112 | TEMP_BIN=$(( $(($TEMP_MSB << 4)) | $(($(($TEMP_LSB & 0x0F)) )) )) 113 | 114 | TEMP_C=$(echo "($TEMP_BIN*0.1-144.7)"|bc) 115 | #echo "Internal temperature = "$TEMP_C"c" 116 | 117 | ################### 118 | #read fuel gauge B9h 119 | BAT_GAUGE_HEX=$(/usr/sbin/i2cget -y -f 0 0x34 0xb9) 120 | 121 | # bash math -- converts hex to decimal so `bc` won't complain later... 122 | # MSB is 8 bits, LSB is lower 4 bits 123 | BAT_GAUGE_DEC=$(($BAT_GAUGE_HEX)) 124 | 125 | #echo "Battery gauge = "$BAT_GAUGE_DEC"%" 126 | echo -e "Batt:"$BAT_GAUGE_DEC"%" 127 | -------------------------------------------------------------------------------- /dosbox-0.74.conf: -------------------------------------------------------------------------------- 1 | # This is the configurationfile for DOSBox 0.74. (Please use the latest version of DOSBox) 2 | # Lines starting with a # are commentlines and are ignored by DOSBox. 3 | # They are used to (briefly) document the effect of each option. 4 | 5 | [sdl] 6 | # fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back) 7 | # fulldouble: Use double buffering in fullscreen. It can reduce screen flickering, but it can also result in a slow DOSBox. 8 | # fullresolution: What resolution to use for fullscreen: original or fixed size (e.g. 1024x768). 9 | # Using your monitor's native resolution with aspect=true might give the best results. 10 | # If you end up with small window on a large screen, try an output different from surface. 11 | # windowresolution: Scale the window to this size IF the output device supports hardware scaling. 12 | # (output=surface does not!) 13 | # output: What video system to use for output. 14 | # Possible values: surface, overlay, opengl, openglnb. 15 | # autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock) 16 | # sensitivity: Mouse sensitivity. 17 | # waitonerror: Wait before closing the console if dosbox has an error. 18 | # priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized. 19 | # pause is only valid for the second entry. 20 | # Possible values: lowest, lower, normal, higher, highest, pause. 21 | # mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the defaul value. 22 | # usescancodes: Avoid usage of symkeys, might not work on all operating systems. 23 | 24 | fullscreen=true 25 | fulldouble=false 26 | fullresolution=480x272 27 | windowresolution=480x272 28 | output=overlay 29 | autolock=true 30 | sensitivity=100 31 | waitonerror=true 32 | priority=higher,normal 33 | mapperfile=mapper-0.74.map 34 | usescancodes=true 35 | 36 | [dosbox] 37 | # language: Select another language file. 38 | # machine: The type of machine tries to emulate. 39 | # Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe. 40 | # captures: Directory where things like wave, midi, screenshot get captured. 41 | # memsize: Amount of memory DOSBox has in megabytes. 42 | # This value is best left at its default to avoid problems with some games, 43 | # though few games might require a higher value. 44 | # There is generally no speed advantage when raising this value. 45 | 46 | language= 47 | machine=svga_s3 48 | captures=capture 49 | memsize=16 50 | 51 | [render] 52 | # frameskip: How many frames DOSBox skips before drawing one. 53 | # aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!. 54 | # scaler: Scaler used to enlarge/enhance low resolution modes. 55 | # If 'forced' is appended, then the scaler will be used even if the result might not be desired. 56 | # Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x. 57 | 58 | frameskip=0 59 | aspect=false 60 | scaler=normal2x 61 | 62 | [cpu] 63 | # core: CPU Core used in emulation. auto will switch to dynamic if available and appropriate. 64 | # Possible values: auto, normal, simple. 65 | # cputype: CPU Type used in emulation. auto is the fastest choice. 66 | # Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch. 67 | # cycles: Amount of instructions DOSBox tries to emulate each millisecond. 68 | # Setting this value too high results in sound dropouts and lags. 69 | # Cycles can be set in 3 ways: 70 | # 'auto' tries to guess what a game needs. 71 | # It usually works, but can fail for certain games. 72 | # 'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails. 73 | # (Example: fixed 4000). 74 | # 'max' will allocate as much cycles as your computer is able to handle. 75 | # 76 | # Possible values: auto, fixed, max. 77 | # cycleup: Amount of cycles to decrease/increase with keycombo.(CTRL-F11/CTRL-F12) 78 | # cycledown: Setting it lower than 100 will be a percentage. 79 | 80 | core=auto 81 | cputype=auto 82 | cycles=auto 83 | cycleup=10 84 | cycledown=20 85 | 86 | [mixer] 87 | # nosound: Enable silent mode, sound is still emulated though. 88 | # rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality. 89 | # Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. 90 | # blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged. 91 | # Possible values: 1024, 2048, 4096, 8192, 512, 256. 92 | # prebuffer: How many milliseconds of data to keep on top of the blocksize. 93 | 94 | nosound=false 95 | rate=44100 96 | blocksize=1024 97 | prebuffer=20 98 | 99 | [midi] 100 | # mpu401: Type of MPU-401 to emulate. 101 | # Possible values: intelligent, uart, none. 102 | # mididevice: Device that will receive the MIDI data from MPU-401. 103 | # Possible values: default, win32, alsa, oss, coreaudio, coremidi, none. 104 | # midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use. 105 | # See the README/Manual for more details. 106 | 107 | mpu401=intelligent 108 | mididevice=default 109 | midiconfig= 110 | 111 | [sblaster] 112 | # sbtype: Type of Soundblaster to emulate. gb is Gameblaster. 113 | # Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none. 114 | # sbbase: The IO address of the soundblaster. 115 | # Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300. 116 | # irq: The IRQ number of the soundblaster. 117 | # Possible values: 7, 5, 3, 9, 10, 11, 12. 118 | # dma: The DMA number of the soundblaster. 119 | # Possible values: 1, 5, 0, 3, 6, 7. 120 | # hdma: The High DMA number of the soundblaster. 121 | # Possible values: 1, 5, 0, 3, 6, 7. 122 | # sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer. 123 | # oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'. 124 | # Possible values: auto, cms, opl2, dualopl2, opl3, none. 125 | # oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well). 126 | # Possible values: default, compat, fast. 127 | # oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly). 128 | # Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000. 129 | 130 | sbtype=sb16 131 | sbbase=220 132 | irq=7 133 | dma=1 134 | hdma=5 135 | sbmixer=true 136 | oplmode=auto 137 | oplemu=default 138 | oplrate=44100 139 | 140 | [gus] 141 | # gus: Enable the Gravis Ultrasound emulation. 142 | # gusrate: Sample rate of Ultrasound emulation. 143 | # Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. 144 | # gusbase: The IO base address of the Gravis Ultrasound. 145 | # Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300. 146 | # gusirq: The IRQ number of the Gravis Ultrasound. 147 | # Possible values: 5, 3, 7, 9, 10, 11, 12. 148 | # gusdma: The DMA channel of the Gravis Ultrasound. 149 | # Possible values: 3, 0, 1, 5, 6, 7. 150 | # ultradir: Path to Ultrasound directory. In this directory 151 | # there should be a MIDI directory that contains 152 | # the patch files for GUS playback. Patch sets used 153 | # with Timidity should work fine. 154 | 155 | gus=false 156 | gusrate=44100 157 | gusbase=240 158 | gusirq=5 159 | gusdma=3 160 | ultradir=C:\ULTRASND 161 | 162 | [speaker] 163 | # pcspeaker: Enable PC-Speaker emulation. 164 | # pcrate: Sample rate of the PC-Speaker sound generation. 165 | # Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. 166 | # tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'. 167 | # Possible values: auto, on, off. 168 | # tandyrate: Sample rate of the Tandy 3-Voice generation. 169 | # Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. 170 | # disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible). 171 | 172 | pcspeaker=true 173 | pcrate=44100 174 | tandy=auto 175 | tandyrate=44100 176 | disney=true 177 | 178 | [joystick] 179 | # joysticktype: Type of joystick to emulate: auto (default), none, 180 | # 2axis (supports two joysticks), 181 | # 4axis (supports one joystick, first joystick used), 182 | # 4axis_2 (supports one joystick, second joystick used), 183 | # fcs (Thrustmaster), ch (CH Flightstick). 184 | # none disables joystick emulation. 185 | # auto chooses emulation depending on real joystick(s). 186 | # (Remember to reset dosbox's mapperfile if you saved it earlier) 187 | # Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none. 188 | # timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away). 189 | # autofire: continuously fires as long as you keep the button pressed. 190 | # swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks. 191 | # buttonwrap: enable button wrapping at the number of emulated buttons. 192 | 193 | joysticktype=auto 194 | timed=true 195 | autofire=false 196 | swap34=false 197 | buttonwrap=false 198 | 199 | [serial] 200 | # serial1: set type of device connected to com port. 201 | # Can be disabled, dummy, modem, nullmodem, directserial. 202 | # Additional parameters must be in the same line in the form of 203 | # parameter:value. Parameter for all types is irq (optional). 204 | # for directserial: realport (required), rxdelay (optional). 205 | # (realport:COM1 realport:ttyS0). 206 | # for modem: listenport (optional). 207 | # for nullmodem: server, rxdelay, txdelay, telnet, usedtr, 208 | # transparent, port, inhsocket (all optional). 209 | # Example: serial1=modem listenport:5000 210 | # Possible values: dummy, disabled, modem, nullmodem, directserial. 211 | # serial2: see serial1 212 | # Possible values: dummy, disabled, modem, nullmodem, directserial. 213 | # serial3: see serial1 214 | # Possible values: dummy, disabled, modem, nullmodem, directserial. 215 | # serial4: see serial1 216 | # Possible values: dummy, disabled, modem, nullmodem, directserial. 217 | 218 | serial1=dummy 219 | serial2=dummy 220 | serial3=disabled 221 | serial4=disabled 222 | 223 | [dos] 224 | # xms: Enable XMS support. 225 | # ems: Enable EMS support. 226 | # umb: Enable UMB support. 227 | # keyboardlayout: Language code of the keyboard layout (or none). 228 | 229 | xms=true 230 | ems=true 231 | umb=true 232 | keyboardlayout=auto 233 | 234 | [ipx] 235 | # ipx: Enable ipx over UDP/IP emulation. 236 | 237 | ipx=false 238 | 239 | [autoexec] 240 | # Lines in this section will be run at startup. 241 | # You can put your MOUNT lines here. 242 | MOUNT C /home/chip/dos/ 243 | C: 244 | --------------------------------------------------------------------------------