restructure config

This commit is contained in:
rileyrg 2021-05-26 23:41:31 +02:00
parent a4439cdacc
commit 0d916d9865
5 changed files with 212 additions and 215 deletions

View file

@ -3,6 +3,6 @@
id="${LAPTOP_ID:-"eDP-1"}"
displays="$(swaymsg -t get_outputs | jq -r '.[0]')"
if [ -z "$(jq '.|select(.name=="$id") | .name' <<< $displays)" ];then
id="$(jq -r '[.][0].name' <<< $displays)"
id="$(jq -r '[.][0].name' <<< $displays)"
fi
echo $id

View file

@ -1,3 +1,3 @@
#!/usr/bin/bash
#Maintained in linux-config.org
#Maintained in linux-config.org
swaymsg "[title=ScratchTerminal] scratchpad show " || ( sway-notify "created new scratchpad terminal" && alacritty --title "ScratchTerminal" --command bash -c "tmux new-session -A -s ScratchTerminal")

View file

@ -1,3 +1,3 @@
{
output eDP-1 enable position 0,0
output eDP-1 enable position 0,0
}

View file

@ -9,18 +9,6 @@ for_window [title="sway-launcher"] floating enable
set $term 'sway-scratch-terminal'
set $editor 'sway-editor'
set $wallpaper "~/Pictures/Wallpapers/current"
set $laptop-id `sway-laptop-id`
set $trans 0.8
set $alphamark "α"
for_window [con_mark=$alphamark] opacity set $trans
bindsym $mod+Control+a mark --toggle "$alphamark" ; [con_id=__focused__] opacity set 1 ; [con_mark=$alphamark con_id=__focused__] opacity set $trans
set $monitor `swaymsg -t get_outputs | jq -r '.[0].name')`
exec sleep 2 && sway-notify $monitor
include /etc/sway/config-vars.d/*
include config-vars.d/*
@ -40,11 +28,19 @@ bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
Bindsym $mod+Shift+r restart
output * bg $wallpaper fill
bindsym $mod+Shift+e exec $editor
bindsym $mod+d exec $menu
#+begin_src conf
set $wallpaper "~/Pictures/Wallpapers/current"
output * bg $wallpaper fill
set $trans 0.8
set $alphamark "α"
for_window [con_mark=$alphamark] opacity set $trans
bindsym $mod+Control+a mark --toggle "$alphamark" ; [con_id=__focused__] opacity set 1 ; [con_mark=$alphamark con_id=__focused__] opacity set $trans
set $laptop-id `sway-laptop-id`
bindswitch lid:on exec "sway-screen disable $laptop-id"
bindswitch lid:off exec "sway-screen enable $laptop-id"
@ -61,130 +57,130 @@ bindsym $mod+Return exec sway-scratch-terminal
for_window [title=ScratchTerminal] mark "$alphamark", move to scratchpad; [title=ScratchTerminal] scratchpad show
# change focus
# bindsym $mod+h focus left
# bindsym $mod+j focus down
# bindsym $mod+k focus up
# bindsym $mod+l focus right
# bindsym $mod+h focus left
# bindsym $mod+j focus down
# bindsym $mod+k focus up
# bindsym $mod+l focus right
bindsym $mod+o focus left
bindsym $mod+o focus left
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor 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
# alternatively, you can use the cursor 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
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floatving
bindsym $mod+Shift+space floating toggle
# toggle tiling / floatving
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the parent container
bindsym $mod+a focus parent
bindsym $mod+Shift+s sticky toggle
bindsym $mod+Shift+s sticky toggle
bindsym $mod+m move workspace to output left
bindsym $mod+Control+m exec sway-display-swap
bindsym $mod+Tab workspace back_and_forth
bindsym $mod+m move workspace to output left
bindsym $mod+Control+m exec sway-display-swap
bindsym $mod+Tab workspace back_and_forth
# focus the child container
#bindsym $mod+d focus child
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1:edit"
set $ws2 "2:research"
set $ws3 "3:shell"
set $ws4 "4:browse"
set $ws5 "5:dired"
set $ws6 "6:music"
set $ws7 "7:video"
set $ws8 "8:irc"
set $ws9 "9:steam"
set $ws10 "10"
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1:edit"
set $ws2 "2:research"
set $ws3 "3:shell"
set $ws4 "4:browse"
set $ws5 "5:dired"
set $ws6 "6:music"
set $ws7 "7:video"
set $ws8 "8:irc"
set $ws9 "9:steam"
set $ws10 "10"
workspace $ws3 gaps inner 2
workspace $ws3 gaps outer 2
workspace $ws3 gaps inner 2
workspace $ws3 gaps outer 2
assign [title="dbg:"] $ws3
assign [title="dbg:"] $ws3
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
# bindsym $mod+0 workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym odiaeresis resize grow width 10 px or 10 ppt
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym odiaeresis resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
bindsym $mod+r mode "resize"
exec wl-paste -t text --watch clipman store --max-items=60 --histpath="~/.config/clipman/clipman.json"
bindsym $mod+y exec clipman pick --tool="wofi" --max-items=30 --

View file

@ -1307,18 +1307,6 @@ $XDG_DATA_HOME/dbus-1/services/org.freedesktop.Notifications.service
set $term 'sway-scratch-terminal'
set $editor 'sway-editor'
set $wallpaper "~/Pictures/Wallpapers/current"
set $laptop-id `sway-laptop-id`
set $trans 0.8
set $alphamark "α"
for_window [con_mark=$alphamark] opacity set $trans
bindsym $mod+Control+a mark --toggle "$alphamark" ; [con_id=__focused__] opacity set 1 ; [con_mark=$alphamark con_id=__focused__] opacity set $trans
set $monitor `swaymsg -t get_outputs | jq -r '.[0].name')`
exec sleep 2 && sway-notify $monitor
include /etc/sway/config-vars.d/*
include config-vars.d/*
@ -1338,15 +1326,28 @@ $XDG_DATA_HOME/dbus-1/services/org.freedesktop.Notifications.service
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
Bindsym $mod+Shift+r restart
output * bg $wallpaper fill
bindsym $mod+Shift+e exec $editor
bindsym $mod+d exec $menu
#+end_src
*** display
**** wallpaper
#+begin_src conf
,#+begin_src conf
set $wallpaper "~/Pictures/Wallpapers/current"
output * bg $wallpaper fill
#+end_src
#+end_src
**** transparency
#+begin_src conf
set $trans 0.8
set $alphamark "α"
for_window [con_mark=$alphamark] opacity set $trans
bindsym $mod+Control+a mark --toggle "$alphamark" ; [con_id=__focused__] opacity set 1 ; [con_mark=$alphamark con_id=__focused__] opacity set $trans
#+end_src
**** lid :lid:clamshell:
#+begin_src conf
set $laptop-id `sway-laptop-id`
bindswitch lid:on exec "sway-screen disable $laptop-id"
bindswitch lid:off exec "sway-screen enable $laptop-id"
#+end_src
@ -1355,10 +1356,10 @@ $XDG_DATA_HOME/dbus-1/services/org.freedesktop.Notifications.service
bindsym --locked XF86MonBrightnessUp exec --no-startup-id light -A 10 && sway-brightness-notify
bindsym --locked XF86MonBrightnessDown exec --no-startup-id light -U 10 && sway-brightness-notify
#+end_src
*** gaps
**** gaps
#+begin_src conf
gaps inner 2
gaps outer 2
gaps inner 2
gaps outer 2
#+end_src
*** scratchpad terminal
@ -1375,7 +1376,7 @@ I want a key to create and then toggle a terminal.
#+begin_src bash :tangle "~/bin/sway/sway-scratch-terminal"
#!/usr/bin/bash
#Maintained in linux-config.org
swaymsg "[title=ScratchTerminal] scratchpad show " || ( sway-notify "created new scratchpad terminal" && alacritty --title "ScratchTerminal" --command bash -c "tmux new-session -A -s ScratchTerminal")
swaymsg "[title=ScratchTerminal] scratchpad show " || ( sway-notify "created new scratchpad terminal" && alacritty --title "ScratchTerminal" --command bash -c "tmux new-session -A -s ScratchTerminal")
#+end_src
*** navigation :navigation
#+begin_src conf
@ -1464,7 +1465,7 @@ I want a key to create and then toggle a terminal.
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
# bindsym $mod+0 workspace number $ws10
# bindsym $mod+0 workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
@ -2125,9 +2126,9 @@ Load a host specific kanshi file if it exists
#+end_src
**** config
#+begin_src conf :tangle "dot-config/kanshi/config"
{
{
output eDP-1 enable position 0,0
}
}
#+end_src
**** config-thinkpadt14s
#+begin_src conf :tangle "dot-config/kanshi/config-thinkpadt14s"
@ -2251,7 +2252,7 @@ but in both cases we check if it exists in the sway tree, and, if not, set it it
id="${LAPTOP_ID:-"eDP-1"}"
displays="$(swaymsg -t get_outputs | jq -r '.[0]')"
if [ -z "$(jq '.|select(.name=="$id") | .name' <<< $displays)" ];then
id="$(jq -r '[.][0].name' <<< $displays)"
id="$(jq -r '[.][0].name' <<< $displays)"
fi
echo $id
#+end_src
@ -2482,91 +2483,91 @@ Thanks: https://www.reddit.com/r/linuxmasterrace/comments/k1bjkp/i_wrote_a_trivi
* Conky
** ~/.config/conky/conky.conf
#+begin_src conf :tangle "~/.config/conky/conky.conf"
--[[
Conky, a system monitor, based on torsmo
--[[
Conky, a system monitor, based on torsmo
Any original torsmo code is licensed under the BSD license
Any original torsmo code is licensed under the BSD license
All code written since the fork of torsmo is licensed under the GPL
All code written since the fork of torsmo is licensed under the GPL
Please see COPYING for details
Please see COPYING for details
Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
Copyright (c) 2005-2019 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
All rights reserved.
Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
Copyright (c) 2005-2019 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
]]
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
]]
conky.config = {
alignment = 'top_left',
background = false,
border_width = 1,
cpu_avg_samples = 2,
default_color = 'white',
default_outline_color = 'white',
default_shade_color = 'white',
double_buffer = true,
draw_borders = false,
draw_graph_borders = true,
draw_outline = false,
draw_shades = false,
extra_newline = false,
font = 'DejaVu Sans Mono:size=8',
gap_x = 60,
gap_y = 60,
minimum_height = 5,
minimum_width = 5,
net_avg_samples = 2,
no_buffers = true,
out_to_console = false,
out_to_ncurses = false,
out_to_stderr = false,
out_to_x = true,
own_window = true,
own_window_class = 'Conky',
own_window_type = 'desktop',
show_graph_range = false,
show_graph_scale = false,
stippled_borders = 0,
update_interval = 1.0,
uppercase = false,
use_spacer = 'none',
use_xft = true,
}
conky.config = {
alignment = 'top_left',
background = false,
border_width = 1,
cpu_avg_samples = 2,
default_color = 'white',
default_outline_color = 'white',
default_shade_color = 'white',
double_buffer = true,
draw_borders = false,
draw_graph_borders = true,
draw_outline = false,
draw_shades = false,
extra_newline = false,
font = 'DejaVu Sans Mono:size=8',
gap_x = 60,
gap_y = 60,
minimum_height = 5,
minimum_width = 5,
net_avg_samples = 2,
no_buffers = true,
out_to_console = false,
out_to_ncurses = false,
out_to_stderr = false,
out_to_x = true,
own_window = true,
own_window_class = 'Conky',
own_window_type = 'desktop',
show_graph_range = false,
show_graph_scale = false,
stippled_borders = 0,
update_interval = 1.0,
uppercase = false,
use_spacer = 'none',
use_xft = true,
}
conky.text = [[
${color grey}Info:$color ${scroll 32 Conky $conky_version - $sysname $nodename $kernel $machine}
$hr
${color grey}Uptime:$color $uptime
${color grey}Frequency (in MHz):$color $freq
${color grey}Frequency (in GHz):$color $freq_g
${color grey}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4}
${color grey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4}
${color grey}CPU Usage:$color $cpu% ${cpubar 4}
${color grey}Processes:$color $processes ${color grey}Running:$color $running_processes
$hr
${color grey}File systems:
conky.text = [[
${color grey}Info:$color ${scroll 32 Conky $conky_version - $sysname $nodename $kernel $machine}
$hr
${color grey}Uptime:$color $uptime
${color grey}Frequency (in MHz):$color $freq
${color grey}Frequency (in GHz):$color $freq_g
${color grey}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4}
${color grey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4}
${color grey}CPU Usage:$color $cpu% ${cpubar 4}
${color grey}Processes:$color $processes ${color grey}Running:$color $running_processes
$hr
${color grey}File systems:
/ $color${fs_used /}/${fs_size /} ${fs_bar 6 /}
${color grey}Networking:
Up:$color ${upspeed} ${color grey} - Down:$color ${downspeed}
$hr
${color grey}Name PID CPU% MEM%
${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
]]
${color grey}Networking:
Up:$color ${upspeed} ${color grey} - Down:$color ${downspeed}
$hr
${color grey}Name PID CPU% MEM%
${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
]]
#+end_src
* Radare
Reverse engineering packges [[https://radare.gitbooks.io/radare2book/content/first_steps/intro.html][radare2]].