diff --git a/bin/byzanz-window b/bin/byzanz-window deleted file mode 100755 index 5af4b41..0000000 --- a/bin/byzanz-window +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# Delay before starting -DELAY=5 - -# Sound notification to let one know when recording is about to start (and ends) -beep() { - paplay /usr/share/sounds/KDE-Im-Irc-Event.ogg & -} - -# Duration and output file -if [ $# -gt 0 ]; then - D="--duration=$@" -else - echo Default recording duration 10s to /tmp/recorded.gif - D="--duration=10 /tmp/recorded.gif" -fi -XWININFO=$(xwininfo) -read X < <(awk -F: '/Absolute upper-left X/{print $2}' <<< "$XWININFO") -read Y < <(awk -F: '/Absolute upper-left Y/{print $2}' <<< "$XWININFO") -read W < <(awk -F: '/Width/{print $2}' <<< "$XWININFO") -read H < <(awk -F: '/Height/{print $2}' <<< "$XWININFO") - -echo Delaying $DELAY seconds. After that, byzanz will start -for (( i=$DELAY; i>0; --i )) ; do - echo $i - sleep 1 -done - -beep -byzanz-record -c --verbose --delay=0 --x=$X --y=$Y --width=$W --height=$H $D -beep - diff --git a/bin/docked.sh b/bin/docked.sh index 3a9d287..dc85fbb 100755 --- a/bin/docked.sh +++ b/bin/docked.sh @@ -1,18 +1,20 @@ #!/bin/sh -# this script checks if the system is docked with the lid closed -# and if so, sets the correct DPI, disables the laptop screen, sets the DP-3 monitor as primary -# and loads the nvidia config for vsync options and sets the dithering depth to 8 -if [ `cat /sys/devices/platform/hp-wmi/dock` -eq 1 ] # && [[ `cat /proc/acpi/button/lid/LID/state` == *closed* ]] -then - echo "Using docked configuration with 27\" IPS screen" - #xrandr --output DP-3 --primary --preferred --output LVDS-0 --left-of DP-6 --off --dpi 109/DP-3 - xrandr --output DP-3 --primary --preferred --output LVDS-0 --off --dpi 109/DP-3 - nvidia-settings -a "0/XVideoSyncToDisplayID=DP-3" - echo "Xft.dpi: 109" | xrdb -merge -else - echo "Using laptop-only configuration" - xrandr --size 1920x1080 --output LVDS-0 --mode 1920x1080 --primary --preferred --rotate normal --pos 0x0 --output VGA-0 --off --output DP-3 --off --output DP-6 --off --dpi 146/LVDS-0 - nvidia-settings -l -a "0/XVideoSyncToDisplayID=LVDS-0" - echo "Xft.dpi: 146" | xrdb -merge +if swaymsg -t get_outputs | grep 36H03689019; then + echo should dock + swaymsg 'output "Unknown 0x00000000" enable position 0 0 mode 2560x1440@59.951Hz bg ~/wp/"001 - Aalborg.jpg" stretch, output "BenQ Corporation BenQ GW2765 36H03689019" enable position 2560 0 mode 2560x1440@59.951Hz bg ~/wp/"002 - Alkali.jpg" stretch, output eDP-1 disable' + ~/dotfiles/bin/setdpi.sh 109 + systemctl --user restart waybar +elif swaymsg -t get_outputs | grep GH85D7CK1CXL; then + echo should lumi + BG='bg /home/yorick/Lumiguide-Generic/"01. General/06. Branding/Logo/New Logo & Stationary 2019/Lumiguide logo"/lumiguide-logo-01.png fit '#fdf6e3'' + #BG='bg /home/yorick/Lumiguide-Generic/"01. General/06. Branding/Logo/New Logo & Stationary 2019/Lumiguide logo"/lumiguide-logo-02.png fit '#263238'' + swaymsg 'output eDP-1 enable position 0 1440 scale 2, output "Dell Inc. DELL U2715H GH85D7CK17FL" enable position 2560 0 '$BG', output "Dell Inc. DELL U2715H GH85D7CK1CXL" enable position 0 0 '$BG + ~/dotfiles/bin/setdpi.sh 109 + systemctl --user restart waybar + else + echo should undock + systemd-inhibit --what=handle-lid-switch sleep 45s & disown + swaymsg 'output * disable, output eDP-1 enable scale 2 position 0 0' + ~/dotfiles/bin/setdpi.sh 192 + systemctl --user restart waybar fi -feh --bg-fill ~/wp_roll/1633_layinginthegrass_1920x1080.jpg diff --git a/bin/periodic_screenshot.sh b/bin/periodic_screenshot.sh index 6d42480..10936df 100755 --- a/bin/periodic_screenshot.sh +++ b/bin/periodic_screenshot.sh @@ -1,11 +1,13 @@ -#!/bin/zsh +#!/usr/bin/env nix-shell +#!nix-shell -p bash -i bash grim libwebp -format="%Y-%m-%d_%H-%M_$(hostname).png" -exec="mv \$f $HOME/periodic_screenshot/" +mkdir -p ~/periodic_screenshot +while true; do + format="%Y-%m-%d_%H-%M_$(hostname).webp" -if [[ $(pidof X) -gt 0 ]]; then - DISPLAY=:0.0 xset -b - DISPLAY=:0.0 scrot -m $format -q 10 -e "$exec" - DISPLAY=:0.0 xset b -fi + if [[ $(pidof sway) -gt 0 ]]; then + WAYLAND_DISPLAY=wayland-0 grim -c -t ppm /dev/stdout | cwebp -near_lossless 60 -progress -o ~/periodic_screenshot/$(date +$format) -- - + fi + sleep 2m +done diff --git a/bin/screens/fz.sh b/bin/screens/fz.sh deleted file mode 100755 index 2b4d312..0000000 --- a/bin/screens/fz.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env nix-shell -#! nix-shell -i bash -p nitrogen xorg.xrandr -xrandr \ - --output VGA-1 --mode 1440x900 --pos 232x0 --rotate normal \ - --output eDP-1 --off \ - --output LVDS-1 --primary --mode 1920x1080 --pos 0x900 --rotate normal \ - --output DP-3 --off \ - --output DP-2 --off \ - --output DP-1 --mode 1920x1080 --pos 1920x900 --rotate normal -nitrogen --restore diff --git a/bin/screens/single.sh b/bin/screens/single.sh deleted file mode 100755 index 959b931..0000000 --- a/bin/screens/single.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env nix-shell -#! nix-shell -i bash -p nitrogen xorg.xrandr -xrandr \ - --output VGA-1 --off \ - --output eDP-1 --off \ - --output LVDS-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal \ - --output DP-3 --off \ - --output DP-2 --off \ - --output DP-1 --off -nitrogen --restore diff --git a/bin/screenshot_public.sh b/bin/screenshot_public.sh index 01c3e1a..9b4cd08 100755 --- a/bin/screenshot_public.sh +++ b/bin/screenshot_public.sh @@ -1,17 +1,15 @@ -#!/bin/sh - +#!/usr/bin/env bash +set -e + # Setup filename for the screenshot -myfile=$(date +%Y%m%d%H%M%S).png +myfile="$(openssl rand -base64 9)_$(date +%y%m%d%H%M%S).png" -webpath='https://pub.yori.cc/screen/' -fileurl=$webpath$myfile - -# see: http://code.google.com/p/xmonad/issues/detail?id=476 -sleep 0.2 - -scrot $myfile -e 'mv $f ~/public/screen/' -s +webpath="https://pub.yori.cc/s/" +fileurl="$webpath$myfile" +grim -g "$(slurp)" "$HOME/public/s/$myfile" + # copy-paste -echo $fileurl | xclip -selection c +wl-copy <<< "$fileurl" cd ~ rsync -LavP --cvs-exclude public pub.yori.cc: diff --git a/bin/setdpi.sh b/bin/setdpi.sh index 7d64474..5149a5e 100755 --- a/bin/setdpi.sh +++ b/bin/setdpi.sh @@ -5,4 +5,3 @@ echo "Xft.dpi: $DPI" | xrdb -merge echo "*dpi: $DPI" | xrdb -merge xrandr --dpi $DPI pkill -HUP xsettingsd -pkill -USR1 polybar diff --git a/bin/toggle_solarized.sh b/bin/toggle_solarized.sh deleted file mode 100755 index 4c3ea6e..0000000 --- a/bin/toggle_solarized.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -DIR=~/dotfiles/x/solarized -COL=${1:-$(readlink $DIR/alternate)} -if [ $COL == "dark" ]; then - ROFI_THEME=solarized_alternate - ALTERNATE=light; - GTK_THEME=NumixSolarizedDark - nitrogen --set-auto wp/067\ -\ * -fi -if [ $COL == "light" ]; then - ALTERNATE=dark; - ROFI_THEME=Arc - GTK_THEME=NumixSolarized - nitrogen --set-auto wp/037\ -\ Ducks\ On\ A\ Misty\ Pond.jpg -fi - -echo "changing to solarized_$COL" -# rofi -sed -i "s/theme: .*;/theme: \"$ROFI_THEME\";/" ~/dotfiles/rofi/.config/rofi/config.rasi -# xrdb -ln -fs $ALTERNATE $DIR/alternate -ln -fs $COL $DIR/actual -xrdb ~/dotfiles/x/.Xdefaults -#polybar -pkill -USR1 polybar -#emacs -emacsclient -e "(load-theme 'solarized-$COL)" -# urxvt -RECOLOR=$(xrdb -query | tr -d ' \t' | sed -n ' -s/.*background:/\x1b]11;/p -s/.*foreground:/\x1b]10;/p -s/.*borderColor:/\x1b]708;/p -s/.*color\([0-9][^:]*\):/\x1b]4;\1;/p -' | tr \\n \\a) -for i in /dev/pts/*; do - echo -n $RECOLOR > $i -done -#gtk3 -sed -i "s#Net/ThemeName \".*\"#Net/ThemeName \"$GTK_THEME\"#" ~/.xsettingsd -pkill -HUP xsettingsd diff --git a/i3/.config/i3/config b/i3/.config/i3/config deleted file mode 120000 index 60517c3..0000000 --- a/i3/.config/i3/config +++ /dev/null @@ -1 +0,0 @@ -/home/yorick/dotfiles/result/i3-config \ No newline at end of file diff --git a/i3/.stow-local-ignore b/i3/.stow-local-ignore deleted file mode 100644 index 92c775a..0000000 --- a/i3/.stow-local-ignore +++ /dev/null @@ -1 +0,0 @@ -i3.nix diff --git a/i3/i3.nix b/i3/i3.nix deleted file mode 100644 index 16d8688..0000000 --- a/i3/i3.nix +++ /dev/null @@ -1,195 +0,0 @@ -{writeTextDir, writeScript, lib, -rofi, xss-lock, nitrogen, compton-git, i3status, i3-gaps, -i3lock-color, xset, alsaUtils, light, screenshot_public, xorg, libinput-gestures, -haskellPackages, polybar, rofi-pass, xsettingsd, -with_lock ? true, compton_name ? "default"}: - -let - kill-and-then = kill: thn: -''exec_always --no-startup-id "pkill ${kill}; while pgrep -x ${kill} >/dev/null; do sleep 1; done; ${thn}"''; - kill-and-restart = pkg: as: -with lib; let - name = head (splitString " " as); - args = concatStringsSep " " (tail (splitString " " as)); -in kill-and-then name "exec ${pkg}/bin/${name} ${args}"; -locker = writeScript "dlock.sh" '' -#!/bin/sh -revert() { - ${xset}/bin/xset dpms 0 0 0 -} -trap revert SIGHUP SIGINT SIGTERM -${xset}/bin/xset +dpms dpms 5 5 5 -${i3lock-color}/bin/i3lock-color -B 10 -r -n -e -revert -''; - -in - -writeTextDir "i3-config" ('' -# i3 config file (v4) -# Please see http://i3wm.org/docs/userguide.html for a complete reference! - -set $mod Mod4 - -gaps inner 5 -# gaps outer 5 - -font pango:Source Code Pro 10 - -# Before i3 v4.8, we used to recommend this one as the default: -# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 -# The font above is very space-efficient, that is, it looks good, sharp and -# clear in small sizes. However, its unicode glyph coverage is limited, the old -# X core fonts rendering does not support right-to-left and this being a bitmap -# font, it doesn’t scale on retina/hidpi displays. - -# Use Mouse+$mod to drag floating windows to their wanted position -floating_modifier $mod - -# start a terminal -bindsym $mod+Return exec i3-sensible-terminal - -# kill focused window -bindsym $mod+Shift+c kill - -# start dmenu (a program launcher) -bindsym $mod+e exec --no-startup-id ${rofi}/bin/rofi -fuzzy -show drun -bindsym $mod+z exec --no-startup-id ${rofi}/bin/rofi -fuzzy -show window - -# change focus -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+semicolon 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+j move left -bindsym $mod+Shift+k move down -bindsym $mod+Shift+l move up -bindsym $mod+Shift+semicolon 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 - -# 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+d layout toggle split - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle - -# focus the parent container -bindsym $mod+a focus parent - -# focus the child container -#bindsym $mod+d focus child - -# switch to workspace -bindsym $mod+1 workspace 1 -bindsym $mod+2 workspace 2 -bindsym $mod+3 workspace 3 -bindsym $mod+4 workspace 4 -bindsym $mod+5 workspace 5 -bindsym $mod+6 workspace 6 -bindsym $mod+7 workspace 7 -bindsym $mod+8 workspace 8 -bindsym $mod+9 workspace 9 -bindsym $mod+0 workspace 10 - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace number 1 -bindsym $mod+Shift+2 move container to workspace 2 -bindsym $mod+Shift+3 move container to workspace 3 -bindsym $mod+Shift+4 move container to workspace 4 -bindsym $mod+Shift+5 move container to workspace 5 -bindsym $mod+Shift+6 move container to workspace 6 -bindsym $mod+Shift+7 move container to workspace 7 -bindsym $mod+Shift+8 move container to workspace 8 -bindsym $mod+Shift+9 move container to workspace 9 -bindsym $mod+Shift+0 move container to workspace 10 - -bindsym $mod+ctrl+r reload -bindsym $mod+Shift+r restart -bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" - -bindsym $mod+ctrl+l exec --no-startup-id loginctl lock-session - -# 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 window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s 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 semicolon 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 - bindsym Return mode "default" - bindsym Escape mode "default" -} - -bindsym $mod+r mode "resize" -bindsym $mod+Escape workspace back_and_forth - - -exec_always --no-startup-id ${nitrogen}/bin/nitrogen --restore -${kill-and-restart compton-git "compton --config /home/yorick/dotfiles/x/compton_${compton_name}.conf"} -'' + (lib.optionalString with_lock '' - -${kill-and-then "polybar" "PATH=${polybar}/bin:$PATH /home/yorick/dotfiles/i3/polybar.sh"} -${kill-and-restart xss-lock "xss-lock -l -- ${locker}"} -${kill-and-restart libinput-gestures "libinput-gestures"} -${kill-and-restart haskellPackages.arbtt "arbtt-capture"} -${kill-and-restart xsettingsd "xsettingsd"} -'') + '' - -bindsym XF86MonBrightnessUp exec ${light}/bin/light -A 5 -bindsym XF86MonBrightnessDown exec ${light}/bin/light -U 5 -bindsym ctrl+XF86MonBrightnessUp exec ${light}/bin/light -A 1 -bindsym ctrl+XF86MonBrightnessDown exec ${light}/bin/light -U 1 -bindsym XF86AudioLowerVolume exec ${alsaUtils}/bin/amixer set Master 1%- -bindsym XF86AudioRaiseVolume exec ${alsaUtils}/bin/amixer set Master 1%+ -bindsym XF86AudioMute exec ${alsaUtils}/bin/amixer set Master toggle -bindsym $mod+Shift+s exec --no-startup-id ${screenshot_public}/bin/screenshot_public -bindsym Print exec --no-startup-id ${screenshot_public}/bin/screenshot_public -bindsym $mod+p exec --no-startup-id ${rofi-pass}/bin/rofi-pass -bindsym $mod+Shift+t exec --no-startup-id /home/yorick/dotfiles/bin/toggle_solarized.sh -workspace_auto_back_and_forth yes - -hide_edge_borders smart -for_window [class="URxvt"] border pixel 2 -new_window pixel 2 -'') diff --git a/i3/polybar b/i3/polybar deleted file mode 100644 index f2ecde0..0000000 --- a/i3/polybar +++ /dev/null @@ -1,354 +0,0 @@ -;===================================================== -; -; To learn more about how to configure Polybar -; go to https://github.com/jaagr/polybar -; -; The README contains alot of information -; -;===================================================== - -[colors] -background = ${xrdb:background} -background-alt = ${xrdb:color0} -foreground = ${xrdb:foreground:} -foreground-alt = ${xrdb:foreground:#555} -primary = ${xrdb:color6} -secondary = ${xrdb:color5} -alert = ${xrdb:color1} - -[bar/common] -monitor = ${env:MONITOR:} -width = 100% -fixed-center = true -dpi = ${env:DPI:${xrdb:Xft.dpi:-1}} - -height = 2.5% -radius = 8% - -background = ${colors.background} -foreground = ${colors.foreground} - -scroll-up = i3wm-wsnext -scroll-down = i3wm-wsprev - -font-0 = FontAwesome:size=10;1 -font-1 = ${xrdb:polybar.font} - - -tray-maxsize = 1000 -tray-background = ${colors.background} - -modules-left = i3 xwindow -modules-center = -;override-redirect = true - - -line-size = 5% -line-color = #f00 - -border-size = 2% -border-color = #00000000 - -padding-left = 0 -padding-right = 2 - -module-margin-left = 1 -module-margin-right = 2 - -[bar/ascanius_primary] -inherit = bar/common - -modules-right = spotify filesystem volume eth memory battery temperature date - - -tray-position = right - -[bar/ascanius_other] -inherit = bar/common - -modules-right = date - -; jarvis: retina screen -[bar/jarvis_primary] -inherit = bar/common - -modules-right = spotify filesystem volume backlight-acpi wlan memory battery temperature date - -tray-position = right - -[bar/jarvis_other] -inherit = bar/common - -modules-right = eth wlan memory battery temperature date - - - -; modules - -[module/xwindow] -type = internal/xwindow -label = %title:0:90:...% - -[module/xkeyboard] -type = internal/xkeyboard -blacklist-0 = num lock - -format-prefix = " " -format-prefix-foreground = ${colors.foreground-alt} -format-prefix-underline = ${colors.secondary} - -label-layout = %layout% -label-layout-underline = ${colors.secondary} - -label-indicator-padding = 2 -label-indicator-margin = 1 -label-indicator-background = ${colors.secondary} -label-indicator-underline = ${colors.secondary} - -[module/filesystem] -type = internal/fs -interval = 25 - -mount-0 = / - -label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% -label-unmounted = %mountpoint% not mounted -label-unmounted-foreground = ${colors.foreground-alt} - -[module/i3] -type = internal/i3 -format = -index-sort = true -wrapping-scroll = false -;strip-wsnumbers = true -; Only show workspaces on the same output as the bar -pin-workspaces = true - -label-mode-padding = 2 -label-mode-foreground = #000 -label-mode-background = ${colors.primary} - -; focused = Active workspace on focused monitor -label-focused = %index% %icon% -label-focused-background = ${colors.background-alt} -label-focused-underline= ${colors.primary} -label-focused-padding = 2 - -; unfocused = Inactive workspace on any monitor -label-unfocused = %index% %icon% -label-unfocused-padding = 2 - -; visible = Active workspace on unfocused monitor -label-visible = %index% %icon% -label-visible-background = ${self.label-focused-background} -label-visible-underline = ${self.label-focused-underline} -label-visible-padding = ${self.label-focused-padding} - -; urgent = Workspace with urgency hint set -label-urgent = %index% %icon% -label-urgent-background = ${colors.alert} -label-urgent-padding = 2 - -ws-icon-0 = 1; -ws-icon-1 = 2; -ws-icon-2 = 3; -ws-icon-default =  -ws-icon-3 = 6; -ws-icon-4 = 7; -; -; - -[module/xbacklight] -type = internal/xbacklight - -format =