Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

askthedev.com Logo askthedev.com Logo
Sign InSign Up

askthedev.com

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Ubuntu
  • Python
  • JavaScript
  • Linux
  • Git
  • Windows
  • HTML
  • SQL
  • AWS
  • Docker
  • Kubernetes
Home/ Questions/Q 16914
Next
In Process

askthedev.com Latest Questions

Asked: September 27, 20242024-09-27T12:27:48+05:30 2024-09-27T12:27:48+05:30In: Ubuntu

How can I configure personalized keyboard shortcuts through the terminal in Ubuntu?

anonymous user

I’ve been trying to figure out how to set up my own keyboard shortcuts on Ubuntu, but I keep hitting dead ends. I know that personalized shortcuts can really speed things up, but the whole process feels super overwhelming. I’ve looked through some settings and manuals, but nothing seems to stick, and I don’t want to mess up my system.

So here’s where I’m at: I’ve seen that you can configure shortcuts directly through the GUI, but I want to go a more geeky route and tackle this through the terminal. I mean, it feels way cooler to do it that way, right? Plus, I’m sure there’s more flexibility, and I want to learn something new in the process.

I collect a few commands that I use all the time, like opening specific folders, launching my favorite applications quickly, or even more complex tasks like running scripts. It feels like there’s so much potential here!

What I’m struggling with is how to actually write and apply these custom shortcuts using the terminal. I’ve come across some commands and configurations that look like they might do the trick, but I’m not entirely sure how to put it all together without breaking something. I mean, I don’t want to end up in a situation where my key presses lead to chaos on my desktop, right?

So, if anyone has some insights or can point me in the right direction, that would be awesome. What commands should I be using, and what’s the best way to ensure they work seamlessly? Also, how can I test them without feeling like I’m about to crash my whole system? Any tips for someone who’s trying to dive into configuring keyboard shortcuts from the terminal would be super appreciated. Would love to hear your experiences or any guides you’ve found helpful! Thanks!

  • 0
  • 0
  • 2 2 Answers
  • 0 Followers
  • 0
Share
  • Facebook

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Continue with Google
    or use

    Forgot Password?

    Need An Account, Sign Up Here
    Continue with Google

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. anonymous user
      2024-09-27T12:27:50+05:30Added an answer on September 27, 2024 at 12:27 pm


      To set up custom keyboard shortcuts in Ubuntu via the terminal, you can use the gsettings command, which allows you to configure various desktop settings. The first step is to determine the name of the specific action you want to associate with a shortcut. For example, if you want to open the terminal with Ctrl + Alt + T, you would run the command:

      gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybinding:name 'Path'

      Replace name with your desired shortcut name and Path with the command you want to run, such as gnome-terminal. After creating your custom keybinding, you must set the actual shortcut key combination by running:

      gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybindings '[[name, Path, Shortcut]]'

      In this command, you’ll replace Shortcut with the key combination of your choice (in the format of 'T'). You can also check which current shortcuts exist with:

      gsettings get org.gnome.settings-daemon.plugins.media-keys

      This allows you to easily manage and edit existing shortcuts if necessary. To test them without causing chaos, you can simply open a terminal and run commands individually or use a test user account to ensure no negative impact on your main setup. Building shortcuts this way not only enhances your workflow but also deepens your understanding of the system!


        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. anonymous user
      2024-09-27T12:27:50+05:30Added an answer on September 27, 2024 at 12:27 pm






      Custom Keyboard Shortcuts on Ubuntu

      Alright, so diving into keyboard shortcuts on Ubuntu via the terminal is totally a neat way to go! Here’s a simple breakdown of how you can get started without messing up your system too much.

      Basic Steps to Set Custom Shortcuts:

      1. Open your terminal: Use Ctrl + Alt + T to quickly launch it.
      2. Find out where your shortcut configuration is: You can use the gsettings command to manage keyboard shortcuts. Run:
        gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys
        to get a list of current shortcuts.
      3. Create a new shortcut: To add a custom shortcut, you’ll want to use a command like this:
        gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybindings "['/path/to/your/shortcut']"
        Replace `/path/to/your/shortcut` with whatever command you want to execute.

      Example of Adding a Shortcut:

      Let’s say you want to open your Documents folder with Ctrl + D. You would do something like this:

                  
                  mkdir -p ~/.config/gnome-settings-daemon/plugins/media-keys/
                  echo "{ 'name':'Documents', 'command':'xdg-open ~/Documents', 'binding':'D' }" > ~/.config/gnome-settings-daemon/plugins/media-keys/custom_keybindings/90-documents.json
                  gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybindings custom-keybindings "['/home/your_username/.config/gnome-settings-daemon/plugins/media-keys/custom_keybindings/90-documents.json']"
                  
              

      Testing Your New Shortcuts:

      Once you set the shortcut, just press the keys you’ve assigned (like Ctrl + D) to see if it works. If it doesn’t do what you expect, double-check the commands and ensure they are correct. You can always remove a shortcut by using:

      gsettings reset org.gnome.settings-daemon.plugins.media-keys.custom-keybindings "/path/to/your/shortcut"

      Some Tips:

      • Start with simple tasks like opening folders or running a script you frequently use.
      • If you want to test a command before binding it to a shortcut, run it directly in the terminal first.
      • Keep a backup of your current settings just in case something doesn’t work out.

      Play around with it, and don’t be afraid to experiment. You can always revert back to defaults if needed. Good luck, and have fun customizing your shortcuts!


        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this issue?
    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?
    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. Has anyone experienced this issue ...
    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?
    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else encountered this problem, and what ...

    Sidebar

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this ...

    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?

    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. ...

    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?

    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else ...

    • How can I configure a server running Ubuntu to bind specific IP addresses to two different network interfaces? I'm looking for guidance on how to ...

    • Is it possible to configure automatic login on Ubuntu MATE 24.04?

    • After upgrading from Ubuntu Studio 22.04 to 24.04.1, I lost all audio functionality. What steps can I take to diagnose and resolve this issue?

    • I am experiencing issues booting Ubuntu 22.04 LTS from a live USB. Despite following the usual procedures, the system fails to start. What steps can ...

    • I'm encountering a problem with my Expandrive key while trying to update my Ubuntu system. Has anyone else faced similar issues, and if so, what ...

    Recent Answers

    1. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    2. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    3. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    4. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    5. anonymous user on How can I update the server about my hotbar changes in a FabricMC mod?
    • Home
    • Learn Something
    • Ask a Question
    • Answer Unanswered Questions
    • Privacy Policy
    • Terms & Conditions

    © askthedev ❤️ All Rights Reserved

    Explore

    • Ubuntu
    • Python
    • JavaScript
    • Linux
    • Git
    • Windows
    • HTML
    • SQL
    • AWS
    • Docker
    • Kubernetes

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.