diff --git a/ui/desktop/electron-app/assets/app-icons/icon.png b/ui/desktop/electron-app/assets/app-icons/icon.png new file mode 100644 index 000000000..9d162ec10 Binary files /dev/null and b/ui/desktop/electron-app/assets/app-icons/icon.png differ diff --git a/ui/desktop/electron-app/src/index.js b/ui/desktop/electron-app/src/index.js index 3f113cca2..66272336a 100644 --- a/ui/desktop/electron-app/src/index.js +++ b/ui/desktop/electron-app/src/index.js @@ -22,7 +22,7 @@ const sessionManager = require('./services/session-manager.js'); const menu = require('./config/menu.js'); const appUpdater = require('./helpers/app-updater.js'); -const { isMac } = require('./helpers/platform.js'); +const { isMac, isLinux } = require('./helpers/platform.js'); const isDev = require('electron-is-dev'); // Register the custom file protocol @@ -113,7 +113,7 @@ app.on('ready', async () => { } Menu.setApplicationMenu(menuTemplate); - mainWindow = new BrowserWindow({ + const browserWindowOptions = { width: 1280, height: 760, titleBarStyle: 'hiddenInset', @@ -131,7 +131,14 @@ app.on('ready', async () => { preload: preloadPath /* eng-disable PRELOAD_JS_CHECK */, disableBlinkFeatures: 'Auxclick', }, - }); + }; + + // To show app icon in toolbar in linux, set browser window icon. + // This is a limitation of electron build. + if (isLinux()) + browserWindowOptions.icon = path.join(__dirname, '..', 'assets', 'app-icons', 'icon.png'); + + mainWindow = new BrowserWindow(browserWindowOptions); // If the user-specified origin changes, reload the page so that // the CSP can be refreshed with the this source allowed diff --git a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile index 34fc0cf13..4c2c51616 100644 --- a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile +++ b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile @@ -35,6 +35,8 @@ Vagrant.configure("2") do |config| # Setup for testing desktop config.vm.provision "cli", type: "shell", inline: <<-SHELL # Install ubuntu desktop GUI + # For GNOME desktop: + # sudo apt install gnome-session gnome-terminal sudo apt-get install -y --no-install-recommends lubuntu-desktop # Setup boundary cli sudo apt-get install docker.io -y @@ -42,7 +44,7 @@ Vagrant.configure("2") do |config| sudo usermod -aG docker vagrant sudo apt-get install -y unzip curl https://releases.hashicorp.com/boundary/0.5.0/boundary_0.5.0_linux_amd64.zip -o boundary-cli.zip - unzip -o boundary-cli.zip -d /home/vagrant/desktop/ + unzip -o boundary-cli.zip -d /home/vagrant/Desktop/ # Setup localhost ssh yes | ssh-keygen -t rsa -N "" -f /home/vagrant/.ssh/id_rsa -C vagrant@ubuntu-focal cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys @@ -68,5 +70,5 @@ Vagrant.configure("2") do |config| yarn install SHELL - config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nBoundary Desktop Artifacts: /media/sf_vagrant-boundary-desktop-app.\nBoundary CLI: /home/vagrant/desktop/boundary." + config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nBoundary Desktop Artifacts: /media/sf_vagrant-boundary-desktop-app.\nBoundary CLI: /home/vagrant/Desktop/boundary." end diff --git a/ui/desktop/package.json b/ui/desktop/package.json index 13e2ed6db..aa4e59fa7 100755 --- a/ui/desktop/package.json +++ b/ui/desktop/package.json @@ -43,6 +43,7 @@ "cross-os": { "prebuild:desktop": { "darwin": "cp -r dist/ electron-app/ember-dist/", + "linux": "cp -r dist/ electron-app/ember-dist/", "win32": "(robocopy dist electron-app\\ember-dist /MIR) ^& exit 0" } },