From b1045b4b1cfec6cf8342b58587d9791144762db8 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Wed, 21 May 2025 13:59:23 +0200 Subject: [PATCH] update dwim-shell-command --- .../dwim-shell-command-autoloads.el | 2 + .../dwim-shell-command-pkg.el | 6 +-- .../dwim-shell-command.el | 8 ++-- .../dwim-shell-commands.el | 43 ++++++++++++++++--- 4 files changed, 45 insertions(+), 14 deletions(-) rename elpa/{dwim-shell-command-20241115.845 => dwim-shell-command-20250218.1720}/dwim-shell-command-autoloads.el (99%) rename elpa/{dwim-shell-command-20241115.845 => dwim-shell-command-20250218.1720}/dwim-shell-command-pkg.el (55%) rename elpa/{dwim-shell-command-20241115.845 => dwim-shell-command-20250218.1720}/dwim-shell-command.el (99%) rename elpa/{dwim-shell-command-20241115.845 => dwim-shell-command-20250218.1720}/dwim-shell-commands.el (97%) diff --git a/elpa/dwim-shell-command-20241115.845/dwim-shell-command-autoloads.el b/elpa/dwim-shell-command-20250218.1720/dwim-shell-command-autoloads.el similarity index 99% rename from elpa/dwim-shell-command-20241115.845/dwim-shell-command-autoloads.el rename to elpa/dwim-shell-command-20250218.1720/dwim-shell-command-autoloads.el index 534831c1..ba4bfd37 100644 --- a/elpa/dwim-shell-command-20241115.845/dwim-shell-command-autoloads.el +++ b/elpa/dwim-shell-command-20250218.1720/dwim-shell-command-autoloads.el @@ -198,6 +198,8 @@ Toggle Bluetooth device connection." t) Convert binary plist to xml." t) (autoload 'dwim-shell-commands-macos-toggle-dark-mode "dwim-shell-commands" "\ Toggle macOS dark mode." t) +(autoload 'dwim-shell-commands-macos-toggle-menu-bar-autohide "dwim-shell-commands" "\ +Toggle macOS dark mode." t) (autoload 'dwim-shell-commands-pdf-to-txt "dwim-shell-commands" "\ Convert pdf to txt." t) (autoload 'dwim-shell-commands-resize-image-by-factor "dwim-shell-commands" "\ diff --git a/elpa/dwim-shell-command-20241115.845/dwim-shell-command-pkg.el b/elpa/dwim-shell-command-20250218.1720/dwim-shell-command-pkg.el similarity index 55% rename from elpa/dwim-shell-command-20241115.845/dwim-shell-command-pkg.el rename to elpa/dwim-shell-command-20250218.1720/dwim-shell-command-pkg.el index 8c053012..4b0f089c 100644 --- a/elpa/dwim-shell-command-20241115.845/dwim-shell-command-pkg.el +++ b/elpa/dwim-shell-command-20250218.1720/dwim-shell-command-pkg.el @@ -1,7 +1,7 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "dwim-shell-command" "20241115.845" +(define-package "dwim-shell-command" "20250218.1720" "Shell commands with DWIM behaviour." '((emacs "28.1")) :url "https://github.com/xenodium/dwim-shell-command" - :commit "1fa8b9d361f01618bf65111ac0b253adb0599a09" - :revdesc "1fa8b9d361f0") + :commit "4b077432a94873e5f505c8f569743cfd984eebb1" + :revdesc "4b077432a948") diff --git a/elpa/dwim-shell-command-20241115.845/dwim-shell-command.el b/elpa/dwim-shell-command-20250218.1720/dwim-shell-command.el similarity index 99% rename from elpa/dwim-shell-command-20241115.845/dwim-shell-command.el rename to elpa/dwim-shell-command-20250218.1720/dwim-shell-command.el index 0e3f8e14..425cacc1 100644 --- a/elpa/dwim-shell-command-20241115.845/dwim-shell-command.el +++ b/elpa/dwim-shell-command-20250218.1720/dwim-shell-command.el @@ -5,8 +5,8 @@ ;; Author: Alvaro Ramirez ;; Package-Requires: ((emacs "28.1")) ;; URL: https://github.com/xenodium/dwim-shell-command -;; Package-Version: 20241115.845 -;; Package-Revision: 1fa8b9d361f0 +;; Package-Version: 20250218.1720 +;; Package-Revision: 4b077432a948 ;; This package is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -91,7 +91,7 @@ Set to nil to use `shell-command-switch'." (defcustom dwim-shell-command-done-buffer-name (lambda (name) - (format "✅ %s %s" name (propertize "done" 'face 'success))) + (format "%s %s" name (propertize "done" 'face 'success))) "Function to format buffer name on success. Use `identify' to remove formatting." :type 'function @@ -99,7 +99,7 @@ Use `identify' to remove formatting." (defcustom dwim-shell-command-error-buffer-name (lambda (name) - (format "⛔️ %s %s" name (propertize "error" 'face 'error))) + (format "%s %s" name (propertize "error" 'face 'error))) "Function to format buffer name on error. Use `identify' to remove formatting." :type 'function diff --git a/elpa/dwim-shell-command-20241115.845/dwim-shell-commands.el b/elpa/dwim-shell-command-20250218.1720/dwim-shell-commands.el similarity index 97% rename from elpa/dwim-shell-command-20241115.845/dwim-shell-commands.el rename to elpa/dwim-shell-command-20250218.1720/dwim-shell-commands.el index 7e981ff0..7984af97 100644 --- a/elpa/dwim-shell-command-20241115.845/dwim-shell-commands.el +++ b/elpa/dwim-shell-command-20250218.1720/dwim-shell-commands.el @@ -49,7 +49,7 @@ (when prefix (setq prefix (string-trim (read-string "Transcription locale: " "ja-JP"))) (when (string-empty-p prefix) - (errro "No locale given"))) + (error "No locale given"))) (dwim-shell-command-on-marked-files "Extract har response content" (format "declare -A mime_map=( \ @@ -609,14 +609,14 @@ Optional argument ARGS as per `browse-url-default-browser'" "Apply iOS round corners to image(s)." (interactive) (dwim-shell-command-on-marked-files - "Speed up gif" - "set -o xtrace + "Speed up gif" + "set -o xtrace width=$(ffprobe -v error -select_streams v:0 -show_entries stream=width -of default=noprint_wrappers=1:nokey=1 '<>') height=$(ffprobe -v error -select_streams v:0 -show_entries stream=height -of default=noprint_wrappers=1:nokey=1 '<>') corner=$((${width}/4)) echo ${corner} convert -size ${width}x${height} xc:none -fill white -draw \"roundRectangle 0,0 ${width},${height} ${corner},${corner}\" '<>' -compose SrcIn -composite '<>_ios_round.<>'" - :utils '("ffprobe" "convert"))) + :utils '("ffprobe" "convert"))) ;;;###autoload (defun dwim-shell-commands-clip-round-rect-gif () @@ -784,6 +784,25 @@ EOF" :utils "dark-mode" ;; brew install dark-mode :silent-success t)) +;;;###autoload +(defun dwim-shell-commands-macos-toggle-menu-bar-autohide () + "Toggle macOS dark mode." + (interactive) + (dwim-shell-command-on-marked-files + "Toggle menu bar auto-hide." + "current_status=$(osascript -e 'tell application \"System Events\" to get autohide menu bar of dock preferences') + +if [ \"$current_status\" = \"true\" ]; then + osascript -e 'tell application \"System Events\" to set autohide menu bar of dock preferences to false' + echo \"Auto-hide disabled.\" +else + osascript -e 'tell application \"System Events\" to set autohide menu bar of dock preferences to true' + echo \"Auto-hide enabled.\" +fi" + :utils "osascript" + :shell-util "zsh" + :silent-success t)) + ;;;###autoload (defun dwim-shell-commands-pdf-to-txt () "Convert pdf to txt." @@ -1006,6 +1025,16 @@ EOF" (format "ffmpeg -i '<>' -filter_complex '[0:v]trim=start=0:end=%d,setpts=PTS-STARTPTS[v0];[0:v]trim=start=%d:end=%d,setpts=(PTS-1)/%d[v1];[0:v]trim=start=%d,setpts=PTS-STARTPTS[v2];[v0][v1][v2]concat=n=3:v=1:a=0' -preset fast '<>_%d:%dx%d.<>'" start start end factor end start end factor) :utils "ffmpeg"))) +(defun dwim-shell-commands-set-song-title () + "Set song(s) title." + (interactive) + (let ((title (replace-regexp-in-string "'" "\'" (read-string "New title: ")))) + (dwim-shell-command-on-marked-files + "Set song(s) title" + (format "ffmpeg -i '<>' -metadata title='%s' -codec copy '<>/<>_temp.<>' && mv -f '<>/<>_temp.<>' '<>'" + title) + :utils "ffmpeg"))) + ;;;###autoload (defun dwim-shell-commands-resize-video () "Resize marked images." @@ -1340,7 +1369,7 @@ echo \"<>.svg\" "Select and start recording a macOS window." (interactive) (let* ((window (dwim-shell-commands--macos-select-window)) - (path (dwim-shell-commands--generate-path "~/Desktop" (car window) ".gif")) + (path (dwim-shell-commands--generate-path "~/Screenshots" (car window) ".gif")) (buffer-file-name path) ;; override so <> picks it up (inhibit-message t)) ;; Silence echo to avoid unrelated messages making into animation. @@ -1352,7 +1381,7 @@ echo \"<>.svg\" "macosrec --record '%s' --gif --output '<>'" (cdr window)) :silent-success t - :monitor-directory "~/Desktop" + :monitor-directory "~/Screenshots" :no-progress t :utils '("ffmpeg" "macosrec") :on-completion @@ -1428,7 +1457,7 @@ echo \"<>.svg\" "Start recording a macOS window." (format "macosrec --screenshot %s" (cdr window)) :silent-success t - :monitor-directory "~/Desktop" + :monitor-directory "~/Screenshots" :no-progress t :utils "macosrec"))) -- 2.47.3