forked from SergKolo/sergrep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunity_launcher_rainbow.sh
executable file
·48 lines (47 loc) · 1.53 KB
/
unity_launcher_rainbow.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
#
###########################################################
# Author: Serg Kolo , contact: 1047481448@qq.com
# Date: March 20,2016
# Purpose: Color changer script for Ubuntu Unity launcher
# Written for:
# Tested on: Ubuntu 14.04
###########################################################
# Copyright: Serg Kolo , 2016
#
# Permission to use, copy, modify, and distribute this software is hereby granted
# without fee, provided that the copyright notice above and this permission statement
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
ARGV0="$0"
ARGC=$#
main()
{
renice -n 10 $$ > /dev/null
num=0;
while true
do
set_unity_launcher_color $(printf '%6.6xff' $num)
num=$(($num+510))
if [ $num -eq 16777215 ]
then num=0
fi
sleep 0.05
done
}
set_unity_launcher_color()
{
schema="org.compiz.unityshell" # relocatable schema
path="/org/compiz/profiles/unity/plugins/unityshell/" #must end with /
key="background-color"
hex_string=$1
gsettings set "$schema":"$path" "$key" "'#$hex_string'"
}
main