Skip to content

Instantly share code, notes, and snippets.

@rdnlsmith
Last active November 10, 2023 14:35
Show Gist options
  • Save rdnlsmith/f1ccc0bddd3936edf2aceba2e20ae6f5 to your computer and use it in GitHub Desktop.
Save rdnlsmith/f1ccc0bddd3936edf2aceba2e20ae6f5 to your computer and use it in GitHub Desktop.
Launch PowerShell Core in a GNOME Terminal window with a PowerShell color theme

GNOME Terminal PowerShell Profile

Install PowerShell Core.

Create PowerShell profile

  1. In GNOME Terminal, create a new profilie from default settings.

  2. Copy the Profile ID from the lower left corner of the Text tab. Alternatively, obtain it through dconf.

  3. Save powershell-profile.dconf somewhere, then import it. Replace <profile id> with the ID from step 2:

    dconf load /org/gnome/terminal/legacy/profiles:/:<profile id>/ < powershell-profile.dconf

Customize the GNOME Terminal launcher

  1. Save org.gnome.Terminal.desktop to ~/.local/share/applications. This is a modified copy of the official .desktop file from /usr/share/applications.
  2. Restart your computer.
  3. Right-click the Terminal launcher icon. Beneath "New Window", there will now be a new action labeled "New PowerShell Window". This will open a GNOME Terminal window, themed to look like PowerShell, and present you with the PowerShell Core prompt.
[Desktop Entry]
Name=Terminal
Comment=Use the command line
Keywords=shell;prompt;command;commandline;cmd;
TryExec=gnome-terminal
Exec=gnome-terminal
Icon=utilities-terminal
Type=Application
X-GNOME-DocPath=gnome-terminal/index.html
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-terminal
X-GNOME-Bugzilla-Component=BugBuddyBugs
X-GNOME-Bugzilla-Version=3.30.1
Categories=GNOME;GTK;System;TerminalEmulator;
StartupNotify=true
X-GNOME-SingleWindow=false
OnlyShowIn=GNOME;Unity;
Actions=new-window;new-powershell-window;preferences;
X-Ubuntu-Gettext-Domain=gnome-terminal
[Desktop Action new-window]
Name=New Window
Exec=gnome-terminal --window
[Desktop Action new-powershell-window]
Name=New PowerShell Window
Exec=gnome-terminal --window-with-profile=powershell
[Desktop Action preferences]
Name=Preferences
Exec=gnome-terminal --preferences
[/]
foreground-color='rgb(255,255,255)'
visible-name='powershell'
palette=['rgb(0,0,0)', 'rgb(129,0,6)', 'rgb(0,127,28)', 'rgb(237,236,239)', 'rgb(0,13,125)', 'rgb(0,42,85)', 'rgb(0,128,127)', 'rgb(191,191,191)', 'rgb(127,127,127)', 'rgb(255,0,24)', 'rgb(0,255,56)', 'rgb(255,254,60)', 'rgb(0,33,250)', 'rgb(255,0,251)', 'rgb(0,255,254)', 'rgb(255,255,255)']
custom-command='pwsh'
default-size-columns=80
default-size-rows=24
use-system-font=true
use-custom-command=true
use-theme-colors=false
background-color='rgb(0,42,85)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment