diff options
Diffstat (limited to '.config')
-rw-r--r-- | .config/fish/config.fish | 8 | ||||
-rw-r--r-- | .config/fish/functions/sessiontype.fish | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/.config/fish/config.fish b/.config/fish/config.fish index adcbe4a..e5e5ba8 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish | |||
@@ -31,7 +31,6 @@ if status is-interactive | |||
31 | abbr --add --global bc 'bc -l' | 31 | abbr --add --global bc 'bc -l' |
32 | abbr --add --global bo 'bukuopener' | 32 | abbr --add --global bo 'bukuopener' |
33 | abbr --add --global cp 'cp -i' | 33 | abbr --add --global cp 'cp -i' |
34 | abbr --add --global C 'xsel -b' # Copy to clipboard | ||
35 | abbr --add --global df 'df -h' | 34 | abbr --add --global df 'df -h' |
36 | abbr --add --global free 'free -m' | 35 | abbr --add --global free 'free -m' |
37 | abbr --add --global gst 'git status' | 36 | abbr --add --global gst 'git status' |
@@ -60,6 +59,13 @@ if status is-interactive | |||
60 | abbr --add --global wim 'nvim /home/yigit/nextcloud/personal_wiki/text/index.wiki' | 59 | abbr --add --global wim 'nvim /home/yigit/nextcloud/personal_wiki/text/index.wiki' |
61 | abbr --add --global yst 'yadm status' | 60 | abbr --add --global yst 'yadm status' |
62 | abbr --add --global dr 'dragon-drop' | 61 | abbr --add --global dr 'dragon-drop' |
62 | abbr --add --global ddg 'surfraw duckduckgo -j' | ||
63 | |||
64 | if test (sessiontype) = "wayland" | ||
65 | abbr --add --global C 'wl-copy' # Wayland | ||
66 | else | ||
67 | abbr --add --global C 'xsel -b' # X11 | ||
68 | end | ||
63 | 69 | ||
64 | zoxide init fish | source | 70 | zoxide init fish | source |
65 | direnv hook fish | source | 71 | direnv hook fish | source |
diff --git a/.config/fish/functions/sessiontype.fish b/.config/fish/functions/sessiontype.fish new file mode 100644 index 0000000..33830ca --- /dev/null +++ b/.config/fish/functions/sessiontype.fish | |||
@@ -0,0 +1,8 @@ | |||
1 | # https://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used/371164#comment573431_325972 | ||
2 | |||
3 | function sessiontype | ||
4 | # https://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used/371164#comment573431_325972 | ||
5 | # have to run it first? | ||
6 | loginctl > /dev/null | ||
7 | loginctl show-session (loginctl | awk '/tty/ {print $1}') -p Type | awk -F= '{print $2}' | ||
8 | end | ||