i3-layout-loader 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/bash
  2. # This script loads saved layouts in i3.
  3. # This script hightly depends on personal preferences and
  4. # must be edited accordingly.
  5. # i3-layout-loader - Load i3 saved layouts
  6. # Copyright (C) 2017 Fabrizio Romano Genovese <egonigredo@gmail.com>
  7. # This copyrighted material is made available to anyone wishing to use,
  8. # modify, copy, or redistribute it subject to the terms and conditions of
  9. # the GNU General Public License v.2, or (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but WITHOUT
  12. # ANY WARRANTY expressed or implied, including the implied warranties of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  14. # Public License for more details.
  15. # You should have received a copy of the
  16. # GNU General Public License along with this program; if not,
  17. # see <http://www.gnu.org/licenses/>
  18. # Put this file in /bin/ or in /usr/bin. Do not forget to give
  19. # sudo chmod +x i3-layout-loader
  20. # to make it executable.
  21. version=1.0
  22. if [[ "$#" -ge 2 ]]; then
  23. echo "Usage: $0 {-v, --version | -h --help}"
  24. exit 2
  25. elif [[ $# -le 1 ]]; then
  26. case $1 in
  27. -v | --version)
  28. echo "$0 - Version $version"
  29. exit 0
  30. ;;
  31. -h | --help)
  32. echo " This script loads saved layouts in i3. It hightly depends on personal preferences and must be edited accordingly."
  33. echo "- v, --version Display current version"
  34. echo "-h, --help Display this message"
  35. echo "personal Load personal layout"
  36. echo "work Load work layout"
  37. echo "browsing Load browsing layout"
  38. echo "update Load update layout"
  39. exit 0
  40. ;;
  41. personal)
  42. i3-msg "workspace 1; append_layout ~/.config/i3/layouts/TildaFirefoxPersonal.json"
  43. qvm-run -q --tray -a personal -- 'qubes-desktop-run /usr/share/applications/firefox.desktop; qubes-desktop-run /usr/share/applications/tilda.desktop'
  44. ;;
  45. work)
  46. i3-msg "workspace 3; append_layout ~/.config/i3/layouts/FileManagerTerminalEditorWorkWorkPub.json"
  47. i3-msg "workspace 2; append_layout ~/.config/i3/layouts/TexstudioWorkWorkPub.json"
  48. qvm-run -q --tray -a work-pub -- 'qubes-desktop-run /usr/share/applications/org.gnome.Nautilus.desktop; qubes-desktop-run /usr/share/applications/org.gnome.Terminal.desktop; qubes-desktop-run /usr/share/applications/texstudio.desktop' &
  49. qvm-run -q --tray -a work -- 'qubes-desktop-run /usr/share/applications/org.gnome.Nautilus.desktop; qubes-desktop-run /usr/share/applications/org.gnome.Terminal.desktop; qubes-desktop-run /usr/share/applications/texstudio.desktop'
  50. ;;
  51. browsing)
  52. i3-msg "workspace 5; append_layout ~/.config/i3/layouts/Browsing.json"
  53. qvm-run -q --tray -a work-pub -- 'qubes-desktop-run /usr/share/applications/firefox.desktop' &
  54. qvm-run -q --tray -a untrusted -- 'qubes-desktop-run /usr/share/applications/firefox.desktop' &
  55. ;;
  56. update)
  57. i3-msg "workspace 10; append_layout ~/.config/i3/layouts/Update.json"
  58. (qvm-run -q --tray -a fedora-24-secure -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
  59. sleep 5
  60. (qvm-run -q --tray -a fedora-24-sys -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
  61. sleep 5
  62. (qvm-run -q --tray -a fedora-24-personal -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
  63. sleep 5
  64. (qvm-run -q --tray -a fedora-24-work -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
  65. sleep 5
  66. (qvm-run -q --tray -a fedora-24-untrusted -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI')&
  67. sleep 10
  68. (qvm-run -q --tray -a whonix-ws -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
  69. sleep 5
  70. (qvm-run -q --tray -a whonix-gw -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
  71. ;;
  72. *)
  73. echo "Usage: $0 {-v, --version|-h, --help|personal|work|browsing|update}"
  74. exit 2
  75. esac
  76. fi