From 026fd3382462cd1bc0153ed24554485b0e8bbe27 Mon Sep 17 00:00:00 2001 From: desktop Date: Thu, 28 Dec 2023 20:39:23 +0300 Subject: [PATCH] Gnome : Add poweroff dialog button. --- .config/bash/module/Doc.sh | 2 +- .config/linux/Gnome.dconf | 7 +- .config/tmux/tmux.conf | 3 + .doc/Bash.md | 10 +- .doc/Navigation.md | 4 + .doc/bash.md | 392 ------------------------------------- 6 files changed, 22 insertions(+), 396 deletions(-) delete mode 100644 .doc/bash.md diff --git a/.config/bash/module/Doc.sh b/.config/bash/module/Doc.sh index 29b8460..e88c81a 100644 --- a/.config/bash/module/Doc.sh +++ b/.config/bash/module/Doc.sh @@ -2,7 +2,7 @@ # Outputs to `~/.doc/bash.md`. function doc_bash() { local IFS=$'\n' - local file="${HOME}/.doc/bash.md" + local file="${HOME}/.doc/Bash.md" # Print title. echo "# Bash reference file." > "${file}" diff --git a/.config/linux/Gnome.dconf b/.config/linux/Gnome.dconf index 0dd64de..5e26749 100644 --- a/.config/linux/Gnome.dconf +++ b/.config/linux/Gnome.dconf @@ -195,7 +195,7 @@ night-light-schedule-to=0.0 night-light-temperature=uint32 3700 [org/gnome/settings-daemon/plugins/media-keys] -custom-keybindings=['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/'] +custom-keybindings=['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/'] magnifier=@as [] magnifier-zoom-in=@as [] magnifier-zoom-out=@as [] @@ -207,6 +207,11 @@ binding='Escape' command='gnome-terminal' name='gnome-terminal' +[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1] +binding='z' +command='gnome-session-quit --power-off' +name='gnome-poweroff' + [org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2] binding='Escape' command='gnome-system-monitor' diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 98974af..ab8cadc 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -28,6 +28,7 @@ bind -n M-s select-pane -D # close pane. bind -n M-c kill-pane +bind -n M-C kill-pane -a # create new window. bind -n M-Escape new-window -c "#{pane_current_path}" @@ -35,6 +36,7 @@ bind -n M-t new-window -c "#{pane_current_path}" # NOTE: for compatibility with # close window. bind -n M-x kill-window +bind -n M-X kill-window -a # switch window. bind -n M-e next-window @@ -46,6 +48,7 @@ bind -n M-Q swap-window -t -1\; select-window -t -1 # detach. bind -n M-z detach-client +bind -n M-Z detach-client -a # scroll. bind -n M-p copy-mode -u diff --git a/.doc/Bash.md b/.doc/Bash.md index 2ee1d80..0552a3c 100644 --- a/.doc/Bash.md +++ b/.doc/Bash.md @@ -223,7 +223,8 @@ Command|Description Command|Description ---|--- -`name [FILES]`|Rename files to strip all special characters. All files by default. +`name [FILES]`|Rename dirs to `snake_case` and files to `PascalCase`. Careful with structured file names like archives! +`name_simple [FILES]`|Rename files to strip all special characters. All files by default. `name_hash [FILES]`|Rename all files to their hashes while keeping extensions. All files by default. `name_hash_check [FILES]`|Check hashes for previously renamed files. All files by default. `name_series [FILES]`|Rename files for Jellyfin series, i.e. `Episode S01E01.mkv` All files by default. @@ -233,7 +234,6 @@ Command|Description `name_postfix [FILES]`|Change file name postfix. All matching files by default. `name_replace [FILES]`|Replace part of the name. All matching files by default. `name_fix_numbering [FILES]`|Fix numbering for numbered files. I.e if there are 10 items and some of them start without zero, then append zero to it. 1..10 -> 01..10. -`name_convention [FILES]`|Rename dirs to `snake_case` and files to `PascalCase`. Careful with structured file names like archives! ## Ncdu. @@ -286,6 +286,12 @@ Command|Description ---|--- `ps [PROCESS]`|Find process and filter. +## Random. + +Command|Description +---|--- +`random_file`|Picks a random file or directory. + ## Recursive. Command|Description diff --git a/.doc/Navigation.md b/.doc/Navigation.md index 1ff1eee..ab9ec13 100644 --- a/.doc/Navigation.md +++ b/.doc/Navigation.md @@ -16,6 +16,7 @@ Key|Action `Super+a`|Snap window to the left. `Super+d`|Snap window to the right. `Super+z`|Lock session. +`Super+Z`|Power off. `Super+x`|Close window. `Super+c`|Minimize all windows. `Super+v`|Take a screenshot. @@ -42,8 +43,11 @@ Key|Action `Meta+a`|Switch to the left split. `Meta+d`|Switch to the right split. `Meta+z`|Detach from session. +`Meta+Z`|Detach all other clients from session. `Meta+x`|Close window. +`Meta+x`|Close all other windows. `Meta+c`|Close split. +`Meta+c`|Close all other splits. `Meta+v`|Visual selection. `y` to copy. `Meta+f`|None. `Meta+\\`|Split vertically. diff --git a/.doc/bash.md b/.doc/bash.md deleted file mode 100644 index fd8a194..0000000 --- a/.doc/bash.md +++ /dev/null @@ -1,392 +0,0 @@ -# Bash reference file. - -To get help with usage info run: - -```text -$ help - -or - -$ h -``` - -## Android. - -Command|Description ----|--- -`emulator [NAME]`|Start an Android emulator. Default name is `default`. - -## Archive. - -Command|Description ----|--- -`archive [DIRS]`|Archive directories. All directories by default. -`archive_fast [DIRS]`|Archive directories with fast compression. All directories by default. -`archive_check [FILES]`|Check archives integrity. Checks all archives by default. -`archive_prune [NAME]`|Delete old versions of archives. All archives by default. -`archive_rm [FILES]`|Delete specified or all archive files. -`archive_xz [FILES]`|Recompress previously created archive_fast with better compression. -`archive_name [ARCHIVE] [NAME]`|Rename archives. If no name specified, it simplifies archive's name. If no archives specified, apply to all archives. -`unarchive [FILES]`|Extract previously created archive with checksum validation. - -## Battery. - -Command|Description ----|--- -`battery_level`|Print current battery level. - -## Bootstrap. - -Command|Description ----|--- -`bootstrap_rust`|Install Cargo/Rust. -`bootstrap_texlive`|Install TeXLive. -`bootstrap_grub`|Install grub theme. -`bootstrap_ffmpeg`|Install ffmpeg. -`bootstrap_editorconfig`|Install Editorconfig file (with tabs) in current directory. -`bootstrap_editorconfig_space [AMOUNT]`|Install Editorconfig file (with specified spaces, 8 by default) in current directory. - -## Cd. - -Command|Description ----|--- -`cdd `|CD (back) to directory. Finds first directory that matches the input (case-insensitive). - -## Checksum. - -Command|Description ----|--- -`checksum_create [FILES]`|Save file checksums. For file with a name `file` it will create a new file called `.file.sha1` with hash in it. All files by default. -`checksum_check [FILES]`|Check stored values against actual files. All files by default. -`checksum`|Calculate hashes for all files recursively and store in a file called `checksum.sha1`. - -## Chmod. - -Command|Description ----|--- -`x `|Add executable flag to file. - -## Color. - -Command|Description ----|--- -`color_test`|Print all available colors with their names colored in corresponding color. - -## Copypaste. - -Command|Description ----|--- -`copy`|Copy stdin to system clipboard. *Example:* `echo hi \| copy`. -`paste`|Paste system clipboard to stdout. *Example:* `paste > file.txt`. - -## Cp. - -Command|Description ----|--- -`cp `|Replaces default cp with rsync. -`cp_merge `|Copy and also merge all changes (delete dst files that do not exist in src). -`cp_link `|Copy by creating hardlinks. Works for directories, too. -`bcp`|Default cp, a.k.a builtin cp. When you don't need rsync. -`cp_test `|Print output of cp_merge without writing anything. - -## Date. - -Command|Description ----|--- -`today`|Print today date in yyyyMMdd format. -`dow`|Current day of week number. - -## Dconf. - -Command|Description ----|--- -`dconf_load`|Load Gnome settings. -`dconf_save [FILE]`|Dump Gnome settings into the file. Default name is `gnome.dconf`. Do this before changing settings and after, an then run `diff` to find out what to add to the main `gnome.dconf`. - -## Disk. - -Command|Description ----|--- -`df`|Show only physical drives info. -`du [DIRS]`|Show combined size in SI. Current dir by default. - -## Doc. - -Command|Description ----|--- -`doc_bash`|Generate a markdown file with all the help info. Outputs to `~/.doc/bash.md`. - -## Docker. - -Command|Description ----|--- -`docker_volumes `|Show container's volumes. -`docker_health`|Check if any container exited. -`docker_ip `|Find out container's IP address. -`docker_update`|Update all docker images. -`docker_prune`|Prune everything. -`dc`|Docker compose shortcut. -`dcu [SERVICES]`|Docker compose up. -`dcd [SERVICES]`|Docker compose down. -`dcp [SERVICES]`|Docker compose pull. -`dcl [SERVICES]`|Docker compose logs. -`dcr [SERVICES]`|Docker compose restart. -`dcs [SERVICES]`|Docker compose stop. -`dcdu [SERVICES]`|Docker compose down & up specified services. -`dcpu [SERVICES]`|Docker compose pull & up specified services. -`dcul [SERVICES]`|Docker compose up & attach to logs for specified services. - -## Ffmpeg. - -Command|Description ----|--- -`ffmpeg_mux_audio `|Mux audio into containers. File names in sound and current dirrectories must match. -`ffmpeg_mux_cover `|Mux cover into music file. -`ffmpeg_music_meta `|Generate music metadata from directory structure. Top dir is the Artist name like this: `The_Beatles`. Next are albums like this: `2010_My_love`. Inside are songs like this: `01_sample.flac`. - -## File. - -Command|Description ----|--- -`o `|Open file/dir in GUI. - -## Find. - -Command|Description ----|--- -`find_ext`|Find all file extensions. -`find_module`|Find all modules. -`find_function [MODULE]`|Find all module functions. Functions from all modules by default. - -## Fix. - -Command|Description ----|--- -`fix_ethernet_speed `|Fix when ethernet mistakenly detects 100 Mb instead of 1000 Mb. SPEED is one of 10/100/1000 etc. -`fix_files_sftp`|Fix nautilus after typing wrong sftp password. - -## Git. - -Command|Description ----|--- -`gps`|Git push. -`gpsf`|Git force push. -`gpl`|Git pull. -`gl`|Git log. -`gs`|Git status. -`gst`|Git stash. -`gd`|Git diff. -`gc`|Git commit. -`gch`|Git checkout. -`gchb `|Git checkout branch. -`gb`|Git branch. -`gbd `|Git branch delete. -`gbda`|Git branch delete all except current. -`gf`|Git fetch all. -`gt`|Git tag. -`gi`|Git ignore files. -`gpc `|Git patch create. -`gp `|Git patch (apply). -`ggc`|Run git garbage collection. -`ga [FILES]`|Preview diff while adding. Adds current dir by default. -`gr [COMMIT COUNT]`|Rebase by X commits or from root. When COUNT is 0 - rebase from root. Default is 2. -`gu [EMAIL]`|Specify git user as Dmitry Voronin with provided email. -`gg `|Get my git repo. -`gdc `|See diff for a specific commit. - -## Group. - -Command|Description ----|--- -`group_ext [FILES]`|Group files by extension. -`group_year [FILES]`|Group files and dirs by year. - -## Help. - -Command|Description ----|--- -`help `|Get help about dotfiles bash function. -`h `|Short for help. - -## Ls. - -Command|Description ----|--- -`l [DIRS]`|List files in dirs. Current dir by default. -`ll [DIRS]`|List last modified files first. Current dir by default. -`lll [DEPTH] [DIRS]`|List files in tree structure. Current dir by default. Depth can be omitted by passing `-` (dash). -`llll [DIRS]`|List files recursively. Current dir by default. -`la [DIRS]`|List all files in dirs, incl. hidden files. Current dir by default. -`lla [DIRS]`|List all files in dirs, incl. hidden files, sorted by mtime. Current dir by default. - -## Name. - -Command|Description ----|--- -`name_simple [FILES]`|Rename files to strip all special characters. All files by default. -`name_hash [FILES]`|Rename all files to their hashes while keeping extensions. All files by default. -`name_hash_check [FILES]`|Check hashes for previously renamed files. All files by default. -`name_series [FILES]`|Rename files for Jellyfin series, i.e. `Episode S01E01.mkv` All files by default. -`name_manga [FILES]`|Rename files for Kavita manga format. All files by default. -`name_ext [FILES]`|Rename files with new extension. All files by default. -`name_prefix [FILES]`|Change file name prefix. All matching files by default. -`name_postfix [FILES]`|Change file name postfix. All matching files by default. -`name_replace [FILES]`|Replace part of the name. All matching files by default. -`name_fix_numbering [FILES]`|Fix numbering for numbered files. I.e if there are 10 items and some of them start without zero, then append zero to it. 1..10 -> 01..10. -`name [FILES]`|Rename dirs to `snake_case` and files to `PascalCase`. Careful with structured file names like archives! - -## Ncdu. - -Command|Description ----|--- -`ncdu [DIRS]`|Search only on current filesystem. Current dir by default. - -## Notify. - -Command|Description ----|--- -`notify `|Send Telegram notification. -`notify_silent `|Send silent Telegram notification. - -## Own. - -Command|Description ----|--- -`own [USER] [FILES]`|Change file ownership to specified user id and restrict access to him. Root user by default. This directory recursively by default. - -## Pack. - -Command|Description ----|--- -`pack [FILES]`|Pack files into desired format. All files and directories by default. -`unpack [FILES]`|Attempt to unpack. All supported formats by default. - -## Parse. - -Command|Description ----|--- -`parse_simplify `|Parse data and output simplified format. -`parse_pascal `|Parse to PascalCase. -`parse_snake `|Parse to snake_case. -`parse_kebab `|Parse to kebab-case. -`parse_camel `|Parse to camelCase. -`parse_snake_uppercase `|Parse to SNAKE_CASE_UPPERCASE. -`parse_alnum `|Parse data keeping only alphanumeric characters. - -## Permissions. - -Command|Description ----|--- -`perm_share`|Recursively change permissions to allow read sharing with group and others. -`perm`|Recursively change permissions to restrict access for group and others. - -## Ps. - -Command|Description ----|--- -`ps [PROCESS]`|Find process and filter. - -## Random. - -Command|Description ----|--- -`random_file`|Picks a random file or directory. - -## Recursive. - -Command|Description ----|--- -`recursive `|Run something recursively over all directories. -`recursive1 `|Run something recursively over directories of 1 depth (excluding current dir). - -## Rust. - -Command|Description ----|--- -`rust_book`|Open Rust book. - -## Su. - -Command|Description ----|--- -`s [USER]`|Su shortcut for lazy me. Root by default. - -## Terminal. - -Command|Description ----|--- -`tsize`|Get terminal size. - -## Tmp. - -Command|Description ----|--- -`tmp`|CD into host's primary tmp dir. - -## Tmux. - -Command|Description ----|--- -`ta [NAME]`|Create/attach to named session. By default uses name `main`. -`td`|Detach from running session. -`tda`|Detach all other tmux clients. -`tl`|List running sessions. -`trn [NAME]`|Rename current session. Uses current dir name by default. -`tn [NAME]`|Assign name to window. Uses current dir name by default. -`tk [NAME]`|Kill specified session. By default it kills `main` session. -`tka`|Kill all sessions. - -## Todo. - -Command|Description ----|--- -`todo`|Open `~/.todo.md` file. - -## Toolbx. - -Command|Description ----|--- -`tba [NAME]`|Attach/create toolbx container with specified name. By default uses `main` name. -`tbk [NAME]`|Remove toolbx container with specified name. By default uses `main` name. -`tb_rpmfusion [NAME]`|Install rpm-fusion repository into container with specified name. By default uses `main` name. -`tbl`|List all available containers. - -## Transcode. - -Command|Description ----|--- -`transcode [FILES]`|Convert between different formats. By default tries to convert all files. - -## Try. - -Command|Description ----|--- -`try `|Retry command every 2 sec until it completes successfully. - -## Vdl. - -Command|Description ----|--- -`vdl [LINK]`|Download video from URL. When no `[LINK]` specified, it tries to update previously downloaded link. -`vdl_vk `|Temporary fix for vk downloads. -`vdl_file `|Download all videos from file with links. - -## Vi. - -Command|Description ----|--- -`v`|Neovim shortcut. - -## Wallpaper. - -Command|Description ----|--- -`wallpaper `|Set specified file as a wallpaper. - -## Watch. - -Command|Description ----|--- -`w `|Watch command output with 2 seconds interval. -`ww `|Watch command output with minimal interval. -