Skip to content

Instantly share code, notes, and snippets.

@thebashpotato
Created September 12, 2020 17:17
Show Gist options
  • Save thebashpotato/52e35d9789d26eac3fe9cfa3edd827f0 to your computer and use it in GitHub Desktop.
Save thebashpotato/52e35d9789d26eac3fe9cfa3edd827f0 to your computer and use it in GitHub Desktop.
How to run autostart scripts on Gnome

Auto start

All these files can be found in my dotfile repo

# First we must create the script we want to execute
# scripts should be stored in your $HOME/.local/bin

# The code below is called 'essentials' in my repo

#!/bin/sh

# Execute essential script commands for startup

# speed up the x server
xset r rate 300 50 &


# make CapsLock behave like Ctrl:
setxkbmap -option ctrl:nocaps

# make short-pressed Ctrl behave like Escape:
# Default timeout is 500ms
xcape -t 300 -e 'Control_L=Escape'

Now make a .desktop file in $HOME/.config/autostart

# name: startup-scripts.desktop
# Remember to change your path to match your system
# .desktop files are just .ini files, you cannot use env variables
# everything in config files is unfortunetely "hardcoded"


[Desktop Entry]
Type=Application
Name=Essentials
Comment="important start up script"
Exec="/home/matt/.local/bin/essentials"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
@LinuxIsCool
Copy link

Super useful! Thanks Matt!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment