Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
9b9ea1b9
Unverified
Commit
9b9ea1b9
authored
Sep 22, 2019
by
Steve Forget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring according to reviews
parent
aaf4a549
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
25 deletions
+16
-25
neofetch
neofetch
+16
-25
No files found.
neofetch
View file @
9b9ea1b9
...
@@ -3203,7 +3203,7 @@ END
...
@@ -3203,7 +3203,7 @@ END
[[ -z "$term_font" ]] && term_font="Monospace 12"
[[ -z "$term_font" ]] && term_font="Monospace 12"
;;
;;
"conemu-"
*)
conemu-
*)
local ce_arg_list
local ce_arg_list
local ce_arg_idx
local ce_arg_idx
local ce_conf
local ce_conf
...
@@ -3213,37 +3213,28 @@ END
...
@@ -3213,37 +3213,28 @@ END
for ce_arg_idx in "${!ce_arg_list[@]}"; do
for ce_arg_idx in "${!ce_arg_list[@]}"; do
# Search for "-LoadCfgFile" arg
# Search for "-LoadCfgFile" arg
[[ "${ce_arg_list[$ce_arg_idx]}" != -LoadCfgFile ]] && continue
[[ "${ce_arg_list[$ce_arg_idx]}" == -LoadCfgFile ]] && {
# Conf path is the next arg
# Conf path is the next arg
ce_conf=${ce_arg_list[++ce_arg_idx]}
((++ce_arg_idx))
break
ce_conf="${ce_arg_list[$ce_arg_idx]}"
}
break
done
done
# https://conemu.github.io/en/ConEmuXml.html#search-sequence
# https://conemu.github.io/en/ConEmuXml.html#search-sequence
local ce_seq=(
for ce_conf in "$ce_conf" "${ConEmuDir-}\ConEmu.xml" "${ConEmuDir-}\.ConEmu.xml" \
"$ce_conf"
"${ConEmuBaseDir-}\ConEmu.xml" "${ConEmuBaseDir-}\.ConEmu.xml" \
"$ConEmuDir\ConEmu.xml"
"$APPDATA\ConEmu.xml" "$APPDATA\.ConEmu.xml"; do
"$ConEmuDir\.ConEmu.xml"
"$ConEmuBaseDir\ConEmu.xml"
"$ConEmuBaseDir\.ConEmu.xml"
"$APPDATA\ConEmu.xml"
"$APPDATA\.ConEmu.xml"
)
for ce_conf in "${ce_seq[@]}"; do
# Search for first conf file available
# Search for first conf file available
[[
! -f "$ce_conf" ]] && continue
[[
-f "$ce_conf" ]] && {
# Very basic XML parsing
# Very basic XML parsing
term_font="$(awk '/name="FontName"/ && match($0, /data="([^"]*)"/) {
term_font="$(awk '/name="FontName"/ && match($0, /data="([^"]*)"/) \
print substr($0, RSTART+6, RLENGTH-7)}' "$ce_conf")"
{print substr($0, RSTART+6, RLENGTH-7)}' "$ce_conf")"
break
break
}
done
done
# Null-terminated contents in /proc/registry files triggers a Bash warning
# Null-terminated contents in /proc/registry files triggers a Bash warning
[[
-z "$term_font" ]] &&
read -r term_font < \
[[
"$term_font" ]] ||
read -r term_font < \
/proc/registry/HKEY_CURRENT_USER/Software/ConEmu/.Vanilla/FontName
/proc/registry/HKEY_CURRENT_USER/Software/ConEmu/.Vanilla/FontName
;;
;;
esac
esac
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment