From 33010333a7ebfded568c72228502ef242f3baf3f Mon Sep 17 00:00:00 2001 From: Harish Karumuthil Date: Thu, 4 Aug 2022 02:46:12 +0530 Subject: [PATCH] New utils * Tile pdf eg: Tile A5 in A4 page * Start / stop pulseaudio tcp * systemd service generator --- home/.config/alacritty/alacritty.yml | 2 +- home/.config/sway/config | 11 +++-- .../.local/Apps/daily-utils/bin/hari-tools.sh | 43 +++++++++++++++++-- 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/home/.config/alacritty/alacritty.yml b/home/.config/alacritty/alacritty.yml index 649721a..1492eee 100644 --- a/home/.config/alacritty/alacritty.yml +++ b/home/.config/alacritty/alacritty.yml @@ -2,7 +2,7 @@ font: size: 13.0 normal: # family: Source Code Pro Medium - family: CodeNewRoman Nerd Font Mono + family: DejaVuSansMono Nerd Font Mono key_bindings: - { key: Return, mods: Shift, chars: "\e[13;2u" } diff --git a/home/.config/sway/config b/home/.config/sway/config index 36cff09..7a958cd 100644 --- a/home/.config/sway/config +++ b/home/.config/sway/config @@ -14,7 +14,8 @@ set $down j set $up k set $right l # Your preferred terminal emulator -set $term gnome-terminal +# set $term gnome-terminal +set $term konsole # Your preferred application launcher set $menu dmenu_run @@ -62,7 +63,7 @@ output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill # Resize them with right mouse button + $mod. # Despite the name, also works for non-floating windows. # Change normal to inverse to use left mouse button for resizing and right - # mouse button for dragging. + floating_modifier $mod normal # reload the configuration file @@ -189,7 +190,9 @@ bindsym $mod+r mode "resize" # # Read `man 5 sway-bar` for more information about this section. bar { - status_command i3status + #status_command i3status + swaybar_command waybar + status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done position top colors { statusline #ffffff @@ -201,7 +204,7 @@ bar { include /etc/sway/config.d/* -set $wp_switch ~/.local/bin/sway-wp-switch +set $wp_switch sway-wp-switch bindsym Control+Shift+Alt+Up exec $wp_switch -m up bindsym Control+Shift+Alt+Down exec $wp_switch -m down diff --git a/home/.local/Apps/daily-utils/bin/hari-tools.sh b/home/.local/Apps/daily-utils/bin/hari-tools.sh index 9c90c0a..5f1ec52 100755 --- a/home/.local/Apps/daily-utils/bin/hari-tools.sh +++ b/home/.local/Apps/daily-utils/bin/hari-tools.sh @@ -195,7 +195,7 @@ chromewayland(){ # pidEnv . Print environment variables of a PID. pidEnv(){ - cat /proc/$(pgrep kwin)/environ | tr '\0' '\n' | awk '{ print "export "$0}' + cat /proc/$(pgrep $1)/environ | tr '\0' '\n' | awk '{ print "export "$0}' } # Copy files from local to remote @@ -220,12 +220,49 @@ json2csv(){ jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' } -# pdfTile +# pdfTile [options] # Tile input pdf in A4 sheet pdfTile(){ - pdfjam $1 --no-landscape --nup $2 --paper a4paper --suffix A4 + local infile=$1 + shift + local nup=$1 + shift + pdfjam $infile --nup $nup --paper a4paper --suffix A4 $@ +} + +# servicegen [logsdir] +# Generate systemd service file +servicegen(){ + local name=$1 + local cmd=$2 + local logsdir=$3 + cat<