summaryrefslogtreecommitdiff
path: root/Userland/Utilities
AgeCommit message (Collapse)Author
2023-05-11errno: Remove usage of DeprecatedStringSam Atkins
2023-05-11errno: Look up errors by name as well as numberSam Atkins
eg, `errno enotsup` now shows the description and number for ENOTSUP.
2023-05-11errno: Include error code names in outputSam Atkins
And align the output nicely while we're at it. :^)
2023-05-09LibGfx/PortableFormat+image: Make `encode` take a StreamLucas CHOLLET
As we directly write to the stream, we don't need to store a copy of the entire image in memory. However, writing to a stream is heavier on the CPU than to a ByteBuffer. This commit unfortunately makes `add_pixels` two times slower.
2023-05-09AK: Add the `Input` word to input-only buffered streamsLucas CHOLLET
This concerns both `BufferedSeekable` and `BufferedFile`.
2023-05-09image: Initialize `strip_color_profile` with a default valueLucas CHOLLET
2023-05-08LibWeb: Add `--layout-test-mode` flag to HeadlessBrowsermartinfalisse
The `layout-test-mode` flag changes the font to be SerenitySans as this is the font used for layout tests for cross-platform compatibility of tests.
2023-05-07netstat: Fix fallback value for pid fieldFabian Dellwing
2023-05-07netstat: Add -e argumentFabian Dellwing
This adds information about the user owning the process to our netstat output. We do not fully match the behaviour of Linux as we don't show an inode information.
2023-05-07netstat: Fix in/out bytes not showingFabian Dellwing
Some change in our JsonObject API broke the logic here. We now read the correct type from the JsonObject and convert it to a string ourself.
2023-05-07netstat: Fix port numbers not showingFabian Dellwing
Some change in our JsonObject API broke the logic here. We now read the correct type from the JsonObject and convert it to a string ourself.
2023-05-07Everywhere: Change spelling of 'behaviour' to 'behavior'Ben Wiederhake
"The official project language is American English […]." https://github.com/SerenityOS/serenity/blob/5d2e9156239cd707a22ecea6c87d48e5fc1cbe84/CONTRIBUTING.md?plain=1#L30 Here's a short statistic of the occurrences of the word "behavio(u)r": $ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n 2 BEHAVIOR 24 Behaviour 32 behaviour 407 Behavior 992 behavior Therefore, it is clear that "behaviour" (56 occurrences) should be regarded a typo, and "behavior" (1401 occurrences) should be preferred. Note that The occurrences in LibJS are intentionally NOT changed, because there are taken verbatim from the specification. Hence: $ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n 2 BEHAVIOR 10 behaviour 24 Behaviour 407 Behavior 1014 behavior
2023-05-06image: Add a --frame-index optionNico Weber
2023-05-05LibGUI: Make `Application`'s construction fallibleLucas CHOLLET
The pattern to construct `Application` was to use the `try_create` method from the `C_OBJECT` macro. While being safe from an OOM perspective, this method doesn't propagate errors from the constructor. This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually define a `create` method that can bubble up errors from the construction stage. This commit also removes the ability to use `argc` and `argv` to create an `Application`, only `Main`'s `Arguments` can be used. From a user point of view, the patch renames `try_create` => `create`, hence the huge number of modified files.
2023-05-05sed: Implement in-place file editingkleines Filmröllchen
This implements the '-i' flag in the GNU version, without suffix support.
2023-05-05sed: Correctly unveil all pathskleines Filmröllchen
- The veil was never closed. - unveil() only works with absolute paths. - Files from the regular input list weren't unveiled.
2023-05-03ICC+image: Add conversion between color spaces for images :^)Nico Weber
For now, only for color spaces that are supported by Profile::to_pcs() and Profile::from_pcs(), which currently means that all matrix profiles (but not LUT profiles) in the source color space work, and that matrix profiles with parametric curves in the destination color space work. This adds Profile::convert_image(Bitmap, source_profile), and adds a `--convert-to-color-profile file.icc` flag to `image`. It only takes a file path, so to use it with the built-in sRGB profile, you have to write it to a file first: % Build/lagom/icc -n sRGB --reencode-to serenity-sRGB.icc `image` by default writes the source image's color profile to the output image, and most image viewers display images looking at the profile. For example, take `Seven_Coloured_Pencils_(rg-switch_sRGB).jpg` from https://commons.wikimedia.org/wiki/User:Colin/BrowserTest. It looks normal in image viewers because they apply the unusual profile embedded in the profile. But if you run % Build/lagom/image -o huh.png --strip-color-profile \ 'Seven_Coloured_Pencils_(rg-switch_sRGB).jpeg' and then look at huh.png, you can see how the image's colors look like when interpreted as sRGB (which is the color space PNG data is in if the PNG doesn't store an embedded profile). If you now run % Build/lagom/image -o wow.png \ --convert-to-color-profile serenity-sRGB.icc --strip-color-profile \ 'Seven_Coloured_Pencils_(rg-switch_sRGB).jpeg' this will convert that image to sRGB, but then not write the profile to the output image (verify with `Build/lagom/icc wow.png`). It will look correct in image viewers, since they display PNGs without an embedded color profile as sRGB. (This works because 'Seven_Coloured_Pencils_(rg-switch_sRGB).jpeg' contains a matrix profile, and Serenity's built-in sRGB profile uses a matrix profile with a parametric curve.)
2023-05-03profile: Prevent crash when -p is supplied a non-integer valuePrestonLTaylor
Instead of crashing we give a helpful warning message to the user. This also removes a fixme! :^)
2023-05-03profile: Add -a to warning message when -e, -d, -w xor -f is not setPrestonLTaylor
-a and -p both require only one of the flags. We will inform the user of this for both -a and -p <PID>.
2023-04-30nc: Fix overflow in port and local_port argumentFabian Dellwing
2023-04-30icc: Add a --measure flag that prints color difference in profileNico Weber
If --measure is passed, icc prints the color pairs with the smallest and largest perceptual difference between them. Converting 254 * 254 * 254 * 4 = 65 Million colors from sRGB to LAB and then computing 254 * 254 * 254 * 3 = 49 Million DeltaEs between them takes a while. On my laptop, it takes 17s to run. So there's a small progress display.
2023-04-28AK+Everywhere: Disallow Error::from_string_view(FooString)Ali Mohammad Pur
That pattern seems to show up a lot in code written by people that aren't intimately familiar with the lifetime model of Error and Strings. This commit makes the compiler detect it and present a more helpful diagnostic than "garbage string at runtime".
2023-04-27LibCore+file: Factorize code to detect mime-type from bytes of a fileLucas CHOLLET
This is always nice to factorize code, but even better when it contains magic numbers.
2023-04-26nc: Add -n option to suppress name resolutionFabian Dellwing
2023-04-26nc: Add -p optionFabian Dellwing
With this change we support the well-known and shorter way to create a listener on all interfaces: `nc -lvp 1337` instead of: `nc -lv 0.0.0.0 1337`
2023-04-26nc: Fix off-by-one-error in calls to inet_ntopFabian Dellwing
2023-04-26nc: Sort command line arguments alphabeticallyFabian Dellwing
2023-04-26Utilities: Add support for loading the WASI module to wasmAli Mohammad Pur
2023-04-25cal: Add the `-y` option to show the current yearKarol Baraniecki
Without `-y`, to show the current full year you'd have to specify which one: `cal 2023`. Adding `-y` makes it possible to see the full current year without remembering what year we are in. This option is also stolen from FreeBSD :^) Additionally, validate args: prevent passing both -3 and -y at the same time. Passing both `--three-month-mode` and `--year` to `cal` doesn't make sense. You'd either want the one or the other.
2023-04-25cal: Add the `-3` optionKarol Baraniecki
This allows to view just the previous, current, and next month simultaneously. The idea for this is shamelessly stolen from FreeBSD :^)
2023-04-25cal: Get default week start day from CalendarKarol Baraniecki
Making it configurable in system settings :^) The --start-day option can still overwrite this global default. This change makes it no longer possible to use unveil: as we have to load the Calendar config file, which might be in a dynamic location. It's also neccessary to add `cpath` to the pledge, as opening a nonexistent config file with Core::ConfigFile::open_for_app creates it.
2023-04-25cal: Make start of the week configurableKarol Baraniecki
Making all the other parts of the world happier :^) Add a `--starting-day` (`-s`) option to be compatible with GNU cal, which has a similar option. The GNU option takes allows passing either an int or a day name. Let's do something similar using weekdays we already have in AK/DateConstants.h. Also add myself to the copyright header, as by now I've modified most of the lines in this file.
2023-04-25cal: Pad days on the left with spaces instead of zeroesKarol Baraniecki
I think this looks a lot prettier: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 than that: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
2023-04-25cal: Only show year next to each month in one-month-modeKarol Baraniecki
Additionally rename a loop variable in serenity_main() because after introducing the `Header` enum IMO it's less readable with `i`.
2023-04-25cal: Fix width calculation by not leaving an extra space at month's endKarol Baraniecki
Do this by constructing month rows from a Vector of Strings.
2023-04-25cal: Display month namesKarol Baraniecki
For now let's use them from AK/DateConstants.h, in accordance with the FIXME those propably should be provided by the locale.
2023-04-25cal: Use global string widths instead of hardcoding themKarol Baraniecki
...in the format strings. Additionally, get rid of magic numbers, and make them `constexpr`.
2023-04-25cal: Center the month-year textKarol Baraniecki
For now this only has an effect when displaying two-digit years, but when month names get implemented this will be helpful.
2023-04-25cal: Mark the current day as inverted textKarol Baraniecki
...instead of putting a star `*` next to it. This makes `cal`s output much prettier, and gets rid of one FIXME. :^) Don't use the escape sequence from the deleted FIXME - \e[30;47m would set the background to white and foreground to black - which presumably wouldn't do much on a light-theme terminal. Instead use \e[7m which sets the color as "inverted".
2023-04-25cal: Rewrite cal to use new Strings and handle errorsKarol Baraniecki
This additionally fixes a couple of code quality issues in `cal`, removes reading from unset variables and writing to variables which are never read.
2023-04-25cal: Correctly identify current dayKarol Baraniecki
This fixes cal not highlighting the current day. After this commit `cal` will show something like this among its output for the 23rd day of the month 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23*24 25 26 27 28
2023-04-25cal: Don't accept passing a [day]Karol Baraniecki
Every other cal implementation just highlights the current day instead of letting you specify a custom one to highlight. It doesn't seem to be that useful, and is currently broken - no day gets highlighted at all, because the `target_day` global is never written to. Moreover, this complicates parsing the arguments. This commit also fixes parsing a case where just a year is provided to `cal` - for example `cal 2023`.
2023-04-24Aplay: Determine absolute path before first `unveil`Jelle Raaijmakers
`Core::DeprecatedFile::absolute_path` uses `stat` to determine whether a file exists, which will always fail after the first `unveil` call `aplay` does. Reorder things so we don't get a stack trace thrown at us for each file being played.
2023-04-24Ladybird: Define AK_DONT_REPLACE_STD via CMake rather than in every fileTimothy Flynn
2023-04-24Kernel: Allow configuring a Jail to not impose PID isolation restrictionLiav A
This is quite useful for userspace applications that can't cope with the restriction, but it's still useful to impose other non-configurable restrictions by using jails.
2023-04-22copy: Stop using DeprecatedStringSam Atkins
2023-04-22config: Stop using DeprecatedStringSam Atkins
2023-04-22cksum: Stop using DeprecatedStringSam Atkins
This has the side-effect of making the algorithm name case-sensitive, but there doesn't seem to be an especially good reason to support that. On the other hand, converting an AK::String to lowercase would require linking LibUnicode.
2023-04-22chown: Stop using DeprecatedStringSam Atkins
2023-04-22asctl: Stop using DeprecatedStringSam Atkins