Advertisement
TVT618

[Linux] Kali-Pi - Sticky Finger's Kali Pi launcher

Mar 15th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. [Linux]
  2. Kali-Pi - Sticky Finger's Kali Pi launcher
  3.  
  4. KALI-PI Launcher
  5. Simple touch menu for Raspberry Pi projects using a 3.5" (480x320) or 2.8" (320x240) touch screen based on garthvh's original project.
  6. Thanks to JPearn for porting it to 2.8" and to ArmyGuy255a for cleaning up the code and improving the layout.
  7. It runs as a python script in the framebuffer without needing a desktop environment.
  8. This menu is the default launcher in Sticky Finger's Kali Pi: http://www.whitedome.com.au/kali-pi
  9. I was after an easy way to launch X Window on either the TFT screen or through HDMI without the need for massive reconfigurations. I came accross garthvh's project featured on Adafruit (https://blog.adafruit.com/2015/05/08/simple-pitft-touchpi-menu-system-piday-raspberrypi-raspberry_pi/) and used it as basis for this project.
  10.  
  11. Install and use
  12. git clone https://github.com/re4son/Kali-Pi
  13. cd Kali-Pi
  14. sudo ./menu
  15.  
  16. customise the file "menu" to match the path, define the screen size, etc.
  17. cusomise the scripts to suit your needs
  18.  
  19. Important: Pygame is broken on on Debian Jessie. I'll explain below how to fix it.
  20.  
  21. Layout
  22. Start Screen
  23. All functions are self explainatory. After exiting and application, the screen returns back to the last menu.
  24.  
  25. The "Screen Off" function launches the python script "menu_screenoff.py", which uses the RPi.GPIO module to turn the screen off. You can turn it back on by pressing anywhere on the screen.
  26.  
  27. Using the ">>>" button, we can scroll to the next screen, namely "menu_kali-2.py". The buttons allow us to stop and start services. The button changes to green when the service is running Press the button again to stop the service.
  28.  
  29. menu-pin.py: The variable "KPPIN" in the file ~/menu can be set to "1" to enable PIN authentication to hide the menus from spying eyes
  30.  
  31. Screensaver
  32. The screensaver can be enabled by setting the variable KPTIMEOUT in the file "./menu". Set it to the number of minutes after which the screensaver should kick in (very approximate value). Use 1 for 1 min, 0.5 for 30sec, etc. Touch anywhere on the screen to wake the system up. When KPPIN is set, the screen will return to the PIN menu after waking up.
  33.  
  34. Run menu at startup
  35. The preferred method to run this script on startup is to add it to the end of ".profile": nano ~/home/.profile
  36. And add the following line to the bottom of the file: sudo /home/pi/Kali-Pi/menu
  37.  
  38. Fix Pygame on Debian Jessie
  39. The package "libsdl1.2-15-10", which ships with Debian Jessie, breaks pygame. To make it work we have to revert back to "libsdl1.2-15-5" from Wheezy.
  40.  
  41. The quickest way is to comment everything out in your /etc/apt/sources.list and temporarily add:
  42. deb http://archive.raspbian.org/raspbian wheezy main contrib non-free
  43.  
  44. Import the corresponding keys:
  45. deb http://archive.raspbian.org/raspbian wheezy main contrib non-free
  46. gpg -a --export 9165938D90FDDD2E | sudo apt-key add -
  47.  
  48. Remove the offending package and replace it with the working one:
  49. sudo apt-get update
  50. sudo apt-get remove libsdl1.2debian python-pygame
  51. apt-get install libsdl-image1.2 libsdl-mixer1.2 libsdl-ttf2.0-0 libsdl1.2debian libsmpeg0 python-pygame
  52. sudo apt-mark hold libsdl1.2debian
  53.  
  54. Restore "/etc/apt/sources.list" to it's original state.
  55. That's it. Pygame is fixed :-)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement