Skip to content

Commit

Permalink
Fight
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanamiiiii committed Oct 31, 2024
1 parent 1a2e6ff commit 311f655
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 2 deletions.
2 changes: 1 addition & 1 deletion networkmanager-dmenu/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ list_saved = True
# obscure_color = #222222

[editor]
terminal = alacritty
terminal = wezterm
gui_if_available = True

[nmdm]
Expand Down
27 changes: 27 additions & 0 deletions networkmanager-dmenu/config_wofi.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[dmenu]
dmenu_command = wofi --dmenu -i
# # Note that dmenu_command can contain arguments as well like:
# # `dmenu_command = rofi -dmenu -i -theme nmdm`
# # `dmenu_command = rofi -dmenu -width 30 -i`
# # `dmenu_command = dmenu -i -l 25 -b -nb #909090 -nf #303030`
rofi_highlight = True
# compact = <True or False> # (Default: False). Remove extra spacing from display
# pinentry = <Pinentry command> # (Default: None) e.g. `pinentry-gtk`
# wifi_chars = <string of 4 unicode characters representing 1-4 bars strength>
wifi_chars = ▂▄▆█
list_saved = True

[dmenu_passphrase]
# # Uses the -password flag for Rofi, -x for bemenu. For dmenu, sets -nb and
# # -nf to the same color or uses -P if the dmenu password patch is applied
# # https://tools.suckless.org/dmenu/patches/password/
# obscure = True
# obscure_color = #222222

[editor]
terminal = wezterm
gui_if_available = True

[nmdm]
# rescan_delay = <seconds> # (seconds to wait after a wifi rescan before redisplaying the results)

28 changes: 28 additions & 0 deletions scripts/sway_configure_display.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

TARGET_OUTPUT=$(swaymsg -t get_outputs | jq -r '.[].name' | wofi --dmenu -p "Target display ..." -H "300")

case $((echo 'Mode'; echo 'Power'; echo 'Cancel') | wofi --dmenu -p "Command" -H "300") in
"Mode")
echo "Currently not supported."
;;
"Power")
case $((echo 'On'; echo 'Off') | wofi --dmenu -p "Display Power" -H "300") in
"On")
swaymsg -- output ${TARGET_OUTPUT} enable
;;
"Off")
swaymsg -- output ${TARGET_OUTPUT} disable
;;
*)
echo "Error: invalid command"
;;
esac
;;
"Cancel")
;;
*)
echo "Error: invalid command"
;;
esac
5 changes: 5 additions & 0 deletions scripts/sway_move_ws.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

TARGET_OUTPUT=$(swaymsg -t get_outputs | jq -r '.[].name' | wofi --dmenu -p "Move to ..." -H "300")
swaymsg -t move workspace to ${TARGET_OUTPUT}

3 changes: 2 additions & 1 deletion scripts/system_swayenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ QT_SCALE_FACTOR=1
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_QPA_PLATFORMTHEME=qt6ct
QT_IM_MODULE=fcitx
GTK_IM_MODULE=fcitx
#MOZ_ENABLE_WAYLAND=1
_JAVA_AWT_WM_NONREPARENTING=1

export XDG_SESSION_TYPE XDG_CURRENT_DESKTOP XDG_CURRENT_SESSION DESKTOP_SESSION LIBSEAT_BACKEND QT_QPA_PLATFORM GDK_DPI_SCALE QT_SCALE_FACTOR QT_AUTO_SCREEN_SCALE_FACTOR QT_QPA_PLATFORMTHEME QT_IM_MODULE _JAVA_AWT_WM_NONREPARENTING;
export XDG_SESSION_TYPE XDG_CURRENT_DESKTOP XDG_CURRENT_SESSION DESKTOP_SESSION LIBSEAT_BACKEND QT_QPA_PLATFORM GDK_DPI_SCALE QT_SCALE_FACTOR QT_AUTO_SCREEN_SCALE_FACTOR QT_QPA_PLATFORMTHEME QT_IM_MODULE GTK_IM_MODULE _JAVA_AWT_WM_NONREPARENTING;

systemd-cat --identifier=sway sway "$@"

12 changes: 12 additions & 0 deletions sway/keybinding.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ bindsym $mod+shift+slash exec playerctl --player playerctld position +10
# show history with clipboard manager & wofi
bindsym $mod+v exec cliphist list | wofi -d -p clipboard | cliphist decode | wl-copy

# Networkmanager dmenu
bindsym $mod+n exec networkmanager_dmenu

# Display Settings
bindsym $mod+Shift+o exec ~/.scripts/sway_configure_display.sh

## Screenshot
# [fullscreen, copy & save]
bindsym $super+shift+a exec $grimshot --notify save output ~/Pictures/screenshot/$(date "+%Y%m%d-%H%M%S")'_grim_full.png'
Expand Down Expand Up @@ -61,6 +67,12 @@ bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right

# Move forcused workspace over display
bindsym $mod+Shift+a move workspace to left
bindsym $mod+Shift+s move workspace to down
bindsym $mod+Shift+w move workspace to up
bindsym $mod+Shift+d move workspace to right

# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
Expand Down

0 comments on commit 311f655

Please sign in to comment.