mirror of
https://github.com/captn3m0/dotfiles.git
synced 2024-09-27 19:22:50 +00:00
[display] Adds toggle option to my display script
This commit is contained in:
parent
0229ee6589
commit
dad226f547
@ -363,13 +363,31 @@ xset -b
|
||||
|
||||
# Overrides the display provided by imagemagick
|
||||
function display() {
|
||||
`cd ~/.screenlayout && sh $1.sh`
|
||||
# Write the current layout
|
||||
echo $1 > ~/.screenlayout/current
|
||||
if [[ -e "~/Pictures/$1.jpg" ]]; then
|
||||
(cd ~/Pictures && cp "$1.jpg" "./xin_1.jpg")
|
||||
layout="$1"
|
||||
if [[ "$1" == "toggle" ]]; then
|
||||
# exchange it
|
||||
CURRENT=$(cat ~/.screenlayout/current)
|
||||
echo "current=$CURRENT"
|
||||
case "$CURRENT" in
|
||||
"office")
|
||||
layout="single"
|
||||
;;
|
||||
"single")
|
||||
layout="office"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
echo "layout=$layout"
|
||||
if [[ -a ~/.screenlayout/$layout.sh ]]; then
|
||||
`cd ~/.screenlayout && sh $layout.sh`
|
||||
# Write the current layout
|
||||
echo $layout > ~/.screenlayout/current
|
||||
if [[ -e "~/Pictures/$layout.jpg" ]]; then
|
||||
(cd ~/Pictures && cp "$layout.jpg" "./xin_1.jpg")
|
||||
fi
|
||||
nitrogen --restore >/dev/null 2>&1
|
||||
i3-msg reload
|
||||
fi
|
||||
nitrogen --restore
|
||||
}
|
||||
|
||||
#SCM Breeze
|
||||
|
Loading…
Reference in New Issue
Block a user