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
febc4653
Commit
febc4653
authored
Jan 05, 2017
by
Dylan Araps
Committed by
GitHub
Jan 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #580 from mstraube/konsole
Term: Rewrite Konsole font detection, closes #576
parents
e77c7ead
f1c61c59
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
neofetch
neofetch
+13
-12
No files found.
neofetch
View file @
febc4653
...
@@ -1587,25 +1587,26 @@ get_term_font() {
...
@@ -1587,25 +1587,26 @@ get_term_font() {
;;
;;
"
konsole
"*)
"
konsole
"*)
# Use Process ID from get_term().
# Get Process ID of current konsole window / tab
# The variable can include 'PPid:' and also whitespace
# so we get rid of it here.
parent="
$(
trim
"
${
parent
/PPid
:
}
"
)
"
# Get PID of current child window / tab
child="
$(
get_ppid
"
$$
"
)
"
child="
$(
get_ppid
"
$$
"
)
"
# Get all konsole sessions of the parent (all child windows and tabs)
konsole_instances=(
$(
qdbus |
grep
'org.kde.konsole'
)
)
konsole_sessions=(
$(
qdbus org.kde.konsole-
"
${
parent
}
"
|
awk
'/Sessions\//'
)
)
# Get profile of current session (window / tab)
for i in "
${
konsole_instances
[@]
}
"; do
konsole_sessions=(
$(
qdbus
"
${
i
}
"
|
grep
'/Sessions/'
)
)
for session in "
${
konsole_sessions
[@]
}
"; do
for session in "
${
konsole_sessions
[@]
}
"; do
if ((child == "
$(
qdbus org.kde.konsole-
"
${
parent
}
"
"
${
session
}
"
processId
)
")); then
if ((child == "
$(
qdbus
"
${
i
}
"
"
${
session
}
"
processId
)
")); then
profile="
$(
qdbus org.kde.konsole-
"
${
parent
}
"
"
${
session
}
"
environment |
awk
-F
'='
'/KONSOLE_PROFILE_NAME/ {print $2}'
)
"
profile="
$(
qdbus
"
${
i
}
"
"
${
session
}
"
environment |
awk
-F
'='
'/KONSOLE_PROFILE_NAME/ {print $2}'
)
"
break
break
fi
fi
done
done
term_font="
$(
awk
-F
'=|,'
'/Font=/ {print $2}'
"
${
HOME
}
/.local/share/konsole/
${
profile
}
"
.profile
)
"
[[ "
$profile
" ]] && break
done
# We could have two profile files for the same profile name, take first match
profile_filename="
$(
grep
-l
"Name=
${
profile
}
"
"
${
HOME
}
"
/.local/share/konsole/
*
.profile
)
"
profile_filename="
${
profile_filename
/
$'
\n
'
*
}
"
[[ "
$profile_filename
" ]] && term_font="
$(
awk
-F
'=|,'
'/Font=/ {print $2 " " $3}'
"
$profile_filename
"
)
"
;;
;;
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