-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_xcursor.sh
More file actions
executable file
·73 lines (65 loc) · 1.49 KB
/
install_xcursor.sh
File metadata and controls
executable file
·73 lines (65 loc) · 1.49 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# install the XCursor theme
# https://github.com/ful1e5/XCursor-pro
# and swap some icons
# requires `go-yq`
set -e
icondir="/usr/share/icons"
repo=ful1e5/XCursor-pro
theme=XCursor-Pro-Dark
temp_dir=$(mktemp -d)
pushd "$temp_dir"
echo "fetching latest release…"
latest=$(curl -SsfL \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$repo/releases/latest | yq .tag_name)
echo "downloading $theme $latest…"
curl -fLO -# https://github.com/$repo/releases/download/"$latest/$theme".tar.xz
echo "extracting…"
tar -xvf $theme.tar.xz
echo "patching cursors…"
pushd "$theme/cursors"
rm "fleur"
# replace the <^v> cursor with the closed hand (grabbing)
ln -s "move" "fleur"
# replace double arrow bar <|> with simple double arrow <->
h_icons=(
'sb_h_double_arrow'
'h_double_arrow'
'col-resize'
'ew-resize'
'size-hor'
'size_hor'
'split_h'
)
# same for vertical arrows
v_icons=(
'sb_v_double_arrow'
'v_double_arrow'
'row-resize'
'ns-resize'
'size-ver'
'size_ver'
'split_v'
'double_arrow'
)
for icon in "${h_icons[@]}"; do
rm "$icon"
ln -s "left_side" "$icon"
done
for icon in "${v_icons[@]}"; do
rm "$icon"
ln -s "top_side" "$icon"
done
popd
if [ -d "$icondir/$theme" ]; then
echo "removing $icondir/$theme"
sudo rm -rf "$icondir/${theme:?}"
fi
echo "installing $theme to $icondir"
sudo mv "$theme" "$icondir/$theme"
popd
rm -rf "$temp_dir"
echo "installed to $icondir/$theme"
echo "✓ DONE"