From 1acfd0bb41fb517e1378beb66474fff1ff86900d Mon Sep 17 00:00:00 2001 From: Aleksander Cynarski Date: Tue, 6 Jul 2021 21:53:39 +0200 Subject: [PATCH] zmiana konfiguracji na wayland i sway :love: --- .config/alacritty/alacritty.yml | 40 ++-- .config/dunst/dunstrc | 16 +- .config/i3/config | 18 +- .config/lf/lfrc | 177 +++++++++++++++ .config/sway/bin/dmenuscreenshare.sh | 9 + .config/sway/bin/lock.sh | 14 ++ .config/sway/config | 43 ++++ .config/sway/sway.d/01-general.conf | 2 + .config/sway/sway.d/02-layout.conf | 30 +++ .config/sway/sway.d/03-workspace.conf | 13 ++ .config/sway/sway.d/04-input.conf | 20 ++ .config/sway/sway.d/05-output.conf | 25 +++ .config/sway/sway.d/06-floating.conf | 13 ++ .config/sway/sway.d/07-hotkeys.conf | 193 +++++++++++++++++ .config/sway/sway.d/08-idle.conf | 12 ++ .config/sway/sway.d/09-swaybar.conf | 21 ++ .config/sway/sway.d/10-autostart.conf | 17 ++ .../user/default.target.wants/mouse.service | 1 + .config/systemd/user/mako.service | 19 ++ .config/systemd/user/mouse.service | 8 + .config/systemd/user/polkit-gnome.service | 14 ++ .config/systemd/user/sway-session.target | 6 + .../polkit-gnome.service | 1 + .../swayidle.service | 1 + .../sway-session.target.wants/waybar.service | 1 + .config/systemd/user/swayidle.service | 15 ++ .config/systemd/user/waybar.service | 17 ++ .config/waybar/bin/level.sh | 6 + .config/waybar/bin/sensor.sh | 7 + .config/waybar/config | 203 ++++++++++++++++++ .config/waybar/style.css | 83 +++++++ .zshrc | 13 +- 32 files changed, 1019 insertions(+), 39 deletions(-) create mode 100644 .config/lf/lfrc create mode 100755 .config/sway/bin/dmenuscreenshare.sh create mode 100755 .config/sway/bin/lock.sh create mode 100644 .config/sway/config create mode 100644 .config/sway/sway.d/01-general.conf create mode 100644 .config/sway/sway.d/02-layout.conf create mode 100644 .config/sway/sway.d/03-workspace.conf create mode 100644 .config/sway/sway.d/04-input.conf create mode 100644 .config/sway/sway.d/05-output.conf create mode 100644 .config/sway/sway.d/06-floating.conf create mode 100644 .config/sway/sway.d/07-hotkeys.conf create mode 100644 .config/sway/sway.d/08-idle.conf create mode 100644 .config/sway/sway.d/09-swaybar.conf create mode 100644 .config/sway/sway.d/10-autostart.conf create mode 120000 .config/systemd/user/default.target.wants/mouse.service create mode 100644 .config/systemd/user/mako.service create mode 100644 .config/systemd/user/mouse.service create mode 100644 .config/systemd/user/polkit-gnome.service create mode 100644 .config/systemd/user/sway-session.target create mode 120000 .config/systemd/user/sway-session.target.wants/polkit-gnome.service create mode 120000 .config/systemd/user/sway-session.target.wants/swayidle.service create mode 120000 .config/systemd/user/sway-session.target.wants/waybar.service create mode 100644 .config/systemd/user/swayidle.service create mode 100644 .config/systemd/user/waybar.service create mode 100755 .config/waybar/bin/level.sh create mode 100755 .config/waybar/bin/sensor.sh create mode 100644 .config/waybar/config create mode 100644 .config/waybar/style.css diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index f7d536d..30af9fe 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -155,28 +155,28 @@ key_bindings: # BEGIN ACE colors: primary: - background: '0x0D0F11' - foreground: '0xabc8c1' + background: '0x0C130C' + foreground: '0xdedbcb' cursor: - text: '0x0D0F11' - cursor: '0xabc8c1' + text: '0x0C130C' + cursor: '0xdedbcb' normal: - black: '0x0D0F11' - red: '0x995F29' - green: '0xBC5127' - yellow: '0x61906A' - blue: '0xF39D2F' - magenta: '0xC4A24A' - cyan: '0xF8D562' - white: '0xabc8c1' + black: '0x0C130C' + red: '0x606855' + green: '0x946634' + yellow: '0x718778' + blue: '0xB29863' + magenta: '0x7A9083' + cyan: '0xA3AA95' + white: '0xdedbcb' bright: - black: '0x778c87' - red: '0x995F29' - green: '0xBC5127' - yellow: '0x61906A' - blue: '0xF39D2F' - magenta: '0xC4A24A' - cyan: '0xF8D562' - white: '0xabc8c1' + black: '0x9b998e' + red: '0x606855' + green: '0x946634' + yellow: '0x718778' + blue: '0xB29863' + magenta: '0x7A9083' + cyan: '0xA3AA95' + white: '0xdedbcb' # END ACE diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index 3ccfd98..74658f6 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -10,7 +10,7 @@ padding = 8 horizontal_padding = 8 frame_width = 1 - frame_color = "#363846" + frame_color = "#B29863" # Define a color for the separator. # possible values are: @@ -75,21 +75,21 @@ [urgency_low] # IMPORTANT: colors have to be defined in quotation marks. # Otherwise the "#" and following would be interpreted as a comment. - background = "#0D0C0B" - foreground = "#363846" + background = "#0C130C" + foreground = "#B29863" timeout = 5 # Icon for notifications with low urgency, uncomment to enable #icon = /path/to/icon [urgency_normal] - background = "#0D0C0B" - foreground = "#363846" + background = "#0C130C" + foreground = "#B29863" timeout = 5 [urgency_critical] - background = "#0D0C0B" - foreground = "#363846" - frame_color = "#363846" + background = "#0C130C" + foreground = "#B29863" + frame_color = "#B29863" timeout = 0 # Every section that isn't one of the above is interpreted as a rules to diff --git a/.config/i3/config b/.config/i3/config index dedee5a..718cf50 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -232,20 +232,20 @@ bindsym XF86MonBrightnessDown exec xrandr --output eDP1 --brightness 1.4 # decre # startup exec_always --no-startup-id $HOME/.config/polybar/launch.sh -exec --no-startup-id ~/bin/autoconfgure_display.sh -exec --no-startup-id i3-msg 'workspace 1; exec $TERMINAL; workspace 2; exec chromium;' +### exec --no-startup-id ~/bin/autoconfgure_display.sh +### exec --no-startup-id i3-msg 'workspace 1; exec $TERMINAL; workspace 2; exec chromium;' #exec --no-startup-id feh --bg-scale ~/Wallpapers/seneca.jpg -exec --no-startup-id picom --config ~/.config/i3/picom.conf -b +### exec --no-startup-id picom --config ~/.config/i3/picom.conf -b #exec --no-startup-id xset dpms 500 -exec --no-startup-id nm-applet --sm-disable -exec --no-startup-id pasystray -exec --no-startup-id joplin-desktop +### exec --no-startup-id nm-applet --sm-disable +### exec --no-startup-id pasystray +### exec --no-startup-id joplin-desktop exec --no-startup-id clipit #exec --no-startup-id xautolock -time 10 -locker "betterlockscreen -l dim" -exec --no-startup-id ~/bin/dunstwal -exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +### exec --no-startup-id ~/bin/dunstwal +### exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 -exec telegram-desktop +### exec telegram-desktop #exec mattermost-desktop exec --no-startup-id sleep 4; i3-msg '[class="Telegram"] move scratchpad' diff --git a/.config/lf/lfrc b/.config/lf/lfrc new file mode 100644 index 0000000..c7cd4c4 --- /dev/null +++ b/.config/lf/lfrc @@ -0,0 +1,177 @@ +## Basic Settings +### interpreter for shell commands (needs to be POSIX compatible) +set shell sh +### view hidden files +set hidden +set info size:time +set previewer lf-preview.sh +#set previewer /usr/bin/pistol +### Enable icons. Requires nerd fonts and LF_ICONS variable. +set icons +set ignorecase true + +### set '-eu' options for shell commands +### These options are used to have safer shell commands. Option '-e' is used to +### exit on error and option '-u' is used to give error for unset variables. +### Option '-f' disables pathname expansion which can be useful when $f, $fs, and +### $fx variables contain names with '*' or '?' characters. However, this option +### is used selectively within individual commands as it can be limiting at +### times. +set shellopts '-eu' + +### set internal field separator (IFS) to "\n" for shell commands +### This is useful to automatically split file names in $fs and $fx properly +### since default file separator used in these variables (i.e. 'filesep' option) +### is newline. You need to consider the values of these options and create your +### commands accordingly. +set ifs "\n" + +### leave some space at the top and the bottom of the screen +set scrolloff 10 + +## Custom Functions + +### define a custom 'open' command +cmd open ${{ + case $(file --mime-type $f -b) in + application/x-gtar|application/gzip|application/x-bzip2|application/x-rar|application/zip|application/x-iso9660-image|application/x-xz) + mntdir="$f-archivemount" + [ ! -d "$mntdir" ] && { + mkdir "$mntdir" + archivemount "$f" "$mntdir" + echo "$mntdir" >> "/tmp/__lf_archivemount_$id" + } + lf -remote "send $id cd \"$mntdir\"" + lf -remote "send $id reload" + ;; + text/*|*/json) $EDITOR "$f";; + *) for f in $fx; do $OPENER "$f" > /dev/null 2> /dev/null & done;; + esac +}} + +### define a custom 'rename' command without prompt for overwrite +# cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 +# map r push :rename + +cmd trash ${{ + for file in $fs; do + trash-put "$file" + done +}} + +cmd trash_clear %trash_empty + +cmd trash_restore ${{ + trash-restore +}} + +cmd mkdir %mkdir -p "$(echo $* | tr ' ' '\ ')" +map a push :mkdir + +cmd mkfile ${{ + $EDITOR $1 +}} + +cmd sudomkfile ${{ + sudo $EDITOR $1 +}} + +cmd setwallpaper ${{ + swaymsg output "*" background "$f" stretch +}} + +cmd chmod ${{ + for file in "$fx"; do chmod $1 $file; done + lf -remote 'send reload' +}} + +### extract the current file with the right command +### (xkcd link: https://xkcd.com/1168/) +cmd extract ${{ + set -f + case $f in + *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;; + *.tar.gz|*.tgz) tar xzvf $f;; + *.tar.xz|*.txz) tar xJvf $f;; + *.zip) unzip $f;; + *.rar) unrar x $f;; + *.7z) 7z x $f;; + *) echo "Unsupported format";; + esac +}} + +### compress current file or selected files with tar and gunzip +cmd tar ${{ + set -f + mkdir $1 + cp -r $fx $1 + tar czf $1.tar.gz $1 + rm -rf $1 +}} + +### compress current file or selected files with zip +cmd zip ${{ + set -f + mkdir $1 + cp -r $fx $1 + zip -r $1.zip $1 + rm -rf $1 +}} + +cmd paste &{{ + load=$(lf -remote 'load') + mode=$(echo "$load" | sed -n '1p') + list=$(echo "$load" | sed '1d') + if [ $mode = 'copy' ]; then + rsync -av --progress $list . \ + | stdbuf -i0 -o0 -e0 tr '\r' '\n' \ + | while read line; do + lf -remote "send $id echo $line" + done + elif [ $mode = 'move' ]; then + mv -n $list . + fi + lf -remote 'send load' + lf -remote 'send clear' +}} + +cmd drag &{{ + dragon-drag-and-drop -a -x $fx +}} + +cmd broot_jump ${{ + f=$(mktemp) + res="$(broot --outcmd $f && cat $f | sed 's/cd //')" + rm -f "$f" + if [ -f "$res" ]; then + cmd="select" + elif [ -d "$res" ]; then + cmd="cd" + fi + lf -remote "send $id $cmd \"$res\"" +}} + +#cmd bulkrename $vdir +#cmd bulkrename $qmv -f do -a +cmd bulkrename $edir -a + +## Bindings + +# map trash +map delete + +map f broot_jump + +### use enter for shell commands +map shell + +### execute current file (must be executable) +#map x $$f +#map X !$f + +### dedicated keys for file opener actions +#map o &mimeopen $f +#map O $mimeopen --ask $f + +map R bulkrename + diff --git a/.config/sway/bin/dmenuscreenshare.sh b/.config/sway/bin/dmenuscreenshare.sh new file mode 100755 index 0000000..f6d05f5 --- /dev/null +++ b/.config/sway/bin/dmenuscreenshare.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +## Shows a dropdown menu to start, stop or view the status of screensharing + +case "$(echo -e " Start\n Stop\n Status" | bemenu-run.sh -l 4 -p "Screensharing:")" in +" Start") screenshare.sh ;; +" Stop") screenshare.sh stop ;; +" Status") screenshare.sh is-recording ;; +esac diff --git a/.config/sway/bin/lock.sh b/.config/sway/bin/lock.sh new file mode 100755 index 0000000..7098b48 --- /dev/null +++ b/.config/sway/bin/lock.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +swaylock --daemonize \ + --indicator-radius 100 \ + --indicator-thickness 12 \ + --ring-color 2E3440 \ + --key-hl-color ECEFF4 \ + --line-color 88C0D0 \ + --inside-color 00000088 \ + --separator-color 00000000 \ + --text-color ECEFF4 \ + --text-caps-lock-color ECEFF4 \ + --show-failed-attempts \ + -i /home/paramah/Wallpapers/relax.png \ No newline at end of file diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 0000000..8ccb544 --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,43 @@ +# Default config for sway +# +# Copy this to ~/.config/sway/config and edit it to your liking. +# +# Read `man 5 sway` for a complete reference. + +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +set $alt Mod1 + +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term alacritty +# Your preferred application launcher +# Note: pass the final command to swaymsg so that the resulting window can be opened +# on the original workspace that the command was run on. +set $menu dmenu_path | dmenu | xargs swaymsg exec -- + +font Terminus 9 +gaps inner 10 +default_border none +default_border normal 0 + +### Output configuration +# +# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/) +# output * bg ~/Wallpapers/deusex.jpg fill + + +#for_window [app_id="^launcher$"] floating enable, sticky enable, resize set 30 ppt 60 ppt, border pixel 10 +#set $menu exec $term --class=launcher -e /home/paramah/bin/sway-launcher-desktop.sh +#bindsym $mod+d exec $menu + +# include @sysconfdir@/sway/config.d/* + + +include $HOME/.config/sway/sway.d/*.conf diff --git a/.config/sway/sway.d/01-general.conf b/.config/sway/sway.d/01-general.conf new file mode 100644 index 0000000..8f2aebb --- /dev/null +++ b/.config/sway/sway.d/01-general.conf @@ -0,0 +1,2 @@ +#general +set $BIN_DIR ~/.config/sway/bin \ No newline at end of file diff --git a/.config/sway/sway.d/02-layout.conf b/.config/sway/sway.d/02-layout.conf new file mode 100644 index 0000000..f742d35 --- /dev/null +++ b/.config/sway/sway.d/02-layout.conf @@ -0,0 +1,30 @@ +default_border none +titlebar_border_thickness 1 +titlebar_padding 5 + +hide_edge_borders both +hide_edge_borders smart +hide_edge_borders --i3 both +hide_edge_borders --i3 smart + + + +# Create only gaps if more then one container +## smart_gaps on + +#new_float none +## default_border pixel 2 +# Hide borders if there is only one child in a workspace or container +## hide_edge_borders --i3 smart_no_gaps + + + +include ~/.cache/wal/colors-sway +# class border backgr. text indicator child_border +client.focused $color6 $background $foreground $color6 $color6 +client.focused_inactive $color3 $background $foreground $color3 $color3 +client.unfocused $color2 $background $color1 $color2 $color2 +client.urgent $foreground $background $color7 $foreground $foreground + + +output * bg ~/Wallpapers/deusex.jpg fill \ No newline at end of file diff --git a/.config/sway/sway.d/03-workspace.conf b/.config/sway/sway.d/03-workspace.conf new file mode 100644 index 0000000..b85795b --- /dev/null +++ b/.config/sway/sway.d/03-workspace.conf @@ -0,0 +1,13 @@ +# Define names for workspaces + +set $ws1 "1: terminal " +set $ws2 "2: web " +set $ws3 "3: code " + +workspace 1 output eDP1 +workspace 2 output eDP1 +workspace 3 output DP-3 + + + + diff --git a/.config/sway/sway.d/04-input.conf b/.config/sway/sway.d/04-input.conf new file mode 100644 index 0000000..4ab32ca --- /dev/null +++ b/.config/sway/sway.d/04-input.conf @@ -0,0 +1,20 @@ + +### Input configuration +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# natural_scroll enabled +# middle_emulation enabled +# } +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + +### Input configuration (man 5 sway-input / swaymsg -t get_inputs) + +input "1:1:AT_Translated_Set_2_keyboard" { + xkb_layout pl +} diff --git a/.config/sway/sway.d/05-output.conf b/.config/sway/sway.d/05-output.conf new file mode 100644 index 0000000..ada65fb --- /dev/null +++ b/.config/sway/sway.d/05-output.conf @@ -0,0 +1,25 @@ +# +# Example configuration: +# +# output HDMI-A-1 resolution 1920x1080 position 1920,0 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs + + + +output "eDP-1" { + mode 1920x1080@60Hz + pos 1920 0 + transform normal +} +output "DP-3" { + mode 1920x1080@60Hz + pos 3840 0 + transform normal +} +output "DP-4" { + mode 1920x1080@60Hz + pos 0 0 + transform normal +} + diff --git a/.config/sway/sway.d/06-floating.conf b/.config/sway/sway.d/06-floating.conf new file mode 100644 index 0000000..5402d4c --- /dev/null +++ b/.config/sway/sway.d/06-floating.conf @@ -0,0 +1,13 @@ +#for_window [class="^.*"] title_format "%title [%class]" +#for_window [class="^.*"] border pixel 0 +for_window [class="Telegram"] move scratchpad, border pixel 1 +for_window [class="Mattermost"] resize set 900 600, move scratchpad, border pixel 1 +for_window [class="discord"] move scratchpad, border pixel 1 +for_window [window_role="floating"] floating enable +for_window [class="QSyncthingTray"] floating enable +for_window [class="Thunderbird" window_type="normal"] move scratchpad, floating enable, resize set 1600 1050, border pixel 2 +for_window [class="Nautilus"] floating enable +for_window [class="Gnome-calculator"] floating enable +for_window [class="zoom"] move scratchpad, floating enable +for_window [class="Signal"] move scratchpad + diff --git a/.config/sway/sway.d/07-hotkeys.conf b/.config/sway/sway.d/07-hotkeys.conf new file mode 100644 index 0000000..1e40975 --- /dev/null +++ b/.config/sway/sway.d/07-hotkeys.conf @@ -0,0 +1,193 @@ +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + # bindsym $mod+d exec $menu + bindsym $mod+d exec --no-startup-id rofi-appsmenu + + # Drag floating windows by holding down $mod and left mouse button. + # 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 + bindsym $mod+Shift+c reload + + # Exit sway (logs you out of your Wayland session) + bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right +# +# Workspaces: +# + # Switch to workspace + bindsym $mod+1 workspace number 1 + bindsym $mod+2 workspace number 2 + bindsym $mod+3 workspace number 3 + bindsym $mod+4 workspace number 4 + bindsym $mod+5 workspace number 5 + bindsym $mod+6 workspace number 6 + bindsym $mod+7 workspace number 7 + bindsym $mod+8 workspace number 8 + bindsym $mod+9 workspace number 9 + bindsym $mod+0 workspace number 10 + # Move focused container to workspace + bindsym $mod+Shift+1 move container to workspace number 1 + bindsym $mod+Shift+2 move container to workspace number 2 + bindsym $mod+Shift+3 move container to workspace number 3 + bindsym $mod+Shift+4 move container to workspace number 4 + bindsym $mod+Shift+5 move container to workspace number 5 + bindsym $mod+Shift+6 move container to workspace number 6 + bindsym $mod+Shift+7 move container to workspace number 7 + bindsym $mod+Shift+8 move container to workspace number 8 + bindsym $mod+Shift+9 move container to workspace number 9 + bindsym $mod+Shift+0 move container to workspace number 10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show + +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + + +## Screenshot // Screenshot active display // ## +#bindsym Print exec $BIN_DIR/screenshots.sh display +#bindsym --locked Print exec grim -o "$(swaymsg --type get_outputs --raw | jq -r '.[] | select(.focused) | .name')" - | swappy -f - +bindsym --locked Print exec /usr/share/sway/scripts/grimshot --notify save area - | swappy -f - + +## Screenshot // Screenshot current window // <> ## +#bindsym $mod+Print exec $BIN_DIR/screenshots.sh window +#bindsym $mod+Print exec swaymsg -t get_tree | jq -r '.. | (.nodes? // empty)[] | select(.focused) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | grim -g - - | swappy -f - +bindsym $mod+Print exec /usr/share/sway/scripts/grimshot --notify save active - | swappy -f - + +## Modify // Monitor brightness up // ## +#bindsym XF86MonBrightnessUp exec light -A 5 +bindsym --locked XF86MonBrightnessUp exec brightnessctl set +5% + +## Modify // Monitor brightness down // ## +#bindsym XF86MonBrightnessDown exec light -U 5 +bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%- + +## Modify // Volume up // ## +#bindsym XF86AudioRaiseVolume exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5% +bindsym --locked XF86AudioRaiseVolume exec volumectl up + +## Modify // Volume down // ## +#bindsym XF86AudioLowerVolume exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5% +bindsym --locked XF86AudioLowerVolume exec volumectl down + +## Modify // Volume mute // ## +#bindsym XF86AudioMute exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle +bindsym --locked XF86AudioMute exec volumectl toggle + +## Modify // Mic mute // ## +bindsym --locked XF86AudioMicMute exec amixer -D pulse sset Capture toggle && notify-send -t 1000 "Microphone state toggled" + +## Notifications // Dismiss notification // ## +bindsym $alt+space exec makoctl dismiss +## Notifications // Dismiss all notifications // ## +bindsym Shift+$alt+space exec makoctl dismiss --all + + +## Launch // Screen sharing // <> x ## +bindsym $mod+x exec $BIN_DIR/dmenuscreenshare.sh + +bindsym $mod+p [class="Mattermost"] scratchpad show +bindsym $mod+Shift+m [class="Thunderbird"] scratchpad show + +bindsym $mod+i exec --no-startup-id rofi -show window -theme /usr/share/rofi-menus-git/themes/appsmenu.rasi +bindsym $mod+Shift+o exec --no-startup-id rofi-vpn +bindsym $mod+o exec --no-startup-id ~/.config/rofi/scripts/sound.sh + +bindsym $mod+y exec clipman pick -t rofi + + diff --git a/.config/sway/sway.d/08-idle.conf b/.config/sway/sway.d/08-idle.conf new file mode 100644 index 0000000..a34c646 --- /dev/null +++ b/.config/sway/sway.d/08-idle.conf @@ -0,0 +1,12 @@ +### Idle configuration +# +# Example configuration: +# +# exec swayidle -w \ +# timeout 300 'swaylock -f -c 000000' \ +# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ +# before-sleep 'swaylock -f -c 000000' +# +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. diff --git a/.config/sway/sway.d/09-swaybar.conf b/.config/sway/sway.d/09-swaybar.conf new file mode 100644 index 0000000..ebd2dc7 --- /dev/null +++ b/.config/sway/sway.d/09-swaybar.conf @@ -0,0 +1,21 @@ +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. + +# include ~/.cache/wal/colors-sway + +# bar { +# position top + +# # When the status_command prints a new line to stdout, swaybar updates. +# # The default just shows the current date and time. +# status_command while date +'%Y-%m-%d %H:%M:%S %p'; do sleep 1; done + +# colors { +# statusline $background +# background $color2 +# inactive_workspace $color2 $color2 $background +# focused_workspace $color2 $background $foreground +# } +# } diff --git a/.config/sway/sway.d/10-autostart.conf b/.config/sway/sway.d/10-autostart.conf new file mode 100644 index 0000000..bf33bb4 --- /dev/null +++ b/.config/sway/sway.d/10-autostart.conf @@ -0,0 +1,17 @@ +exec --no-startup-id swaymsg 'workspace 1; exec $TERMINAL; workspace 2; exec brave-browser-nightly;' + +exec wl-paste -t text --watch clipman store +exec nm-applet --indicator + +set $gnome-schema org.gnome.desktop.interface +exec_always { + gsettings set org.gtk.Settings.FileChooser window-size '(1100,700)' + gsettings set org.gnome.desktop.default-applications.terminal exec alacritty + gsettings set org.gnome.desktop.default-applications.terminal exec-arg -e + gsettings set org.gnome.desktop.wm.preferences button-layout '' +} + +exec "hash dbus-update-activation-environment 2>/dev/null; \ + dbus-update-activation-environment --all; \ + dbus-update-activation-environment --systemd; \ + systemctl --user start sway-session.target" diff --git a/.config/systemd/user/default.target.wants/mouse.service b/.config/systemd/user/default.target.wants/mouse.service new file mode 120000 index 0000000..89ccafa --- /dev/null +++ b/.config/systemd/user/default.target.wants/mouse.service @@ -0,0 +1 @@ +/home/paramah/.config/systemd/user/mouse.service \ No newline at end of file diff --git a/.config/systemd/user/mako.service b/.config/systemd/user/mako.service new file mode 100644 index 0000000..c05b06b --- /dev/null +++ b/.config/systemd/user/mako.service @@ -0,0 +1,19 @@ +[Unit] +Description=Lightweight Wayland notification daemon +Documentation=man:mako(1) +PartOf=sway-session.target +After=sway-session.target + +[Service] +Type=dbus +BusName=org.freedesktop.Notifications +ExecCondition=/bin/sh -c '[ -n "$WAYLAND_DISPLAY" ]' +ExecStart=/usr/bin/mako +ExecReload=/usr/bin/makoctl reload +ExecStop=/bin/kill -2 $MAINPID +Restart=on-failure +RestartSec=1 +TimeoutStopSec=10 + +[Install] +WantedBy=sway-session.target diff --git a/.config/systemd/user/mouse.service b/.config/systemd/user/mouse.service new file mode 100644 index 0000000..d049bc5 --- /dev/null +++ b/.config/systemd/user/mouse.service @@ -0,0 +1,8 @@ +[Unit] +Description=Mouse Protocol + +[Service] +ExecStart=sudo echo -n "elantech" > /sys/bus/serio/devices/serio1/protocol + +[Install] +WantedBy=default.target diff --git a/.config/systemd/user/polkit-gnome.service b/.config/systemd/user/polkit-gnome.service new file mode 100644 index 0000000..88853a1 --- /dev/null +++ b/.config/systemd/user/polkit-gnome.service @@ -0,0 +1,14 @@ +[Unit] +Description=Legacy polkit authentication agent for GNOME +PartOf=sway-session.target + +[Service] +Type=simple +ExecStart=/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +ExecStop=/bin/kill -2 $MAINPID +Restart=on-failure +RestartSec=1 +TimeoutStopSec=10 + +[Install] +WantedBy=sway-session.target diff --git a/.config/systemd/user/sway-session.target b/.config/systemd/user/sway-session.target new file mode 100644 index 0000000..30151b3 --- /dev/null +++ b/.config/systemd/user/sway-session.target @@ -0,0 +1,6 @@ +[Unit] +Description=sway compositor session +Documentation=man:systemd.special(7) +BindsTo=graphical-session.target +Wants=graphical-session-pre.target +After=graphical-session-pre.target diff --git a/.config/systemd/user/sway-session.target.wants/polkit-gnome.service b/.config/systemd/user/sway-session.target.wants/polkit-gnome.service new file mode 120000 index 0000000..e9b3ef9 --- /dev/null +++ b/.config/systemd/user/sway-session.target.wants/polkit-gnome.service @@ -0,0 +1 @@ +/home/paramah/.config/systemd/user/polkit-gnome.service \ No newline at end of file diff --git a/.config/systemd/user/sway-session.target.wants/swayidle.service b/.config/systemd/user/sway-session.target.wants/swayidle.service new file mode 120000 index 0000000..8b7bf05 --- /dev/null +++ b/.config/systemd/user/sway-session.target.wants/swayidle.service @@ -0,0 +1 @@ +/home/paramah/.config/systemd/user/swayidle.service \ No newline at end of file diff --git a/.config/systemd/user/sway-session.target.wants/waybar.service b/.config/systemd/user/sway-session.target.wants/waybar.service new file mode 120000 index 0000000..8d982d2 --- /dev/null +++ b/.config/systemd/user/sway-session.target.wants/waybar.service @@ -0,0 +1 @@ +/home/paramah/.config/systemd/user/waybar.service \ No newline at end of file diff --git a/.config/systemd/user/swayidle.service b/.config/systemd/user/swayidle.service new file mode 100644 index 0000000..e153808 --- /dev/null +++ b/.config/systemd/user/swayidle.service @@ -0,0 +1,15 @@ +[Unit] +Description=Idle manager for Wayland +Documentation=man:swayidle(1) +PartOf=sway-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/swayidle -w timeout 300 '%h/.config/sway/bin/lock.sh' timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep '%h/.config/sway/bin/lock.sh' +ExecStop=/bin/kill -2 $MAINPID +Restart=on-failure +RestartSec=1 +TimeoutStopSec=10 + +[Install] +WantedBy=sway-session.target diff --git a/.config/systemd/user/waybar.service b/.config/systemd/user/waybar.service new file mode 100644 index 0000000..6aa01eb --- /dev/null +++ b/.config/systemd/user/waybar.service @@ -0,0 +1,17 @@ +[Unit] +Description=A lightweight Wayland statusbar +Documentation=man:waybar(1) +PartOf=sway-session.target + +[Service] +Type=simple +Environment="XDG_CURRENT_DESKTOP=Unity" +ExecStart=/usr/bin/waybar +ExecReload=kill -SIGUSR2 $MAINPID +ExecStop=/bin/kill -2 $MAINPID +Restart=on-failure +RestartSec=1 +TimeoutStopSec=10 + +[Install] +WantedBy=sway-session.target diff --git a/.config/waybar/bin/level.sh b/.config/waybar/bin/level.sh new file mode 100755 index 0000000..7008170 --- /dev/null +++ b/.config/waybar/bin/level.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +TYPE=$1 +DATA=$(cat /tmp/czujnik-levels |jq -r .$TYPE |grep -v null) + +echo $TYPE\($DATA%\) diff --git a/.config/waybar/bin/sensor.sh b/.config/waybar/bin/sensor.sh new file mode 100755 index 0000000..d540471 --- /dev/null +++ b/.config/waybar/bin/sensor.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +TYPE=$1 +DATA=$(cat /tmp/czujnik |jq -r .$TYPE |grep -v null) + +echo $DATA + diff --git a/.config/waybar/config b/.config/waybar/config new file mode 100644 index 0000000..729b035 --- /dev/null +++ b/.config/waybar/config @@ -0,0 +1,203 @@ +// -*- mode: json -*- +[ + { + "layer": "middle", + "position": "top", + + "modules-left": [ + "sway/workspaces", + "custom/right-arrow-dark" + ], + "modules-center": [ + "sway/window" + ], + "modules-right": [ + "custom/left-arrow-dark", + "pulseaudio", + "custom/left-arrow-light", + "custom/left-arrow-dark", + "memory", + "custom/left-arrow-light", + "custom/left-arrow-dark", + "cpu", + "custom/left-arrow-light", + "custom/left-arrow-dark", + "disk", + "custom/left-arrow-light", + "custom/left-arrow-dark", + "clock#1", + "custom/left-arrow-light", + "custom/left-arrow-dark", + "clock#2", + "custom/right-arrow-dark", + "custom/right-arrow-light", + "clock#3" + ], + + "custom/left-arrow-dark": { + "format": "", + "tooltip": false + }, + "custom/left-arrow-light": { + "format": "", + "tooltip": false + }, + "custom/right-arrow-dark": { + "format": "", + "tooltip": false + }, + "custom/right-arrow-light": { + "format": "", + "tooltip": false + }, + + "sway/workspaces": { + "disable-scroll": true, + "format": "{name}" + }, + + "clock#1": { + "format": "{:%a}", + "tooltip": false + }, + "clock#2": { + "format": "{:%H:%M}", + "tooltip": false + }, + "clock#3": { + "format": "{:%m-%d}", + "tooltip": false + }, + + "pulseaudio": { + "format": "{icon} {volume:2}%", + "format-bluetooth": "{icon} {volume}%", + "format-muted": "MUTE", + "format-icons": { + "headphones": "", + "default": [ + "", + "" + ] + }, + "scroll-step": 5, + "on-click": "pamixer -t", + "on-click-right": "pavucontrol" + }, + "memory": { + "interval": 5, + "format": "Mem {}%" + }, + "cpu": { + "interval": 5, + "format": "CPU {usage:2}%" + }, + "disk": { + "interval": 5, + "format": "Disk {percentage_used:2}%", + "path": "/" + } + }, + + { + "layer": "bottom", + "position": "bottom", + + "modules-left": [ + "battery", + "custom/right-arrow-dark", + "custom/right-arrow-light", + "custom/temperature", + "custom/right-arrow-dark", + "custom/right-arrow-light", + "custom/hum", + "custom/right-arrow-dark", + "custom/right-arrow-light", + "custom/pressure", + "custom/right-arrow-dark", + "custom/right-arrow-light", + "custom/pm_25", + "custom/right-arrow-dark", + "custom/right-arrow-light", + "custom/pm_10", + "custom/right-arrow-dark" + ], + "modules-center": [ + ], + "modules-right": [ + "tray" + ], + + "custom/left-arrow-dark": { + "format": "", + "tooltip": false + }, + "custom/left-arrow-light": { + "format": "", + "tooltip": false + }, + "custom/right-arrow-dark": { + "format": "", + "tooltip": false + }, + "custom/right-arrow-light": { + "format": "", + "tooltip": false + }, + + "custom/temperature": { + "format": "temp {}", + "return-type": "text", + "interval": 60, + "exec": "$HOME/.config/waybar/bin/sensor.sh temperature" + }, + + "custom/hum": { + "format": "wil {}", + "return-type": "text", + "interval": 60, + "exec": "$HOME/.config/waybar/bin/sensor.sh humidity" + }, + + "custom/pressure": { + "format": "ciś {}", + "return-type": "text", + "interval": 60, + "exec": "$HOME/.config/waybar/bin/sensor.sh air_pressure" + }, + + "custom/pm_25": { + "format": "pm2.5 {}", + "return-type": "text", + "interval": 60, + "exec": "$HOME/.config/waybar/bin/sensor.sh pm2_5" + }, + + "custom/pm_10": { + "format": "pm10 {}", + "return-type": "text", + "interval": 60, + "exec": "$HOME/.config/waybar/bin/sensor.sh pm10" + }, + + "battery": { + "states": { + "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{icon} {capacity}%", + "format-icons": [ + "", + "", + "", + "", + "" + ] + }, + "tray": { + "icon-size": 10, + "spacing": 6 + } + } +] \ No newline at end of file diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100644 index 0000000..86c547f --- /dev/null +++ b/.config/waybar/style.css @@ -0,0 +1,83 @@ +* { + font-size: 10px; + font-family: Terminus; +} + +window#waybar { + background: #292b2e; + color: #fdf6e3; +} + +#custom-right-arrow-dark, +#custom-left-arrow-dark { + color: #1a1a1a; +} +#custom-right-arrow-light, +#custom-left-arrow-light { + color: #292b2e; + background: #1a1a1a; +} + +#workspaces, +#clock.1, +#clock.2, +#clock.3, +#pulseaudio, +#memory, +#cpu, +#battery, +#disk, +#tray { + background: #1a1a1a; +} + +#custom-temperature, +#custom-hum, +#custom-pressure, +#custom-pm_25, +#custom-pm_10 { + background: #1a1a1a; + padding: 2px 5px; +} + +#workspaces button { + padding: 0 2px; + color: #fdf6e3; +} +#workspaces button.focused { + color: #268bd2; +} +#workspaces button:hover { + box-shadow: inherit; + text-shadow: inherit; +} +#workspaces button:hover { + background: #1a1a1a; + border: #1a1a1a; + padding: 0 3px; +} + +#pulseaudio { + color: #268bd2; +} +#memory { + color: #2aa198; +} +#cpu { + color: #6c71c4; +} +#battery { + color: #859900; +} +#disk { + color: #b58900; +} + +#clock, +#pulseaudio, +#memory, +#cpu, +#battery, +#disk { + padding: 0 10px; +} diff --git a/.zshrc b/.zshrc index ed548fa..f8ae68e 100644 --- a/.zshrc +++ b/.zshrc @@ -210,7 +210,7 @@ mattermost-desktop () { # launch telegram and send it to scratchpad theme () { (wal -qi $WALLPAPER) - (feh --bg-scale $WALLPAPER) + (swaybg --bg-scale $WALLPAPER) (~/bin/alawal.sh) } @@ -269,7 +269,7 @@ gitc(){ ec2-list(){ aws ec2 describe-instances \ --filter "Name=instance-state-name,Values=running" \ - --query "Reservations[*].Instances[*].[PublicIpAddress, Tags[?Key=='Name'].Value|[0], LaunchTime, InstanceId]" \ + --query "Reservations[*].Instances[*].[PublicIpAddress, Tags[?Key=='Name'].Value|[0],PrivateIpAddress, LaunchTime, InstanceId]" \ --output table } @@ -323,5 +323,14 @@ mh() { xrandr --output DP1-2 --auto --left-of eDP1 theme } + +mb() { + xrandr --output DP1-1-1 --auto --right-of eDP1 + xrandr --output DP1-1-8 --auto --left-of eDP1 + theme +} + export PAGER=bat + +alias ls="exa" #cat ~/.ideas