mirror of
				https://codeberg.org/claui/mobile-config-firefox.git
				synced 2025-11-04 04:25:55 +00:00 
			
		
		
		
	mobile-config-firefox: create userChrome.css symlink
This commit is contained in:
		
							parent
							
								
									016a9bb845
								
							
						
					
					
						commit
						87d4ae0ca3
					
				
					 3 changed files with 46 additions and 2 deletions
				
			
		
							
								
								
									
										8
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										8
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -18,14 +18,18 @@ out/home.html: src/homepage/*.html out
 | 
			
		|||
out/userChrome.css: out src/userChrome/*.css
 | 
			
		||||
	( cd src/userChrome; cat $(USERCHROME_FILES) ) > $@
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
install: all
 | 
			
		||||
	install -Dm644 src/policies.json \
 | 
			
		||||
		"$(DESTDIR)/etc/firefox/policies/policies.json"
 | 
			
		||||
	install -Dm644 out/prefs.js \
 | 
			
		||||
	install -Dm644 src/prefs.js \
 | 
			
		||||
		"$(DESTDIR)/usr/lib/firefox/defaults/pref/mobile-config.js"
 | 
			
		||||
	install -Dm644 "out/home.html" \
 | 
			
		||||
		"$(DESTDIR)/usr/share/mobile-config-firefox/home.html"
 | 
			
		||||
	install -Dm644 "out/userChrome.css" \
 | 
			
		||||
		"$(DESTDIR)/etc/mobile-config-firefox/userChrome.css"
 | 
			
		||||
	install -Dm755 "src/mobile-config-firefox.sh" \
 | 
			
		||||
		"$(DESTDIR)/usr/bin/mobile-config-firefox"
 | 
			
		||||
	install -Dm644 "src/mobile-config-firefox.desktop" \
 | 
			
		||||
		"$(DESTDIR)/usr/mobile-config/applications/org.mozilla.firefox.desktop"
 | 
			
		||||
 | 
			
		||||
.PHONY: all clean install
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										11
									
								
								src/mobile-config-firefox.desktop
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/mobile-config-firefox.desktop
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
[Desktop Entry]
 | 
			
		||||
Exec=mobile-config-firefox %u
 | 
			
		||||
Icon=firefox
 | 
			
		||||
Type=Application
 | 
			
		||||
Terminal=false
 | 
			
		||||
Name=Firefox
 | 
			
		||||
GenericName=Web Browser
 | 
			
		||||
MimeType=text/html;
 | 
			
		||||
StartupNotify=true
 | 
			
		||||
Categories=Network;WebBrowser;
 | 
			
		||||
StartupWMClass=firefox
 | 
			
		||||
							
								
								
									
										29
									
								
								src/mobile-config-firefox.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								src/mobile-config-firefox.sh
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
# Create chrome/userChrome.css symlink in a firefox profile dir
 | 
			
		||||
# $1: path to profile dir, e.g. "/home/user/.mozilla/firefox/asdf.default"
 | 
			
		||||
prepare_profile() {
 | 
			
		||||
	mkdir -p "$1/chrome"
 | 
			
		||||
	if ! [ -e "$1/chrome/userChrome.css" ]; then
 | 
			
		||||
		ln -sv /etc/mobile-config-firefox/userChrome.css \
 | 
			
		||||
			"$1/chrome/userChrome.css"
 | 
			
		||||
	fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
profile_found=false
 | 
			
		||||
for profiledir in ~/.mozilla/firefox/*/; do
 | 
			
		||||
	if ! [ -e "$profiledir/prefs.js" ]; then
 | 
			
		||||
		continue
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	prepare_profile "$profiledir"
 | 
			
		||||
	profile_found=true
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
if [ "$profile_found" = "true" ]; then
 | 
			
		||||
	exec firefox "$@"
 | 
			
		||||
else
 | 
			
		||||
	profiledir=~/.mozilla/firefox/firefox.default
 | 
			
		||||
	prepare_profile "$profiledir"
 | 
			
		||||
	exec firefox --profile "$profiledir" "$@"
 | 
			
		||||
fi
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue