|
9 years ago -1 |
This is my first Linux tutorial (and one of my first bash scripts!) so I thought I'd keep it simple.
I like to autohide my Cinnamon panel to free up screen space and help me focus on the active application window. (I also use maximus to hide window titlebars.) However, I prefer to use the mouse as little as possible, so having to move the mouse cursor to the top of the screen every time I want to check the time—or I forget which applications I have open!—is a real pain.
To solve this problem I wrote a simple little script to toggle the value of the /org/cinnamon/panel-autohide flag, which as you might guess sets whether the panel will autohide or remain at the top of the screen.
To use this script you must have dconf-cli installed on your system (I'm pretty sure it should be by default).
#!/bin/bash
# get state of panel-autohide
state=`dconf read /org/cinnamon/panel-autohide`
# if autohide on, turn it off and vice versa
if [ $state = "true" ]; then
dconf write /org/cinnamon/panel-autohide false
else
dconf write /org/cinnamon/panel-autohide true
fi
#!/bin/bash
# get state of panel-autohide
state=`dconf read /org/cinnamon/panel-autohide`
# if autohide on, turn it off and vice versa
if [ $state = "true" ]; then
dconf write /org/cinnamon/panel-autohide false
else
dconf write /org/cinnamon/panel-autohide true
fi
#!/bin/bash
# get state of panel-autohide
state=`dconf read /org/cinnamon/panel-autohide`
# if autohide on, turn it off and vice versa
if [ $state = "true" ]; then
dconf write /org/cinnamon/panel-autohide false
else
dconf write /org/cinnamon/panel-autohide true
fi
#!/bin/bash
# get state of panel-autohide
state=`dconf read /org/cinnamon/panel-autohide`
# if autohide on, turn it off and vice versa
if [ $state = "true" ]; then
dconf write /org/cinnamon/panel-autohide false
else
dconf write /org/cinnamon/panel-autohide true
fi
@remoulder .... ts, ts, ts
By storing your scripts in ~/bin, you wouldn’t need to enter the path because that’s the standard location in Debian-Ubuntu-Mint for executables in a user’s home directory.
The tutorial strictly refers to Cinnamon, hence there is always a built-in keyboard shortcut facility ;-)
@remoulder: What has the tutorial above to do with actions ? It just explains how to display the panel in Cinnamon by just a keypress.
A tutorial explains how to perform an action, please use the forums to discuss scripting