Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
feh
Commits
1e212f65
Commit
1e212f65
authored
7 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Add %g and %Z format specifiers (closes #391)
parent
f8640490
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
man/feh.pre
+11
-2
11 additions, 2 deletions
man/feh.pre
src/slideshow.c
+12
-0
12 additions, 0 deletions
src/slideshow.c
with
23 additions
and
2 deletions
man/feh.pre
+
11
−
2
View file @
1e212f65
...
@@ -1014,6 +1014,10 @@ Image path/filename
...
@@ -1014,6 +1014,10 @@ Image path/filename
Escaped image path/filename
Escaped image path/filename
.Pq for use in shell commands
.Pq for use in shell commands
.
.
.It %g
.
w,h window dimensions in pixels (mnemonic: geometry)
.
.It %h
.It %h
.
.
Image height
Image height
...
@@ -1048,8 +1052,9 @@ Number of image pixels
...
@@ -1048,8 +1052,9 @@ Number of image pixels
.
.
.It \&%P
.It \&%P
.
.
Number of image pixels
Number of image pixels
in human-readable format with k/M
.Pq kilopixels / megapixels
.Pq kilopixels / megapixels
suffix
.
.
.It %r
.It %r
.
.
...
@@ -1087,7 +1092,11 @@ Process ID
...
@@ -1087,7 +1092,11 @@ Process ID
.
.
.It %z
.It %z
.
.
current image zoom
Current image zoom, rounded to two decimal places
.
.It %Z
.
Current image zoom, higher precision
.
.
.It %%
.It %%
.
.
...
...
This diff is collapsed.
Click to expand it.
src/slideshow.c
+
12
−
0
View file @
1e212f65
...
@@ -468,6 +468,12 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid)
...
@@ -468,6 +468,12 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid)
if
(
file
)
if
(
file
)
strncat
(
ret
,
shell_escape
(
file
->
filename
),
sizeof
(
ret
)
-
strlen
(
ret
)
-
1
);
strncat
(
ret
,
shell_escape
(
file
->
filename
),
sizeof
(
ret
)
-
strlen
(
ret
)
-
1
);
break
;
break
;
case
'g'
:
if
(
winwid
)
{
snprintf
(
buf
,
sizeof
(
buf
),
"%d,%d"
,
winwid
->
w
,
winwid
->
h
);
strncat
(
ret
,
buf
,
sizeof
(
ret
)
-
strlen
(
ret
)
-
1
);
}
break
;
case
'h'
:
case
'h'
:
if
(
file
&&
(
file
->
info
||
!
feh_file_info_load
(
file
,
NULL
)))
{
if
(
file
&&
(
file
->
info
||
!
feh_file_info_load
(
file
,
NULL
)))
{
snprintf
(
buf
,
sizeof
(
buf
),
"%d"
,
file
->
info
->
height
);
snprintf
(
buf
,
sizeof
(
buf
),
"%d"
,
file
->
info
->
height
);
...
@@ -564,6 +570,12 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid)
...
@@ -564,6 +570,12 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid)
strncat
(
ret
,
"1.00"
,
sizeof
(
ret
)
-
strlen
(
ret
)
-
1
);
strncat
(
ret
,
"1.00"
,
sizeof
(
ret
)
-
strlen
(
ret
)
-
1
);
}
}
break
;
break
;
case
'Z'
:
if
(
winwid
)
{
snprintf
(
buf
,
sizeof
(
buf
),
"%f"
,
winwid
->
zoom
);
strncat
(
ret
,
buf
,
sizeof
(
ret
)
-
strlen
(
ret
)
-
1
);
}
break
;
case
'%'
:
case
'%'
:
strncat
(
ret
,
"%"
,
sizeof
(
ret
)
-
strlen
(
ret
)
-
1
);
strncat
(
ret
,
"%"
,
sizeof
(
ret
)
-
strlen
(
ret
)
-
1
);
break
;
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment