summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLatif Sulistyo2022-10-01 11:09:28 +0700
committerLatif Sulistyo2022-10-01 11:09:28 +0700
commitb6a887f39cdbe77be4f5629415f913d229b7f0af (patch)
tree9d687612b6b8920568ecfbad0aca18917d3ee595
downloadaur-b6a887f39cdbe77be4f5629415f913d229b7f0af.tar.gz
feat: initial commit
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD43
-rw-r--r--_papirus-folders56
-rw-r--r--papirus-folders75
-rw-r--r--papirus-folders.hook11
5 files changed, 207 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..428d8892be23
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = papirus-folders-catppuccin-git
+ pkgdesc = Soothing pastel theme for Papirus Icon Theme folders
+ pkgver = r19.5b1e93fa
+ pkgrel = 1
+ url = https://github.com/catppuccin/papirus-folders
+ arch = any
+ license = MIT
+ makedepends = git
+ depends = papirus-icon-theme
+ provides = papirus-folders
+ conflicts = papirus-folders
+ options = !strip
+ source = papirus-folders-catppuccin-git::git+https://github.com/catppuccin/papirus-folders.git
+ source = papirus-folders.hook
+ source = _papirus-folders
+ source = papirus-folders
+ md5sums = SKIP
+ md5sums = 181116893c90218ac0be9de66009b249
+ md5sums = 11377cc7005e1457042af56b1611a8c4
+ md5sums = 47cf0a071bfd2977e4db36998fbadbce
+
+pkgname = papirus-folders-catppuccin-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..16398ae170c6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Latif Sulistyo <latipun@aur.archlinux.org>
+
+# shellcheck disable=2034,2154
+# shellcheck shell=bash
+
+pkgname=papirus-folders-catppuccin-git
+pkgver=r19.5b1e93fa
+pkgrel=1
+pkgdesc="Soothing pastel theme for Papirus Icon Theme folders"
+arch=("any")
+url="https://github.com/catppuccin/papirus-folders"
+license=("MIT")
+depends=('papirus-icon-theme')
+makedepends=('git')
+options=('!strip')
+provides=("papirus-folders")
+conflicts=("papirus-folders")
+source=("$pkgname::git+$url.git"
+ "papirus-folders.hook"
+ "_papirus-folders"
+ "papirus-folders")
+md5sums=('SKIP'
+ '181116893c90218ac0be9de66009b249'
+ '11377cc7005e1457042af56b1611a8c4'
+ '47cf0a071bfd2977e4db36998fbadbce')
+
+pkgver() {
+ cd "$srcdir/$pkgname" || exit 1
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+package() {
+ cd "$pkgname" || exit 1
+ install -dm755 "$pkgdir/usr/share/icons/Papirus"
+ cp -r src/* "$pkgdir/usr/share/icons/Papirus"
+
+ install -Dm755 papirus-folders -t "$pkgdir/usr/bin"
+ install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/${pkgname}"
+ install -Dm644 ../papirus-folders.hook -t "$pkgdir/usr/share/libalpm/hooks"
+
+ install -Dm644 ../papirus-folders -t "$pkgdir/usr/share/bash-completion/completions"
+ install -Dm644 ../_papirus-folders -t "$pkgdir/usr/share/zsh/site-functions"
+}
diff --git a/_papirus-folders b/_papirus-folders
new file mode 100644
index 000000000000..93ae3baafdef
--- /dev/null
+++ b/_papirus-folders
@@ -0,0 +1,56 @@
+#compdef papirus-folders
+#
+# @author: Sergei Eremenko (https://github.com/SmartFinn)
+# @license: MIT license (MIT)
+# @link: https://github.com/PapirusDevelopmentTeam/papirus-folders
+
+_get_colors() {
+ if ! command -v papirus-folders >/dev/null; then
+ _message "unable to find papirus-folders script"
+ return 1
+ fi
+
+ local -a colors=( $(papirus-folders -l | tr -d '>\n') )
+ _wanted colors exlp 'color' compadd -- "${colors[@]}"
+ return 0
+}
+
+_get_themes() {
+ local data_dir icons_dir icon_theme
+ local -a data_dirs=()
+ local -a icons_dirs=(
+ "$HOME/.icons"
+ "${XDG_DATA_HOME:-$HOME/.local/share}/icons"
+ )
+
+ # Get data directories from XDG_DATA_DIRS variable and
+ # convert colon-separated list into bash array
+ IFS=: read -rA data_dirs <<< "${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
+
+ for data_dir in "${data_dirs[@]}"; do
+ [ -d "$data_dir/icons" ] || continue
+ icons_dirs=( "${icons_dirs[@]}" "${data_dir:a}/icons" )
+ done
+
+ for icons_dir in "${icons_dirs[@]}"; do
+ for icon_theme in "$icons_dir"/*; do
+ [ -f "$icon_theme/48x48/places/folder-blue.svg" ] || continue
+ _wanted icon_theme expl 'icon-theme' compadd -- "${icon_theme:t}"
+ done
+ done
+ return 0
+}
+
+_arguments -C \
+ '(-h --help)'{-h,--help}'[show help message and exit]' \
+ '(-V --version)'{-V,--version}'[show version number and exit]' \
+ '(-v --verbose)'{-v,--verbose}'[be verbose]' \
+ '(-C --color)'{-C,--color}'[change color of folders]:color:_get_colors' \
+ '(-D --default)'{-D,--default}'[back to the default color]' \
+ '(-R --restore)'{-R,--restore}'[restore the last used color from the config file]' \
+ '(-l --list)'{-l,--list}'[show available colors]' \
+ '(-o --once)'{-o,--once}'[do not save the changes to the config file]' \
+ '(-t --theme)'{-t,--theme}'[make changes to the specified theme]:icon-theme:_get_themes' \
+ '(-u --update-caches)'{-u,--update-caches}'[update icon caches]'
+
+# vim: ft=zsh sw=4 ts=4
diff --git a/papirus-folders b/papirus-folders
new file mode 100644
index 000000000000..3be49b15bd28
--- /dev/null
+++ b/papirus-folders
@@ -0,0 +1,75 @@
+# papirus-folders completion
+#
+# @author: Sergei Eremenko (https://github.com/SmartFinn)
+# @license: MIT license (MIT)
+# @link: https://github.com/PapirusDevelopmentTeam/papirus-folders
+
+__get_colors() {
+ if ! command -v papirus-folders >/dev/null; then
+ return 1
+ fi
+
+ papirus-folders -l | tr -d '>\n'
+}
+
+__get_themes() {
+ local data_dir icons_dir icon_theme
+ local -a data_dirs=()
+ local -a icons_dirs=(
+ "$HOME/.icons"
+ "${XDG_DATA_HOME:-$HOME/.local/share}/icons"
+ )
+
+ # Get data directories from XDG_DATA_DIRS variable and
+ # convert colon-separated list into bash array
+ IFS=: read -ra data_dirs <<< "${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
+
+ for data_dir in "${data_dirs[@]}"; do
+ [ -d "$data_dir/icons" ] || continue
+ icons_dirs=( "${icons_dirs[@]}" "${data_dir%/}/icons" )
+ done
+
+ for icons_dir in "${icons_dirs[@]}"; do
+ for icon_theme in "$icons_dir"/*; do
+ [ -f "$icon_theme/48x48/places/folder-blue.svg" ] || continue
+ printf '%s\n' "${icon_theme##*/}"
+ done
+ done
+ return
+}
+
+_papirus_folders() {
+ local cur prev
+ local -a colors=( $(__get_colors) )
+ local -a opts=(
+ -h --help
+ -V --version
+ -v --verbose
+ -C --color
+ -D --default
+ -R --restore
+ -l --list
+ -o --once
+ -t --theme
+ -u --update-caches
+ )
+
+ _get_comp_words_by_ref cur prev
+
+ case "$prev" in
+ -C|--color)
+ COMPREPLY=( $(compgen -W "${colors[*]}" -- "${cur}") )
+ return
+ ;;
+ -t|--theme)
+ COMPREPLY=( $(compgen -W "$(__get_themes)" -- "${cur}") )
+ ;;
+ *)
+ COMPREPLY=( $(compgen -W "${opts[*]}" -- "${cur}") )
+ ;;
+ esac
+}
+
+complete -F _papirus_folders papirus-folders
+
+# ex: ts=4 sw=4 filetype=sh
diff --git a/papirus-folders.hook b/papirus-folders.hook
new file mode 100644
index 000000000000..c6a610d36837
--- /dev/null
+++ b/papirus-folders.hook
@@ -0,0 +1,11 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Target = papirus-icon-theme
+Type = Package
+
+[Action]
+Depends = papirus-folders
+Description = Restoring the last used color of the folders...
+Exec = /usr/bin/papirus-folders -Ru
+When = PostTransaction