12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #!/bin/bash
- # This script loads saved layouts in i3.
- # This script hightly depends on personal preferences and
- # must be edited accordingly.
- # i3-layout-loader - Load i3 saved layouts
- # Copyright (C) 2017 Fabrizio Romano Genovese <egonigredo@gmail.com>
- # This copyrighted material is made available to anyone wishing to use,
- # modify, copy, or redistribute it subject to the terms and conditions of
- # the GNU General Public License v.2, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful, but WITHOUT
- # ANY WARRANTY expressed or implied, including the implied warranties of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- # Public License for more details.
- # You should have received a copy of the
- # GNU General Public License along with this program; if not,
- # see <http://www.gnu.org/licenses/>
- # Put this file in /bin/ or in /usr/bin. Do not forget to give
- # sudo chmod +x i3-layout-loader
- # to make it executable.
- version=1.0
- if [[ "$#" -ge 2 ]]; then
- echo "Usage: $0 {-v, --version | -h --help}"
- exit 2
- elif [[ $# -le 1 ]]; then
- case $1 in
- -v | --version)
- echo "$0 - Version $version"
- exit 0
- ;;
- -h | --help)
- echo " This script loads saved layouts in i3. It hightly depends on personal preferences and must be edited accordingly."
- echo "- v, --version Display current version"
- echo "-h, --help Display this message"
- echo "personal Load personal layout"
- echo "work Load work layout"
- echo "browsing Load browsing layout"
- echo "update Load update layout"
- exit 0
- ;;
- personal)
- i3-msg "workspace 1; append_layout ~/.config/i3/layouts/TildaFirefoxPersonal.json"
- qvm-run -q --tray -a personal -- 'qubes-desktop-run /usr/share/applications/firefox.desktop; qubes-desktop-run /usr/share/applications/tilda.desktop'
- ;;
- work)
- i3-msg "workspace 3; append_layout ~/.config/i3/layouts/FileManagerTerminalEditorWorkWorkPub.json"
- i3-msg "workspace 2; append_layout ~/.config/i3/layouts/TexstudioWorkWorkPub.json"
- 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' &
- 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'
- ;;
- browsing)
- i3-msg "workspace 5; append_layout ~/.config/i3/layouts/Browsing.json"
- qvm-run -q --tray -a work-pub -- 'qubes-desktop-run /usr/share/applications/firefox.desktop' &
- qvm-run -q --tray -a untrusted -- 'qubes-desktop-run /usr/share/applications/firefox.desktop' &
- ;;
- update)
- i3-msg "workspace 10; append_layout ~/.config/i3/layouts/Update.json"
- (qvm-run -q --tray -a fedora-24-secure -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
- sleep 5
- (qvm-run -q --tray -a fedora-24-sys -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
- sleep 5
- (qvm-run -q --tray -a fedora-24-personal -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
- sleep 5
- (qvm-run -q --tray -a fedora-24-work -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
- sleep 5
- (qvm-run -q --tray -a fedora-24-untrusted -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI')&
- sleep 10
- (qvm-run -q --tray -a whonix-ws -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
- sleep 5
- (qvm-run -q --tray -a whonix-gw -- 'bash /etc/qubes-rpc/qubes.InstallUpdatesGUI') &
- ;;
- *)
- echo "Usage: $0 {-v, --version|-h, --help|personal|work|browsing|update}"
- exit 2
- esac
- fi
|