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
569bef56
Commit
569bef56
authored
Mar 03, 2017
by
Dominik Ritter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix code style
parent
24283be0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
neofetch
neofetch
+11
-6
No files found.
neofetch
View file @
569bef56
...
@@ -1650,24 +1650,29 @@ get_term_font() {
...
@@ -1650,24 +1650,29 @@ get_term_font() {
# thou, but that does not match to a guid in the plist.
# thou, but that does not match to a guid in the plist.
# So, be warned! Collisions may occur!
# So, be warned! Collisions may occur!
# See: https://groups.google.com/forum/#!topic/iterm2-discuss/0tO3xZ4Zlwg
# See: https://groups.google.com/forum/#!topic/iterm2-discuss/0tO3xZ4Zlwg
local currentProfileName=
$(
osascript
-e
'tell application "iTerm2" to profile name of current session of current window'
)
local currentProfileName
currentProfileName=
$(
osascript
-e
'tell application "iTerm2" to profile name of current session of current window'
)
# Warning: Dynamic profiles are not taken into account here!
# Warning: Dynamic profiles are not taken into account here!
# https://www.iterm2.com/documentation-dynamic-profiles.html
# https://www.iterm2.com/documentation-dynamic-profiles.html
# Count Guids in "
New Bookmarks
"; they should be unique
# Count Guids in "
New Bookmarks
"; they should be unique
local profilesCount=
$(
/usr/libexec/PlistBuddy
-c
"Print :New
\
Bookmarks:"
~/Library/Preferences/com.googlecode.iterm2.plist 2>/dev/null |
grep
"Guid"
|
wc
-l
)
local profilesCount
for idx in
$(
seq
0
${
profilesCount
})
; do
profilesCount=
$(
/usr/libexec/PlistBuddy
-c
"Print :New
\
Bookmarks:"
~/Library/Preferences/com.googlecode.iterm2.plist 2>/dev/null |
grep
-c
"Guid"
)
local profileName=
$(
/usr/libexec/PlistBuddy
-c
"Print :New
\
Bookmarks:
${
idx
}
:Name:"
~/Library/Preferences/com.googlecode.iterm2.plist 2>/dev/null
)
for idx in
$(
seq
0
"
${
profilesCount
}
"
)
; do
local profileName
profileName=
$(
/usr/libexec/PlistBuddy
-c
"Print :New
\
Bookmarks:
${
idx
}
:Name:"
~/Library/Preferences/com.googlecode.iterm2.plist 2>/dev/null
)
if [[ "
${
profileName
}
" == "
${
currentProfileName
}
" ]]; then
if [[ "
${
profileName
}
" == "
${
currentProfileName
}
" ]]; then
# "
Normal Font
"
# "
Normal Font
"
term_font=
$(
/usr/libexec/PlistBuddy
-c
"Print :New
\
Bookmarks:
${
idx
}
:Normal
\
Font:"
~/Library/Preferences/com.googlecode.iterm2.plist
)
term_font=
$(
/usr/libexec/PlistBuddy
-c
"Print :New
\
Bookmarks:
${
idx
}
:Normal
\
Font:"
~/Library/Preferences/com.googlecode.iterm2.plist
)
# Font for non-ascii characters
# Font for non-ascii characters
# Only check for a different non-ascii font, if the user checked
# Only check for a different non-ascii font, if the user checked
# the "
use a different font
for
non-ascii text
" switch.
# the "
use a different font
for
non-ascii text
" switch.
local useDifferentFont=
$(
/usr/libexec/PlistBuddy
-c
"Print :New
\
Bookmarks:
${
idx
}
:Use
\
Non-ASCII
\
Font:"
~/Library/Preferences/com.googlecode.iterm2.plist
)
local useDifferentFont
useDifferentFont=
$(
/usr/libexec/PlistBuddy
-c
"Print :New
\
Bookmarks:
${
idx
}
:Use
\
Non-ASCII
\
Font:"
~/Library/Preferences/com.googlecode.iterm2.plist
)
if [[ "
$useDifferentFont
" == "
true
" ]]; then
if [[ "
$useDifferentFont
" == "
true
" ]]; then
local nonAsciiFont=
$(
/usr/libexec/PlistBuddy
-c
"Print :New
\
Bookmarks:
${
idx
}
:Non
\
Ascii
\
Font:"
~/Library/Preferences/com.googlecode.iterm2.plist
)
local nonAsciiFont
nonAsciiFont=
$(
/usr/libexec/PlistBuddy
-c
"Print :New
\
Bookmarks:
${
idx
}
:Non
\
Ascii
\
Font:"
~/Library/Preferences/com.googlecode.iterm2.plist
)
if [[ "
$term_font
" != "
$nonAsciiFont
" ]]; then
if [[ "
$term_font
" != "
$nonAsciiFont
" ]]; then
term_font="
$term_font
(
normal
)
/
$nonAsciiFont
(
non-ascii
)
"
term_font="
$term_font
(
normal
)
/
$nonAsciiFont
(
non-ascii
)
"
fi
fi
...
...
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