Skip to content

Instantly share code, notes, and snippets.

@mockturtl
Created July 1, 2013 17:47
Show Gist options
  • Save mockturtl/5902983 to your computer and use it in GitHub Desktop.
Save mockturtl/5902983 to your computer and use it in GitHub Desktop.
`gnome-bluetooth` 3.8.1-1 breaks `gnome-shell` bluetooth applet
--- bluetooth.js.bak 2013-07-01 13:35:34.886134368 -0400
+++ bluetooth.js 2013-07-01 13:40:54.708592118 -0400
@@ -5,6 +5,7 @@
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const GnomeBluetoothApplet = imports.gi.GnomeBluetoothApplet;
+const GnomeBluetooth = imports.gi.GnomeBluetooth;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
@@ -36,11 +37,11 @@
this._applet.connect('notify::killswitch-state', Lang.bind(this, this._updateKillswitch));
this._killswitch.connect('toggled', Lang.bind(this, function() {
let current_state = this._applet.killswitch_state;
- if (current_state != GnomeBluetoothApplet.KillswitchState.HARD_BLOCKED &&
- current_state != GnomeBluetoothApplet.KillswitchState.NO_ADAPTER) {
+ if (current_state != GnomeBluetooth.KillswitchState.HARD_BLOCKED &&
+ current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER) {
this._applet.killswitch_state = this._killswitch.state ?
- GnomeBluetoothApplet.KillswitchState.UNBLOCKED:
- GnomeBluetoothApplet.KillswitchState.SOFT_BLOCKED;
+ GnomeBluetooth.KillswitchState.UNBLOCKED:
+ GnomeBluetooth.KillswitchState.SOFT_BLOCKED;
} else
this._killswitch.setToggleState(false);
}));
@@ -94,10 +95,10 @@
_updateKillswitch: function() {
let current_state = this._applet.killswitch_state;
- let on = current_state == GnomeBluetoothApplet.KillswitchState.UNBLOCKED;
- let has_adapter = current_state != GnomeBluetoothApplet.KillswitchState.NO_ADAPTER;
- let can_toggle = current_state != GnomeBluetoothApplet.KillswitchState.NO_ADAPTER &&
- current_state != GnomeBluetoothApplet.KillswitchState.HARD_BLOCKED;
+ let on = current_state == GnomeBluetooth.KillswitchState.UNBLOCKED;
+ let has_adapter = current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER;
+ let can_toggle = current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER &&
+ current_state != GnomeBluetooth.KillswitchState.HARD_BLOCKED;
this._killswitch.setToggleState(on);
if (can_toggle)
@mockturtl
Copy link
Author

Run in a terminal:

file="/usr/share/gnome-shell/js/ui/status/bluetooth.js"
url="https://gist.github.com/mockturtl/5902983/raw/cdbc2a26be3710ffced77827e2295e8df8002d61/bluetooth.js.patch"
cp $file $HOME/$(basename $file).bak  # make a backup, `~/bluetooth.js.bak`
curl -o bluetooth.js.patch $url
sudo patch $file < bluetooth.js.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment