Instructions to set up a basic LAMP+SSH server environment
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
4.0 KiB

5 years ago
  1. #!/bin/bash
  2. ######################################################
  3. # THIS SCRIPT DOWNLOADS AND COMPILES PROGRAM 'xcmenu' IN A DEBIAN SYSTEM
  4. #
  5. # THIS SCRIPT PRESENTS A METHOD OF TAKING A SCREENSHOT ON A LINUX DESKTOP
  6. # IN A SIMILAR WAY THAN ON MICROSOFT WINDOWS.
  7. ###############
  8. # This is a useful method for capturing screenshots on a X11 desktop
  9. # The main idea is to replicate Microsoft Windows behavior of taking screenshots
  10. # without any additional cumbersome client programs which are traditionally used on Linux desktops.
  11. #
  12. # Source code and build instructions (mainly for Arch Linux) of the command 'xclipshow' are available here:
  13. # https://github.com/Fincer/linux-patches-and-scripts/tree/master/xclipshow
  14. #
  15. # The code is originally presented in
  16. # https://unix.stackexchange.com/questions/163081/application-that-allows-to-show-clipboard-contents-and-its-mime-type/163115#163115
  17. #
  18. ###############
  19. #
  20. # 1. Run this script with 'bash compile-xcmenu.sh'
  21. # 2. Verify xcmenu installation by running 'dpkg --get-selections |grep xcmenu'
  22. # 3. You need imagemagick. Install it by running 'sudo apt-get install imagemagick'
  23. # 4. Copy the following command...
  24. # import -window root -screen /tmp/screen.png | xcmenu -bi image/png < /tmp/screen.png
  25. # ... and map a new shortcut key for it (such as printscreen key) on your preferred desktop environment.
  26. # 5. Compile 'xclipshow' by following the instructions given above and in this script below.
  27. # Additionally, You need 'cmake' and 'qt5-default' packages to compile the source code (not sure if other Qt5 packages are also required).
  28. #
  29. # 6. Map another shortcut key (such as Alt+V) for the chosen paint program (kolourpaint in this case).
  30. # Use the following command syntax for pasting shortcut:
  31. # bash -c "if [[ $(xclipshow |grep -c image/png) -eq 1 ]]; then kolourpaint /tmp/screen.png; fi"
  32. ###############
  33. # Personally, I have mapped print screen key to capture & save a screenshot, and Alt+V to open it into Kolourpaint on KDE 5 desktop.
  34. # Additionally, I have implemented a GUI nofitication for screenshots. Each time screenshot is saved in /tmp, the desktop reminds me about that.
  35. ######################################################
  36. # INSTRUCTIONS FOR COMPILING 'xcmenu' FROM SOURCE IN A DEBIAN SYSTEM
  37. ######################################################
  38. # Install necessary dependencies for the program
  39. sudo apt-get install zlib1g libxcb1 zlib1g-dev libxcb1-dev dh-make git make
  40. ######################################################
  41. # Go to $HOME, create subfolder 'xcmenu'
  42. # Clone source files from GitHub to $HOME/xcmenu/xcmenu-0.1.0 subfolder
  43. # Access xcmenu-0.1.0 subfolder
  44. cd && mkdir xcmenu
  45. cd xcmenu && git clone git://github.com/dindon-sournois/xcmenu.git xcmenu-0.1.0
  46. cd xcmenu-0.1.0
  47. ######################################################
  48. # Prepare compiling environment by generating 'debian' folder + contents
  49. dh_make --createorig -s -y
  50. ######################################################
  51. # Set build & runtime dependencies + build rule overrides
  52. # Build time dependencies
  53. sed -i 's/Build-Depends: debhelper (>=9)/Build-Depends: debhelper (>=9), make, zlib1g-dev, libxcb1-dev/g' debian/control
  54. # Runtime dependencies
  55. sed -i 's/Depends: ${shlibs:Depends}, ${misc:Depends}/Depends: gcc, zlib1g, libxcb1/g' debian/control
  56. # Program description
  57. sed -i 's/<insert up to 60 chars description>/lightweight clipboard manager for X/g' debian/control
  58. sed -i 's/ <insert long description, indented with spaces>/ ./g' debian/control
  59. # A build rule override
  60. echo 'override_dh_usrlocal:' | tee -a debian/rules
  61. ######################################################
  62. # Compile source files into a deb package without signatures
  63. dpkg-buildpackage -rfakeroot -b -us -uc
  64. ######################################################
  65. # Install compiled .deb package
  66. sudo dpkg -i ../xcmenu*.deb
  67. ######################################################
  68. # Remove build dependencies from the system as they are no longer needed
  69. sudo apt-get purge --remove zlib1g-dev libxcb1-dev