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
|
# Overrides the display provided by imagemagick
|
||||||
function display() {
|
function display() {
|
||||||
`cd ~/.screenlayout && sh $1.sh`
|
layout="$1"
|
||||||
# Write the current layout
|
if [[ "$1" == "toggle" ]]; then
|
||||||
echo $1 > ~/.screenlayout/current
|
# exchange it
|
||||||
if [[ -e "~/Pictures/$1.jpg" ]]; then
|
CURRENT=$(cat ~/.screenlayout/current)
|
||||||
(cd ~/Pictures && cp "$1.jpg" "./xin_1.jpg")
|
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
|
fi
|
||||||
nitrogen --restore
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#SCM Breeze
|
#SCM Breeze
|
||||||
|
Loading…
Reference in New Issue
Block a user