Skip to content

Commit 185045e

Browse files
committed
Update
1 parent 8afa09f commit 185045e

File tree

6 files changed

+28
-16
lines changed

6 files changed

+28
-16
lines changed

.local/bin/firefox-sync

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/bin/bash
22

33
launchctl=no
4+
ramsize=512
5+
ramon=no
46

57
[ $# -eq 0 ] && exit 1
68
[ $# -gt 1 ] && launchctl=$2
9+
[ $# -gt 2 ] && ramsize=$3 && ramon=yes
710

811
link=$1
912
static=static-$1
@@ -13,24 +16,27 @@ IFS=
1316
set -efu
1417

1518
if [ "$launchctl" = "yes" ]; then
16-
ffox=`ps ax | grep -i firefox.app/contents/macos/firefox | grep -v grep`
17-
[ "$ffox" = "" ] && exit # Firefox is not running
19+
if [ ! -d "/Volumes/RAM" ] && [ "$ramon" = "yes" ]; then
20+
$HOME/.local/bin/ramdisk $ramsize
21+
else
22+
ffox=`ps ax | grep -i firefox.app/contents/macos/firefox | grep -v grep | cat`
23+
[ "$ffox" = "" ] && exit # Firefox is not running
24+
fi
1825
fi
1926

2027
# RAM disk is not available
21-
[ ! -d "/Volumes/RAM" ] && exit
28+
[ ! -d "/Volumes/RAM" ] && exit 1
2229

2330
# Profile is not available
2431
if [ ! -d "$HOME/Library/Application Support/Firefox/Profiles/$link" ]; then
25-
[ ! -L "$HOME/Library/Application Support/Firefox/Profiles/$link" ] && exit
32+
[ ! -L "$HOME/Library/Application Support/Firefox/Profiles/$link" ] && exit 1
2633
fi
2734

2835
# Acquire lock
2936
if { set -C; 2>/dev/null > "$volatile.lock"; }; then
3037
trap "rm -f \"$volatile.lock\"" EXIT
3138
else
32-
# Lock exists
33-
exit
39+
exit # Lock exists
3440
fi
3541

3642
cd "$HOME/Library/Application Support/Firefox/Profiles"

.local/bin/wallpaper

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ cd /
99

1010
function try_set_wall()
1111
{
12-
wall=`COLUMNS=1 ls $HOME/Pictures/Wallpapers/Time\ of\ Day | grep "^$1\."`
13-
if [ -f "$HOME/Pictures/Wallpapers/Time of Day/$wall" ]; then
14-
"$cmd" "$HOME/Pictures/Wallpapers/Time of Day/$wall"
12+
wall=`COLUMNS=1 ls $HOME/Pictures/Wallpapers/Dynamic | grep "^$1\."`
13+
if [ -f "$HOME/Pictures/Wallpapers/Dynamic/$wall" ]; then
14+
"$cmd" "$HOME/Pictures/Wallpapers/Dynamic/$wall"
1515
return 1
1616
fi
1717
return 0
1818
}
1919

20-
if [ "$wall" == "--timeofday" ]; then
21-
if [ ! -d "$HOME/Pictures/Wallpapers/Time of Day" ]; then
20+
if [ "$wall" == "--dynamic" ]; then
21+
if [ ! -d "$HOME/Pictures/Wallpapers/Dynamic" ]; then
2222
echo "Time-based wallpaper selection is not available"
2323
exit 1
2424
fi
@@ -45,4 +45,9 @@ if [ ! -f "$wall" ]; then
4545
exit 1
4646
fi
4747

48-
osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \"$wall\""
48+
which ChangeMenuBarColor > /dev/null 2>&1
49+
if [ $? -eq 0 ] && false; then
50+
ChangeMenuBarColor SolidColor '#ececec' "$wall"
51+
else
52+
osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \"$wall\""
53+
fi

.local/bin/zipit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ if [ -f "$outpath$out" ]; then
5959
fi
6060
fi
6161

62+
printf -v IFS "\n"
6263
pushd "$path" > /dev/null
6364
for i in $base; do
6465
echo $i

Firefox/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## about:config tweaks
44

5-
Increase the amount of RAM used for caching:
5+
Set the amount of RAM used for caching:
66

77
| browser.cache.memory.capacity | 128
88
| - | -

Library/LaunchAgents/dynamic_wallpaper.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>ProgramArguments</key>
88
<array>
99
<string>/Users/user/.local/bin/wallpaper</string>
10-
<string>--timeofday</string>
10+
<string>--dynamic</string>
1111
</array>
1212
<key>StartInterval</key>
1313
<integer>1800</integer>

Scripts/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ Disable the menu bar Spotlight icon on Catalina and earlier:
232232

233233
```bash
234234
sudo mount -uw / # If on Catalina
235-
sudo chmod -x /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
235+
sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
236236
```
237237

238-
(Reboot is required.)
238+
A reboot is required. Note that it will also disable the search functionality in Finder too. So it’s only useful if you want to replace the built-in search functionality with a third-party app, like **EasyFind**.
239239

240240
On Big Sur and later the Spotlight icon can be easily hidden in Dock & Menu Bar preferences.
241241

0 commit comments

Comments
 (0)