[Share Experiences] 个性化随机启动器图标
Tofloor
poster avatar
caibh
deepin
2022-08-24 19:37
Author

看了 《我的Deepin变形记》/ 4.5.1 修改启动器图标 之后,知道可以修改启动器图标。

于是萌生一个想法:实现每次开机启动时候执行一个脚本替换启动器图标

脚本:

#!/bin/bash
# 随机变更系统启动器图标

iconDir=/home/caibh/cloud/disk/bin/launcher-icon/icons
destDir=/usr/share/icons/bloom/places

# 选取随机文件
randomIconFile=`/bin/ls -1 "$iconDir" | sort --random-sort | head -1`

# 获取随机文件的完整路径
randomIconPath=`readlink --canonicalize "$iconDir/$randomIconFile"`

# 复制到指定目录
for i in 16 24 32 48 64 96 128 256 512  
do
    echo "复制文件: ${randomIconPath} --> ${destDir}/$i/deepin-launcher.svg"
    cp "${randomIconPath}" "${destDir}/$i/deepin-launcher.svg"
done

然后还需要配置一下开机执行这个脚本,注意,图标复制到目标目录需要 root 权限,因为目标目录的归属人是 root。我目前测试过可以在 /etc/rc.local 中配置执行这个脚本,就可以在开机时候以 root 权限执行该脚本:

caibh@work:~$ cat /etc/rc.local
#!/bin/bash

# 随机更换启动器图标
/home/caibh/cloud/disk/bin/launcher-icon/random-launcher-icon.sh

exit 0

如果开机后没有替换到图标,可能是 rc.local 文件没有执行权限,记得加上:

sudo chmod 755 /etc/rc.local

需要事先下载好一些图标,我用一些水果图标:

image.png

下载链接:

https://www.iconfont.cn/collections/detail?spm=a313x.7781069.1998910419.dc64b3430&cid=10147

效果:

image.png

截图_选择区域_20220824121905.png

Reply Favorite View the author
All Replies
xuqi
deepin testing team
2022-08-24 19:43
#1

proud太有个性了~😂

Reply View the author
liwl
deepin
2022-08-24 19:46
#2

like

Reply View the author
caibh
deepin
2022-08-24 20:27
#3
liwl

like

《我的Deepin变形记》写得太好了!很详细!

Reply View the author
心平气和
deepin
2022-08-24 20:46
#4

可爱

Reply View the author
今风
deepin
2022-08-24 21:11
#5

收藏。。。

Reply View the author
liwl
deepin
2022-08-24 21:18
#6
caibh

《我的Deepin变形记》写得太好了!很详细!

其实还有一个一键变形的脚本,哈哈哈哈

joy

https://bbs.deepin.org/post/239037

Reply View the author
caibh
deepin
2022-08-24 21:39
#7
liwl

其实还有一个一键变形的脚本,哈哈哈哈

joy

https://bbs.deepin.org/post/239037

太牛了,可以 fork 你的仓库,搞个自己的定制脚本了,重装能省很多时间

Reply View the author
liwl
deepin
2022-08-24 21:44
#8
caibh

太牛了,可以 fork 你的仓库,搞个自己的定制脚本了,重装能省很多时间

好的,随便折腾吧

Reply View the author
sammy-621
deepin
2022-08-27 00:25
#9

非常有意思,非常有个性

Reply View the author
神末shenmo
Moderator
Spark-App
2022-08-27 16:51
#10

可以写成服务的形式哦!

这样更方便开关管理

Reply View the author
ljq790615
deepin
2022-08-27 17:43
#11

这都开始玩了,赞一个

Reply View the author
神末shenmo
Moderator
Spark-App
2022-08-27 18:03
#12

完善一下,打个包,可以分享出来了!

挺棒的

Reply View the author
la
deepin
2022-08-30 04:40
#13

我倒是想把启动器隐藏起来,可惜不是所有图标都能设置隐藏tail

Reply View the author
晚秋(lateautumn)
Moderator
2022-08-31 16:21
#14

坛子里真有高手呀!joy

Reply View the author