bpennypacker / phad

Pi-Hole Alternate Display
GNU General Public License v3.0
75 stars 8 forks source link

7inc touch screen #17

Open skir0cket opened 3 years ago

skir0cket commented 3 years ago

hi is there a way the data can be resized to fit the raspberry pi 7inch touch screen?

bpennypacker commented 3 years ago

There sure is. I wrote phad in such a way that it should be relatively easy for somebody to modify it for virtually any display they want. I don't have a 7" display of my own to do the grunt work myself, but I wrote PHAD to make use of templates, so it's mostly just a matter of creating new templates for that particular display. Per the README file:

The templates used to display each phad screen are located in the templates directory. These templates are standard 
Jinja2 templates. Jinja2 is a full featured template engine for Python, and its documentation can be found at 
http://jinja.pocoo.org/docs/templates/

So by editing those files in the templates directory you can customize the display however you want. If you (or anybody else) wants to do this for 7" displays or any other size display, and create a pull request for them then I'd be more than happy to include them here so other folks can make use of them as well.

skir0cket commented 3 years ago

ok great ill look into it thanks, also just a quick one the touchscreen has stopped working but only when in CLI mode desktop works fine, how can I unstall phad so I can reinstall again?

bpennypacker commented 3 years ago

The simple installer script just looks for the term phad to exist in your ~/.bashrc file. So if you want to reinstall it that way then edit that file and remove the block of code at the bottom that looks something like this:

if [ "$TERM" == "linux" ] ; then
  cd /home/pi/phad
  while :
  do
    ./phad -s 30 2>/dev/null
    sleep 10
  done
fi

If you really wan to play it safe then delete the entire phad directory as well (rm -rf /home/pi/phad should do it). After that the installer script should reinstall everything without any problems.